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-18 15:33:08 +0100 |
commit | 4b7b6993134a48c850608c758f7b7283bed27fec (patch) | |
tree | 8c01c556bc4434f6f649c6bf8d48a2b6c9f1975d /svx | |
parent | 280f54a942ce9fe0177100312fc45a398955bd8a (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>
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 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; + } } } |