diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-18 15:35:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-19 10:35:50 +0100 |
commit | aff6aa31eac39d5ac41095494852833d73cd28a7 (patch) | |
tree | e6d10219910ae0eb6bb6a353bb6683b082016e73 /svx | |
parent | dc456be2f315bacea4e65d63d3765a54b126cb86 (diff) |
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@collabora.co.uk>
(cherry picked from commit 4b7b6993134a48c850608c758f7b7283bed27fec)
Reviewed-on: https://gerrit.libreoffice.org/85399
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
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; + } } } |