svx/source/dialog/fntctrl.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit e4d9d522fec5770dd25f99384ae7a012636662cb
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Sep 1 14:16:37 2022 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Sep 1 14:17:12 2022 +0200

    Revert "tdf#150712: Format->Conditional->Condition 100% CPU"
    
    This reverts commit 076be52655f2cf4e331b344e0f6497f41b37fa8c.
    
    Reason for revert: I misread and we replaced "xa" "xd" by empty but it's a 
space.
    
    Change-Id: I0246f6a3c667b4336f21ffd61fd86574009b7956
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139175
    Tested-by: Julien Nabet <serval2...@yahoo.fr>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 04af6deae0b6..58b412f1e822 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -124,9 +124,15 @@ void setFont(const SvxFont& rNewFont, SvxFont& rImplFont)
  */
 bool CleanAndCheckEmpty(OUString& rText)
 {
-    rText = rText.replaceAll("\xa", u" ");
-    rText = rText.replaceAll("\xd", u" ");
-    return rText.isEmpty();
+    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;
 }
 } // end anonymous namespace
 

Reply via email to