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

New commits:
commit aff6aa31eac39d5ac41095494852833d73cd28a7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Dec 18 15:35:53 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Dec 19 10:35:50 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.gran...@collabora.co.uk>
    (cherry picked from commit 4b7b6993134a48c850608c758f7b7283bed27fec)
    Reviewed-on: https://gerrit.libreoffice.org/85399
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index a3c02ecf9074..b7c103cb2abe 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1771,12 +1771,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 aReplace = bToApi ? 
OUString::createFromAscii(pDestResIds[i]) : SvxResId(pDestResIds[i]);
-            rString = rString.replaceAt( 0, aStrDefName.getLength(), aReplace 
);
-            return true;
+            OUString aStrDefName = SvxResId(pSourceResIds[i]);
+            if( sStr == aStrDefName )
+            {
+                OUString aReplace = OUString::createFromAscii(pDestResIds[i]);
+                rString = rString.replaceAt( 0, aStrDefName.getLength(), 
aReplace );
+                return true;
+            }
+        }
+        else
+        {
+            if( sStr.equalsAscii(pSourceResIds[i]) )
+            {
+                OUString aReplace = SvxResId(pDestResIds[i]);
+                rString = rString.replaceAt( 0, strlen(pSourceResIds[i]), 
aReplace );
+                return true;
+            }
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to