summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-04-27 12:35:20 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-04-27 16:54:16 +0200
commit707db60df761a98cfdbd771fdc85979084be0b33 (patch)
treed5d47a2dd1420798e25feaf1ae9956810fb2891f /editeng
parentaea139c440d7c7a3683fcbbc48799bc79ba590e7 (diff)
Small refactor
Change-Id: I987cd80bb485d3d811c0932c0822efc5d572dfd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114712 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit3.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index b91b2c476628..918e9346bbfd 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2390,16 +2390,15 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_Int32& rS
o3tl::sorted_vector< sal_Int32 > aPositions;
aPositions.insert( 0 );
- sal_uInt16 nAttr = 0;
- EditCharAttrib* pAttrib = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
- while ( pAttrib )
+ for (sal_uInt16 nAttr = 0;; ++nAttr)
{
// Insert Start and End into the Array...
// The Insert method does not allow for duplicate values...
+ EditCharAttrib* pAttrib = GetAttrib(pNode->GetCharAttribs().GetAttribs(), nAttr);
+ if (!pAttrib)
+ break;
aPositions.insert( pAttrib->GetStart() );
aPositions.insert( pAttrib->GetEnd() );
- nAttr++;
- pAttrib = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
}
aPositions.insert( pNode->Len() );