[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Sat Aug 8 16:49:26 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf135329_lostImage.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 6 ++++++
sw/source/filter/ww8/wrtw8nds.cxx | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit a5ada62f564b90cf211929baf7694f477a53a445
Author: Justin Luth <justin.luth at collabora.com>
AuthorDate: Sat Aug 8 08:53:22 2020 +0300
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Sat Aug 8 18:48:47 2020 +0200
tdf#135329 sw MS export: prevent skipping at-char anchors
This patch is step 1 - write out bypassed flies.
Step 2 - don't bypass fly positions.
The SearchNext function is skipping some flies
because it is not returning them as a stopping
position (nextAttr), and so OutFly just skipped
them since they didn't exactly match the position
it was acting on.
Generally a bad idea to just ignore a picture etc.
Perhaps this is safe enough to backport all the
way to stable. But pictures are such a mess in
general, and so fragile that I don't know what
the implications might be. Thus I am breaking
this fix down into as small pieces as I possibly
can for the benefit of regression finding/fixing.
Prior to this test, there were no unit tests that failed
assert ( nPos >= nSwPos );
Change-Id: Idad0ea9d229f107a8b55150c476f3d4a6bdef3f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100375
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135329_lostImage.odt b/sw/qa/extras/ooxmlexport/data/tdf135329_lostImage.odt
new file mode 100644
index 000000000000..234109a14158
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135329_lostImage.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index f8dc2b8e9fd8..1700318a19dc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -237,6 +237,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134609_gridAfter, "tdf134609_gridAfter.docx")
CPPUNIT_ASSERT_MESSAGE("Top border is not an edge border", aBorder.LineWidth < 100);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf135329_lostImage, "tdf135329_lostImage.odt")
+{
+ // the character-anchored image was being skipped, since searchNext didn't notice it.
+ uno::Reference<beans::XPropertySet> xImageProps(getShape(2), uno::UNO_QUERY_THROW);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
{
CPPUNIT_ASSERT_EQUAL(2, getPages());
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 85b215f790c8..82799abfd9c8 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -725,7 +725,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
const SwPosition &rAnchor = maFlyIter->GetPosition();
const sal_Int32 nPos = rAnchor.nContent.GetIndex();
- if ( nPos != nSwPos )
+ if ( nPos > nSwPos )
return FLY_NOT_PROCESSED ; // We haven't processed the fly
const SdrObject* pSdrObj = maFlyIter->GetFrameFormat().FindRealSdrObject();
More information about the Libreoffice-commits
mailing list