From 65e4a776e8315fd61fd67ad00d28985b11f0b79e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 11 Jul 2017 10:31:38 +0200 Subject: simplify some OUString::copy calls Change-Id: Ifa228ca02ea79a1309e1875414028aade7e5f12d Reviewed-on: https://gerrit.libreoffice.org/39801 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/filter/excel/xehelper.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 37244ae8ae80..a8317347e022 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -888,13 +888,13 @@ OUString lclEncodeDosUrl( OUString aOldUrl = rUrl; aBuf.append(EXC_URLSTART_ENCODED); - if ( aOldUrl.getLength() > 2 && aOldUrl.copy(0,2) == "\\\\" ) + if ( aOldUrl.getLength() > 2 && aOldUrl.startsWith("\\\\") ) { // UNC aBuf.append(EXC_URL_DOSDRIVE).append('@'); aOldUrl = aOldUrl.copy(2); } - else if ( aOldUrl.getLength() > 2 && aOldUrl.copy(1,2) == ":\\" ) + else if ( aOldUrl.getLength() > 2 && aOldUrl.match(":\\", 1) ) { // drive letter sal_Unicode cThisDrive = rBase.isEmpty() ? ' ' : rBase[0]; @@ -916,7 +916,7 @@ OUString lclEncodeDosUrl( sal_Int32 nPos = -1; while((nPos = aOldUrl.indexOf('\\')) != -1) { - if ( aOldUrl.copy(0,2) == ".." ) + if ( aOldUrl.startsWith("..") ) // parent dir (NOTE: the MS-XLS spec doesn't mention this, and // Excel seems confused by this token). aBuf.append(EXC_URL_PARENTDIR); -- cgit