Kaydet (Commit) 3de954c9 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Justin Luth

tdf#101826 ww8import: Fly - do convert XATTR if FILLSTYLE==NONE

This fixes tdf112618, which wasn't importing properly anymore
since recent commit cc899c69
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: 's avatarJustin Luth <justin_luth@sil.org>
üst bc2e1ab2
This diff was suppressed by a .gitattributes entry.
......@@ -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
......
......@@ -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;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment