summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-08-07 14:28:07 +0300
committerJustin Luth <justin_luth@sil.org>2020-08-21 20:30:11 +0200
commita663bcda493b7d412e3837a4df38ca3d015a6ec5 (patch)
tree7061c6d19bde753270b281218f978060c55782f4
parent00a9debfcfd12f04030f0369f7eaf5688ebbf194 (diff)
NFC sw MS export: flatten useless aTmpFlyIter loop
The loop did nothing, since aTmpFlyIter was never used. IsAnchorLinkedToThisNode() is only called in one place to test whether to bPostponeWritingText. One option would have been to actually use aTmpFlyIter instead of maFlyIter, which would seem to make the most sense, and was likely @synerzip's original intention. (And in that case, it should return false as soon as nNodePos < nAnchorPos since this is a sorted list.) However, this whole concept of PostponeWritingText is ripe for regressions etc. I don't want to introduce an even larger number of postponed cases, so instead I chose to do option two, which is to just re-write the function in the way that it actually operated. So this is supposed to be in a No-Functional-Change cleanup. Change-Id: I227e2ecd2aca82b03b54ae3924db91933ca2c930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100374 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index e9a830d55ce4..9817e562e379 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -610,21 +610,13 @@ bool SwWW8AttrIter::IsWatermarkFrame()
bool SwWW8AttrIter::IsAnchorLinkedToThisNode( sal_uLong nNodePos )
{
- ww8::FrameIter aTmpFlyIter = maFlyIter ;
-
- while ( aTmpFlyIter != maFlyFrames.end() )
- {
- const SwPosition &rAnchor = maFlyIter->GetPosition();
- sal_uLong nAnchorPos = rAnchor.nNode.GetIndex();
- /* if current node position and the anchor position are the same
- then the frame anchor is linked to this node
- */
- if ( nAnchorPos == nNodePos )
- return true ;
+ if ( maFlyIter == maFlyFrames.end() )
+ return false;
- ++aTmpFlyIter;
- }
- return false ;
+ /* if current node position and the anchor position are the same
+ then the frame anchor is linked to this node
+ */
+ return nNodePos == maFlyIter->GetPosition().nNode.GetIndex();
}
bool SwWW8AttrIter::HasFlysAt(sal_Int32 nSwPos) const