From 049bc1e7d7ca44767dc826fdda161e01306bf17b Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 6 Feb 2022 16:43:59 +0100 Subject: No need to call makeStringAndClear to pass a string view Change-Id: Id9e18e66f3b3c583d7cb22ee0a5d6272ca2f7ea9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129556 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- svl/source/numbers/zforfind.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'svl') diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 330921242a01..438eacabc893 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1432,11 +1432,10 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) // Expand again in case of pattern "M. D. " and // input "M. D. ", maybe fetched far, but... padToLength(aBuf, rPat.getLength() - nPat, ' '); - OUString aStr = aBuf.makeStringAndClear(); - bOk = (rPat.indexOf( aStr, nPat) == nPat); + bOk = (rPat.indexOf( aBuf, nPat) == nPat); if (bOk) { - nPat += aStr.getLength() - 1; + nPat += aBuf.getLength() - 1; } } } @@ -1551,7 +1550,7 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I OUStringBuffer aBuf(sStrArray[nNext]); aBuf.stripEnd(); padToLength(aBuf, rPat.getLength() - nPat, ' '); - bOk = (rPat.indexOf( aBuf.makeStringAndClear(), nPat) == nPat); + bOk = (rPat.indexOf(aBuf, nPat) == nPat); } if (bOk) { -- cgit