summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-06-14 13:41:54 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-14 15:39:09 +0200
commit6a71ee9555af6eac4fba78cd94abcd2760ae9870 (patch)
treedf253b304743a53c4771172cbe2bee28f5cda082 /svtools
parent0e81b8ecbb61572ae50321801c26c2df1eb95ee4 (diff)
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@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/ctrltool.cxx7
1 files changed, 3 insertions, 4 deletions
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, ';' ));
}