summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-05-01 15:14:14 +0300
committerJustin Luth <justin_luth@sil.org>2019-05-25 11:00:22 +0200
commit3de954c90abf46219b57f9fce2332ef7ede146e7 (patch)
treec845423dbce635d0641a43e274f7db975b70f764 /sw
parentbc2e1ab2fd4c094b9c33f2de9aa5d446d5993efa (diff)
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_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.docbin0 -> 27136 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx7
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx8
3 files changed, 14 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf112618_textbox_no_bg.doc
Binary files 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;
+ }
}
}
}