tdf#135329 sw MS export: don't miss nextAttr fly position
Step 1 - write out bypassed flies.
This patch is Step 2 - don't bypass fly position.
The SearchNext function was skipping some flies
because it was not returning them as a stopping
position (nextAttr). The time I noticed this happening
was at the start of the paragraph, when there were
zero-anchored paragraph flies which hadn't been processed
and so they returned a non-usable minPos.
With this patch, I OUGHT to have rendered Step 1's
patch unnecessary.
Change-Id: I9924dbf5424f5b0309ec944e1bb79380672220f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100387
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index b8440df..e9a830d 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -356,14 +356,17 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
}
// #i2916# Check to see if there are any graphics anchored to characters in this paragraph's text.
if (maFlyIter != maFlyFrames.end())
sal_Int32 nNextFlyPos = 0;
ww8::FrameIter aTmpFlyIter = maFlyIter;
while (aTmpFlyIter != maFlyFrames.end() && nNextFlyPos < nStartPos)
{
const SwPosition &rAnchor = maFlyIter->GetPosition();
const SwPosition &rAnchor = aTmpFlyIter->GetPosition();
nNextFlyPos = rAnchor.nContent.GetIndex();
sal_Int32 nPos = rAnchor.nContent.GetIndex();
if (nPos >= nStartPos && nPos <= nMinPos)
nMinPos = nPos;
++aTmpFlyIter;
}
if (nNextFlyPos >= nStartPos && nNextFlyPos < nMinPos)
nMinPos = nNextFlyPos;
//nMinPos found and not going to change at this point