svl::SharedString::getDataIgnoreCase() returns unexpected result

Winfried Donkers W.Donkers at dci-electronics.nl
Mon Jun 13 09:29:49 UTC 2016


Hi Eike,

> 
> Likely aRefStr isn't interned, but only constructed from an OUString.

I made a quick fix by using aRefStr.getString().equalsIgnoreAsciiCase( aStr.getString() ) instead.
That works, now SWITCH("C";"c";"OK") returns OK in Calc.

I don't have branch 5.2, and I don't want to 'fix' master as I am very close to converting the function to a jump function (SWITCH works, IFS is next).

What do you advise as quickest/best way to fix version 5.2?

Winfried


diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index dcf43d2..76159a3 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1968,7 +1968,7 @@ void ScInterpreter::ScSwitch_MS()
             aStr = GetString();
         nParamCount--;
         if ( nGlobalError || (( isValue && rtl::math::approxEqual( fRefVal, fVal ) ) ||
-             ( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) )
+             ( !isValue && aRefStr.getString().equalsIgnoreAsciiCase( aStr.getString() ) ) ) )
         {
             // TRUE
             bFinished = true;


More information about the LibreOffice mailing list