[Libreoffice-commits] core.git: Branch 'private/kohei/calc-shared-string' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Oct 4 10:17:05 PDT 2013


 sc/source/core/tool/interpr1.cxx |   24 ++++++++++++------------
 sc/source/core/tool/interpr2.cxx |    4 ++--
 sc/source/core/tool/interpr4.cxx |    8 ++++----
 3 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit cda87440ff5e32a415c83bd956632e241bf39a00
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Oct 4 13:18:12 2013 -0400

    ScInterpreter::GetString() now returns a ref to OUString.
    
    Making adjustments in some call sites.
    
    Change-Id: I85aca2eeb2aece46be52d90a611a64d85792a05f

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index b8e9f64..a997c92 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -591,7 +591,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
                 break;
                 case svString:
                 {
-                    const String& rStr = GetString();
+                    const OUString& rStr = GetString();
                     if ( nGlobalError )
                     {
                         pResMat->PutDouble( CreateDoubleError( nGlobalError),
@@ -3150,7 +3150,7 @@ void ScInterpreter::ScTrim()
 
 void ScInterpreter::ScUpper()
 {
-    String aString = ScGlobal::pCharClass->uppercase(GetString());
+    OUString aString = ScGlobal::pCharClass->uppercase(GetString());
     PushString(aString);
 }
 
@@ -3182,15 +3182,15 @@ void ScInterpreter::ScPropper()
 
 void ScInterpreter::ScLower()
 {
-    String aString = ScGlobal::pCharClass->lowercase(GetString());
+    OUString aString = ScGlobal::pCharClass->lowercase(GetString());
     PushString(aString);
 }
 
 
 void ScInterpreter::ScLen()
 {
-    String aStr( GetString() );
-    PushDouble( aStr.Len() );
+    const OUString& aStr = GetString();
+    PushDouble( aStr.getLength() );
 }
 
 
@@ -3456,7 +3456,7 @@ void ScInterpreter::ScClean()
 void ScInterpreter::ScCode()
 {
 //2do: make it full range unicode?
-    const String& rStr = GetString();
+    String aStr = GetString();
     //"classic" ByteString conversion flags
     const sal_uInt32 convertFlags =
         RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE |
@@ -3465,7 +3465,7 @@ void ScInterpreter::ScCode()
         RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT |
         RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT |
         RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE;
-    PushInt( (sal_uChar) OUStringToOString(OUString(rStr.GetChar(0)), osl_getThreadTextEncoding(), convertFlags).toChar() );
+    PushInt( (sal_uChar) OUStringToOString(OUString(aStr.GetChar(0)), osl_getThreadTextEncoding(), convertFlags).toChar() );
 }
 
 
@@ -6713,7 +6713,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
         break;
         case svString:
         {
-            const String& sStr = GetString();
+            const OUString& sStr = GetString();
             rItem.meType = ScQueryEntry::ByString;
             rItem.maString = sStr;
         }
@@ -8262,11 +8262,11 @@ void ScInterpreter::ScMid()
     {
         double fAnz    = ::rtl::math::approxFloor(GetDouble());
         double fAnfang = ::rtl::math::approxFloor(GetDouble());
-        const String& rStr = GetString();
+        String aStr = GetString();
         if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(STRING_MAXLEN) || fAnz > double(STRING_MAXLEN))
             PushIllegalArgument();
         else
-            PushString(rStr.Copy( (xub_StrLen) fAnfang - 1, (xub_StrLen) fAnz ));
+            PushString(aStr.Copy( (xub_StrLen) fAnfang - 1, (xub_StrLen) fAnz ));
     }
 }
 
@@ -8275,7 +8275,7 @@ void ScInterpreter::ScText()
 {
     if ( MustHaveParamCount( GetByte(), 2 ) )
     {
-        OUString sFormatString = GetString();
+        const OUString& sFormatString = GetString();
         OUString aStr;
         bool bString = false;
         double fVal = 0.0;
@@ -8432,7 +8432,7 @@ void ScInterpreter::ScConcat()
     String aRes;
     while( nParamCount-- > 0)
     {
-        const String& rStr = GetString();
+        const OUString& rStr = GetString();
         aRes.Insert( rStr, 0 );
     }
     PushString( aRes );
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index c914396..fcb23d7 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -162,7 +162,7 @@ void ScInterpreter::ScGetHour()
 
 void ScInterpreter::ScGetDateValue()
 {
-    String aInputString = GetString();
+    const OUString& aInputString = GetString();
     sal_uInt32 nFIndex = 0;                 // damit default Land/Spr.
     double fVal;
     if (pFormatter->IsNumberFormat(aInputString, nFIndex, fVal))
@@ -388,7 +388,7 @@ void ScInterpreter::ScGetDateDif()
 {
     if ( MustHaveParamCount( GetByte(), 3 ) )
     {
-        OUString aInterval = GetString();
+        const OUString& aInterval = GetString();
         double nDate2    = GetDouble();
         double nDate1    = GetDouble();
 
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7288613..deb5bca 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2726,7 +2726,7 @@ void ScInterpreter::ScExternal()
                     break;
 
                 case SC_ADDINARG_STRING:
-                    aParam <<= OUString( GetString() );
+                    aParam <<= GetString();
                     break;
 
                 case SC_ADDINARG_INTEGER_ARRAY:
@@ -2806,7 +2806,7 @@ void ScInterpreter::ScExternal()
                         case svString:
                         case svSingleRef:
                             {
-                                OUString aString = OUString( GetString() );
+                                const OUString& aString = GetString();
                                 uno::Sequence<OUString> aInner( &aString, 1 );
                                 uno::Sequence< uno::Sequence<OUString> > aOuter( &aInner, 1 );
                                 aParam <<= aOuter;
@@ -2841,7 +2841,7 @@ void ScInterpreter::ScExternal()
                                 if ( nStackType == svDouble )
                                     aElem <<= (double) GetDouble();
                                 else if ( nStackType == svString )
-                                    aElem <<= OUString( GetString() );
+                                    aElem <<= GetString();
                                 else
                                 {
                                     ScAddress aAdr;
@@ -2891,7 +2891,7 @@ void ScInterpreter::ScExternal()
                             aParam <<= (double) GetDouble();
                             break;
                         case svString:
-                            aParam <<= OUString( GetString() );
+                            aParam <<= GetString();
                             break;
                         case svSingleRef:
                             {


More information about the Libreoffice-commits mailing list