summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-09-01 12:07:30 +0200
committerJulien Nabet <serval2412@yahoo.fr>2022-09-01 13:42:39 +0200
commit076be52655f2cf4e331b344e0f6497f41b37fa8c (patch)
treeb20eddb366b2090d01123190b946da8154d464d6 /svx
parent63f7765c1d50fbd87b53d692a2cd1720a7a16d70 (diff)
tdf#150712: Format->Conditional->Condition 100% CPU
Flamegraph showed this part, see: https://bugs.documentfoundation.org/attachment.cgi?id=182121 Change-Id: Id14ea4f95d8912847f77eed561b14d3edee2f67f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139152 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/fntctrl.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 58b412f1e822..04af6deae0b6 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -124,15 +124,9 @@ void setFont(const SvxFont& rNewFont, SvxFont& rImplFont)
*/
bool CleanAndCheckEmpty(OUString& rText)
{
- bool bEmpty = true;
- for (sal_Int32 i = 0; i < rText.getLength(); ++i)
- {
- if (0xa == rText[i] || 0xd == rText[i])
- rText = rText.replaceAt(i, 1, u" ");
- else
- bEmpty = false;
- }
- return bEmpty;
+ rText = rText.replaceAll("\xa", u" ");
+ rText = rText.replaceAll("\xd", u" ");
+ return rText.isEmpty();
}
} // end anonymous namespace