Kaydet (Commit) 560a0f2f authored tarafından Noel Grandin's avatar Noel Grandin

tdf#63640 FILEOPEN/FILESAVE: particular .odt loads/saves very slow, part3

Reduce time spent constructing strings from char arrays just to do a
comparison

Change-Id: I7af99747530d91d57e1a5b789ca9989a616428fc
Reviewed-on: https://gerrit.libreoffice.org/71464
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9eae5555
......@@ -1542,16 +1542,33 @@ static bool SvxUnoConvertResourceString(const char **pSourceResIds, const char**
for (int i = 0; i < nCount; ++i)
{
const OUString aCompare = bToApi ? SvxResId(pSourceResIds[i]) : OUString::createFromAscii(pSourceResIds[i]);
if( aShortString == aCompare )
if (bToApi)
{
rString = rString.replaceAt( 0, aShortString.getLength(), bToApi ? OUString::createFromAscii(pDestResIds[i]) : SvxResId(pDestResIds[i]) );
return true;
const OUString & aCompare = SvxResId(pSourceResIds[i]);
if( aShortString == aCompare )
{
rString = rString.replaceAt( 0, aShortString.getLength(), OUString::createFromAscii(pDestResIds[i]) );
return true;
}
else if( rString == aCompare )
{
rString = OUString::createFromAscii(pDestResIds[i]);
return true;
}
}
else if( rString == aCompare )
else
{
rString = bToApi ? OUString::createFromAscii(pDestResIds[i]) : SvxResId(pDestResIds[i]);
return true;
auto pCompare = pSourceResIds[i];
if( aShortString.equalsAscii(pCompare) )
{
rString = rString.replaceAt( 0, aShortString.getLength(), SvxResId(pDestResIds[i]) );
return true;
}
else if( rString.equalsAscii(pCompare) )
{
rString = SvxResId(pDestResIds[i]);
return true;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment