diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 13:12:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-19 15:18:43 +0200 |
commit | 32857aa4d1f6ca67f33068cd4caaf62bb5a75f5c (patch) | |
tree | 7e0cca83f03b0843121e194d3c3f3e2adb66947d /sw/source/core/doc/docnum.cxx | |
parent | 9429dacc7ff93f99dd84532357020669df33a0c5 (diff) |
loplugin:buriedassign in sw(2)
Change-Id: If73cbea9eb11029ef6b48a36e20d2271966ac4d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc/docnum.cxx')
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index af72d98b70bf..cf3589ceb9cd 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -734,14 +734,14 @@ bool SwDoc::GotoOutline(SwPosition& rPos, const OUString& rName, SwRootFrame con //#i4533# leading numbers followed by a dot have been remove while //searching for the outline position //to compensate this they must be removed from the paragraphs text content, too - sal_Int32 nPos = 0; - OUString sTempNum; - while(!sExpandedText.isEmpty() && !(sTempNum = sExpandedText.getToken(0, '.', nPos)).isEmpty() && - -1 != nPos && - comphelper::string::isdigitAsciiString(sTempNum)) + while(!sExpandedText.isEmpty()) { + sal_Int32 nPos = 0; + OUString sTempNum = sExpandedText.getToken(0, '.', nPos); + if( sTempNum.isEmpty() || -1 == nPos || + !comphelper::string::isdigitAsciiString(sTempNum)) + break; sExpandedText = sExpandedText.copy(nPos); - nPos = 0; } if( sExpandedText != sName ) @@ -2222,13 +2222,14 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, // moved to the next Node for(SwRangeRedline* pTmp : getIDocumentRedlineAccess().GetRedlineTable()) { - SwPosition* pPos; - if( ( pPos = &pTmp->GetBound())->nNode == aIdx ) + SwPosition* pPos = &pTmp->GetBound(); + if( pPos->nNode == aIdx ) { ++pPos->nNode; pPos->nContent.Assign( pPos->nNode.GetNode().GetContentNode(),0); } - if( ( pPos = &pTmp->GetBound(false))->nNode == aIdx ) + pPos = &pTmp->GetBound(false); + if( pPos->nNode == aIdx ) { ++pPos->nNode; pPos->nContent.Assign( pPos->nNode.GetNode().GetContentNode(),0); |