sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.doc |binary sw/qa/extras/ww8export/ww8export3.cxx | 7 +++++++ sw/source/filter/ww8/ww8graf.cxx | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-)
New commits: commit 3de954c90abf46219b57f9fce2332ef7ede146e7 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Wed May 1 15:14:14 2019 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Sat May 25 11:00:22 2019 +0200 tdf#101826 ww8import: Fly - do convert XATTR if FILLSTYLE==NONE This fixes tdf112618, which wasn't importing properly anymore since recent commit cc899c6967238877f0094bcf00627145e484ffec for bug 101826. I tried to setFly( XFillTransparencyItem(100) ), but then it didn't round-trip. Fixing up the export sounds like a suicide mission, so I just used the non-regressive path. There is still a chance that unset transparency could cause problems with other types like solid/gradient/bitmap. However, I wasn't able to design any example documents to prove that. One difference is that the RES_BACKGROUND looks in the parents (bInP) for attributes, while I only transfer directly set attributes(!bInP). Change-Id: I5160562e222629510ede3b49ae85ec99f7b351c9 Reviewed-on: https://gerrit.libreoffice.org/71646 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.doc b/sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.doc new file mode 100644 index 000000000000..c7d9823b0db9 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.doc differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 339ebd17e440..fcf5fc44379f 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -179,6 +179,13 @@ DECLARE_WW8EXPORT_TEST(testTdf121111_fillStyleNone, "tdf121111_fillStyleNone.doc CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xText, "FillStyle")); } +DECLARE_WW8EXPORT_TEST(testTdf112618_textbox_no_bg, "tdf112618_textbox_no_bg.doc") +{ + sal_uInt16 nTransparence = getProperty<sal_Int16>(getShape(2), "FillTransparence"); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(100), nTransparence); + CPPUNIT_ASSERT_EQUAL(nTransparence, getProperty<sal_uInt16>(getShape(2), "BackColorTransparency")); +} + DECLARE_WW8EXPORT_TEST(testTdf101826_xattrTextBoxFill, "tdf101826_xattrTextBoxFill.doc") { //Basic 1 Color Fill: gradient from yellow(FFFF00) to brown(767600) currently saves as mid-color diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index f64577ae64f9..3beb1e2f6181 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1715,7 +1715,13 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, { rFlySet.Put( *pPoolItem ); if ( i == XATTR_FILLSTYLE ) - bSkipResBackground = true; + { + const drawing::FillStyle eFill = static_cast<const XFillStyleItem*>(pPoolItem)->GetValue(); + // Transparency forced in certain situations when fillstyle is none - use old logic for that case still + // which is especially needed for export purposes (tdf112618). + if ( eFill != drawing::FillStyle_NONE ) + bSkipResBackground = true; + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits