summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-29 11:06:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-01 08:30:18 +0200
commit5200a73627d13e2997f81b53f61e143e77e328ee (patch)
treef95c8346d061ecd0ad33d574895d18e169662785 /linguistic
parentb90d3d316dd9c720c83180b31f6bbd7003fead78 (diff)
use more string_view in various
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/misc.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 411361d38d66..de2bc96860ee 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -521,7 +521,6 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars(
//! should at least work with the German words
//! B-"u-c-k-er and Sc-hif-fah-rt
- OUString aLeft, aRight;
sal_Int16 nPos = GetOrigWordPos( rOrigWord, nChgPos );
// get words like Sc-hif-fah-rt to work correct
@@ -529,12 +528,12 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars(
if (nChgPos > nHyphenationPos)
--nPos;
- aLeft = rOrigWord.copy( 0, nPos );
- aRight = rOrigWord.copy( nPos ); // FIXME: changes at the right side
+ std::u16string_view aLeft = rOrigWord.subView( 0, nPos );
+ std::u16string_view aRight = rOrigWord.subView( nPos ); // FIXME: changes at the right side
aOrigHyphenatedWord = aLeft + aRplc + aRight;
- nOrigHyphenPos = sal::static_int_cast< sal_Int16 >(aLeft.getLength() +
+ nOrigHyphenPos = sal::static_int_cast< sal_Int16 >(aLeft.size() +
rxHyphWord->getHyphenPos() - nChgPos);
nOrigHyphenationPos = GetOrigWordPos( rOrigWord, nHyphenationPos );
}