From 9fa9a510f9a391979a1f5f25ae1b5f4392db7692 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 13 Feb 2023 08:54:27 +0300 Subject: Use startsWithIgnoreAsciiCase with last argument to simplify Change-Id: Ifa1261ed76ec078a60fcdbd4ce806abe23e4c056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146850 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- basctl/source/basicide/scriptdocument.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 4136ced4c18e..c435d7a57da7 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -928,10 +928,9 @@ namespace basctl } else if ( aScheme.equalsIgnoreAsciiCase("vnd.sun.star.pkg") ) { - OUString aAuthority = xUriRef->getAuthority(); - if ( aAuthority.matchIgnoreAsciiCase("vnd.sun.star.expand:") ) + OUString aDecodedURL = xUriRef->getAuthority(); + if (aDecodedURL.startsWithIgnoreAsciiCase("vnd.sun.star.expand:", &aDecodedURL)) { - OUString aDecodedURL( aAuthority.copy( sizeof ( "vnd.sun.star.expand:" ) - 1 ) ); aDecodedURL = ::rtl::Uri::decode( aDecodedURL, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); Reference< XMacroExpander > xMacroExpander = theMacroExpander::get(xContext); aFileURL = xMacroExpander->expandMacros( aDecodedURL ); -- cgit