summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unoportenum.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-28 15:13:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 07:17:37 +0100
commit21de55596c0fdc2be736c6d0369bd9d3783020be (patch)
tree07d0f0cd54690e54405fe574c572cb2be74a3336 /sw/source/core/unocore/unoportenum.cxx
parentda9fb5d6d9ebf9363981c370ce937d8848989fcb (diff)
remove unnecessary "if (!empty()" checks before loops
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore/unoportenum.cxx')
-rw-r--r--sw/source/core/unocore/unoportenum.cxx35
1 files changed, 16 insertions, 19 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 0776b3325261..1ba5b3f760a5 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -1176,29 +1176,26 @@ static void lcl_ExportAnnotationStarts(
SwAnnotationStartPortion_ImplList& rAnnotationStartArr,
const sal_Int32 nIndex)
{
- if ( !rAnnotationStartArr.empty() )
+ for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end();
+ aIter != aEnd; )
{
- for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end();
- aIter != aEnd; )
+ SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter);
+ if ( nIndex > pPtr->getIndex() )
{
- SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter);
- if ( nIndex > pPtr->getIndex() )
- {
- aIter = rAnnotationStartArr.erase(aIter);
- continue;
- }
- if ( pPtr->getIndex() > nIndex )
- {
- break;
- }
-
- SwXTextPortion* pPortion =
- new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION );
- pPortion->SetTextField( pPtr->mxAnnotationField );
- rPortions.emplace_back(pPortion);
-
aIter = rAnnotationStartArr.erase(aIter);
+ continue;
}
+ if ( pPtr->getIndex() > nIndex )
+ {
+ break;
+ }
+
+ SwXTextPortion* pPortion =
+ new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION );
+ pPortion->SetTextField( pPtr->mxAnnotationField );
+ rPortions.emplace_back(pPortion);
+
+ aIter = rAnnotationStartArr.erase(aIter);
}
}