diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-04 11:14:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-05 12:57:00 +0200 |
commit | 9f1701d01d9f664828356976d8592492f85b30f5 (patch) | |
tree | a91eaef0674591af87b06096fdd186283559a8de /editeng | |
parent | b8bb44161aeb6e00526a38343b63e678ce7d4a1a (diff) |
use more o3tl::getToken
found by inspecting call sites of OUString::getToken
Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index b885bbd310c2..13e490f87b7f 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -428,7 +428,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara ) // handle empty strings. while( nIdx>=0 && nIdx<aText.getLength() ) { - OUString aStr = aText.getToken( 0, '\x0A', nIdx ); + std::u16string_view aStr = o3tl::getToken(aText, 0, '\x0A', nIdx ); sal_Int16 nCurDepth; if( nPos ) @@ -445,11 +445,11 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara ) ( GetOutlinerMode() == OutlinerMode::OutlineView ) ) { // Extract Tabs - sal_Int32 nTabs = 0; - while ( ( nTabs < aStr.getLength() ) && ( aStr[nTabs] == '\t' ) ) + size_t nTabs = 0; + while ( ( nTabs < aStr.size() ) && ( aStr[nTabs] == '\t' ) ) nTabs++; if ( nTabs ) - aStr = aStr.copy(nTabs); + aStr = aStr.substr(nTabs); // Keep depth? (see Outliner::Insert) if( !(pPara->nFlags & ParaFlag::HOLDDEPTH) ) @@ -463,13 +463,13 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara ) if( nPos ) // not with the first paragraph { pParaList->Insert( std::unique_ptr<Paragraph>(pPara), nInsPos ); - pEditEngine->InsertParagraph( nInsPos, aStr ); + pEditEngine->InsertParagraph( nInsPos, OUString(aStr) ); ParagraphInsertedHdl(pPara); } else { nInsPos--; - pEditEngine->SetText( nInsPos, aStr ); + pEditEngine->SetText( nInsPos, OUString(aStr) ); } ImplInitDepth( nInsPos, nCurDepth, false ); nInsPos++; |