[Libreoffice-commits] core.git: svtools/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 14 13:39:49 UTC 2021


 svtools/source/control/ctrltool.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 6a71ee9555af6eac4fba78cd94abcd2760ae9870
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jun 14 13:41:54 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Jun 14 15:39:09 2021 +0200

    Only look for semicolon if colon is found
    
    Change-Id: Iddc7dc11fe6633b6e7134c5b2e20fc522d0fc0cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117120
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index ac2332e3e1ec..f9c7f30c6b97 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -160,10 +160,9 @@ static OUString ImplMakeSearchString(const OUString& rStr)
 static OUString ImplMakeSearchStringFromName(const OUString& rStr)
 {
     // check for features before alternate font separator
-    sal_Int32 nColon = rStr.indexOf(':');
-    sal_Int32 nSemiColon = rStr.indexOf(';');
-    if (nColon != -1 && (nSemiColon == -1 || nColon < nSemiColon))
-        return ImplMakeSearchString(rStr.getToken( 0, ':' ));
+    if (sal_Int32 nColon = rStr.indexOf(':'); nColon != -1)
+        if (sal_Int32 nSemiColon = rStr.indexOf(';'); nSemiColon == -1 || nColon < nSemiColon)
+            return ImplMakeSearchString(rStr.getToken( 0, ':' ));
     return ImplMakeSearchString(rStr.getToken( 0, ';' ));
 }
 


More information about the Libreoffice-commits mailing list