Re: Proper way to find an existing number format style.

Niklas Nebel <[email protected]> Tue, 31 May 2011 11:37:35 +0200
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
On 31.05.2011 07:34, Andrew Douglas Pitonyak wrote:
> Tested on 3.3.0 en-US using the 64-bit Linux version on Fedora 15.
>
> I use the following macro to find an existing number format, and I
> create it if it does not exist. The problem is that
> oDoc.getNumberFormats().queryKey(sFormat, aLocale, True) fails to find
> user created numeric formats, it only returns a value for for formats
> strings contained in the document.

> formats() =3D Array("0", "#,##0", "$#,##0.--;[RED]-$#,##0.--", "##0,0#\=
h",
> "##0,0#\=C2=B0C", "#0,0#\W\h", "##0,0#\k\W\h")

Assuming en-US locale settings, "##0,0#\h" with the thousands separator=20
character is changed to "##,00#\h" in addNew, but not in queryKey. It's=20
the same problem as in issue 38981 and 72380. You should try to use=20
format strings that don't have to be modified.

Niklas
--=20
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help