Issue 80037 - Don't offer automatic currency format in list of format codes if not used.
Summary: Don't offer automatic currency format in list of format codes if not used.
Alias: None
Product: Calc
Classification: Application
Component: formatting (show other issues)
Version: OOo 2.2.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
: 81277 (view as issue list)
Depends on:
Reported: 2007-07-25 18:19 UTC by benzman1981
Modified: 2017-05-20 11:11 UTC (History)
2 users (show)

See Also:
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description benzman1981 2007-07-25 18:19:56 UTC
When I try to format a cell as a currency and choose "Automatic" from the drop 
down list then the old currency of germany "DM" is set and not "€".

This issue also occurs in Writer when you try to choose the format for a 

I run a German WinXP with the German version of OOo 2.2.1.

Steps to reproduce in Calc:
- Open a new Calc document
- Right click on a cell and choose to format the cell
- Choose "Currency" as category
- Then in the drop down list for "Formats" chose the fist one "Automatic"
- Now You can see that "DM" is used instead of "€"

Steps to reproduce in Writer:
- Open a new Writer document
- Go to "Insert -> Field -> Other..."
- Go to the tab "Variables"
- Set a variables name and value and choose "other formats..." within the 
formats box
- Choose "Currency" as category
- Then in the drop down list for "Formats" chose the fist one "Automatic"
- Now You can see that "DM" is used instead of "€"

I hope a fix for it will be provided with 2.3 in september.

Comment 1 Regina Henschel 2007-07-25 19:45:29 UTC
No P1 issue, you can easily select the language and currency format in that
dialog and need not use "automatic".

At least there is a documentation issue because the purpose of format
"automatic" is not explained in the help. But I think too, that DM cannot be right.
Comment 2 frank 2007-07-26 08:13:03 UTC

as far as I know this is for compatibility reason to the old binary formats
(.sdc) if we remove this or change the currency to Euro these documents or
better it's owner becomes twice as rich as before or has to pay nearly the
double price as expected. 


Please close if the former comment is correct.

Comment 3 ooo 2007-07-26 10:57:59 UTC
Correct. The automatic currency format is needed for compatibility with legacy
documents and should not be used for new attributions. I take this issue as an
enhancement though to hide these entries in the list of offered format codes if
the format is not already used in the current context.
Comment 4 benzman1981 2007-07-26 12:34:11 UTC
this is not only solved by hiding this entry for real users. The 
problem also occurs if I use API. I have a Java program that creates a new variable in a writer document. For this variable I need to set 
the currency format. Now if I set the number format for it (kex index 20, for 
example), then the currency "DM" is used and not "EUR" as it seems to choose 
the automatic one. I retrive the indexes with the XNumberFormats interface and 
the call:
xNumberFormats.queryKeys(NumberFormat.ALL,new Locale("de","DE",""),false);
Maybe I do something wrong, but this is what the documentation says.


Comment 5 ooo 2007-07-26 13:28:54 UTC
Hi Markus,

So then the queryKeys() method should also not offer it. In fact both places use
the same subroutine.

And no, you don't do anything wrong, you'd "just" had to refrain from using the
nasty automatic format. Unfortunately  that isn't straight forward using the
API. For each format returned by queryKeys() call getByKey() and inspect the
util::NumberFormatProperties returned. If the Type is
util::NumberFormat::CURRENCY check whether FormatString contains "[$", if it
doesn't it is an automatic format.

But why do you query for all formats if you want only currency formats? If you
just want to apply some currency format matching the locale use
instead. That never returns an automatic currency format.

Comment 6 benzman1981 2007-07-26 13:34:56 UTC
Hello Eike,
I actually need to provide a liste of all available formats and the only one 
that returns a wrong format string is the currency. The problem is, that I 
don't get any euro specific currency using the way I descibed early with the 
method queryKeys(). I just get the "DM" currencies. Otherwise I could just 
filter it.

Thank you,

Comment 7 ooo 2007-09-05 12:18:13 UTC
*** Issue 81277 has been marked as a duplicate of this issue. ***
Comment 8 Marcus 2017-05-20 11:11:15 UTC
Reset assigne to the default "".