[Libreoffice-commits] core.git: sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 19 17:46:07 UTC 2020
sw/source/filter/ww8/wrtw8nds.cxx | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
New commits:
commit c8a95925ca316c2656c81696b1e87c7d5767883d
Author: Justin Luth <justin.luth at collabora.com>
AuthorDate: Sat Aug 8 15:01:49 2020 +0300
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Wed Aug 19 19:45:25 2020 +0200
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 at sil.org>
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index b8440df9fb60..e9a830d55ce4 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
More information about the Libreoffice-commits
mailing list