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: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 0d31e6e..0bb5d13 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1542,16 +1542,33 @@
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;
}
}
}