JunitTest_sc_unoapi_4 depends on localization

Eike Rathke erack at redhat.com
Thu Jun 11 06:12:12 PDT 2015


Hi julien2412,

On Saturday, 2015-06-06 07:54:57 -0700, julien2412 wrote:

> I created a bugtracker for this, see
> https://bugs.documentfoundation.org//show_bug.cgi?id=91899

It's not a bug ;)

> I'm looking for a way to do this:
>      91             bResult &= oSheet.getCellByPosition
>      92                 (CA.Column,
> CA.Row).getFormula().equals(<translateFunctionInLocaleUI>("Filter"));

What you probably want instead is to execute the test always in an en-US
locale, translating a formula expression between locales without
compiling the formula in one locale and outputting the code in another
locale as string would be hard to achieve if not impossible. In general
you want to run ~all tests in an en-US locale and not an arbitrary
locale inherited from the system.

In this case it's the UI locale/language that's relevant for
spreadhsheet function names AND the locale for representation of numeric
values.

Instead of changing the UI locale you can also switch the function names
to English in Tools -> Options -> Calc -> Formula "Use English function
names".

Changing locales and function names should be available through the
configuration access API, but I don't know by heart.

Another possibility would be to use the XFormulaTokens interface at the
cell object and getTokens() and compare the returned
sequence<FormulaToken> to known values or ones obtained through
XFormulaOpCodeMapper::getMappings(), but I doubt you want to get into
that for your problem..

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150611/819b1d5c/attachment.sig>


More information about the LibreOffice mailing list