diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-28 12:38:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-28 17:32:18 +0100 |
commit | 943060836339f9640c612e9724f20e79db616e6e (patch) | |
tree | 3dc6e7748aef3ef0f2fca86979792162daa443fc /editeng | |
parent | d249bd5a3dfe13052ce9aa91bad94ec7d60604d4 (diff) |
simplify code, use more subView()
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 2 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index e1a9c91e3ee5..19f4362a8ff8 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1643,7 +1643,7 @@ OUString ContentNode::GetExpandedText(sal_Int32 nStartPos, sal_Int32 nEndPos) co DBG_ASSERT( nEnd >= nIndex, "End in front of the index?" ); //!! beware of sub string length of -1 if (nEnd > nIndex) - aStr.append( std::u16string_view(GetString()).substr(nIndex, nEnd - nIndex) ); + aStr.append( GetString().subView(nIndex, nEnd - nIndex) ); if ( pNextFeature ) { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 0f048114462b..a551188a4c66 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -3029,12 +3029,12 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p nTmp++; if (nTmp < nSttWdPos) break; // word delimiter found - buf.append(std::u16string_view(rTxt).substr(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong()); + buf.append(rTxt.subView(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong()); nFndPos = nSttWdPos + sTmp.getLength(); } } while (nSttWdPos != -1); if (nEndPos - nFndPos > extra_repl) - buf.append(std::u16string_view(rTxt).substr(nFndPos, nEndPos - nFndPos)); + buf.append(rTxt.subView(nFndPos, nEndPos - nFndPos)); aLong = buf.makeStringAndClear(); } if ( const SvxAutocorrWord* pNew = Insert( SvxAutocorrWord(aShort, aLong) ) ) |