[Libreoffice-commits] core.git: svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 18 14:34:32 UTC 2019


 svx/source/unodraw/unoprov.cxx |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 4b7b6993134a48c850608c758f7b7283bed27fec
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 18 15:35:53 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 18 15:33:08 2019 +0100

    reduce temporary OUString creation
    
    speeds up dialog load time a little (5%)
    
    Change-Id: Ia4e5f1973bb6f06b2b5ec6a251e4ad07fc3636d2
    Reviewed-on: https://gerrit.libreoffice.org/85389
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 891423952aff..639b8c798d39 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1838,12 +1838,24 @@ static bool SvxUnoConvertResourceStringBuiltIn(const char** pSourceResIds, const
 
     for(int i = 0; i < nCount; ++i )
     {
-        OUString aStrDefName = bToApi ? SvxResId(pSourceResIds[i]) : OUString::createFromAscii(pSourceResIds[i]);
-        if( sStr == aStrDefName )
+        if (bToApi)
+        {
+            OUString aStrDefName = SvxResId(pSourceResIds[i]);
+            if( sStr == aStrDefName )
+            {
+                OUString aReplace = OUString::createFromAscii(pDestResIds[i]);
+                rString = rString.replaceAt( 0, aStrDefName.getLength(), aReplace );
+                return true;
+            }
+        }
+        else
         {
-            OUString aReplace = bToApi ? OUString::createFromAscii(pDestResIds[i]) : SvxResId(pDestResIds[i]);
-            rString = rString.replaceAt( 0, aStrDefName.getLength(), aReplace );
-            return true;
+            if( sStr.equalsAscii(pSourceResIds[i]) )
+            {
+                OUString aReplace = SvxResId(pDestResIds[i]);
+                rString = rString.replaceAt( 0, strlen(pSourceResIds[i]), aReplace );
+                return true;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list