Kaydet (Commit) 29d57a3f authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

tdf#91292 ooxmlexport: cleared fill != use grabbag info

A while back the way that backgrounds are handled changed.
This was one spot where the changes didn't sync up. When
the background is cleared, then the imported grabbag
attributes should be tossed, not re-applied during save.

Change-Id: I9759def6321697a634bcbd66ecdc9d73693ce1a3
Reviewed-on: https://gerrit.libreoffice.org/44040Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst aa957dff
......@@ -240,6 +240,7 @@ public:
void testTableStyleUndo();
void testRedlineParam();
void testRedlineViewAuthor();
void testTdf91292();
void testTdf78727();
void testRedlineTimestamp();
void testCursorWindows();
......@@ -411,6 +412,7 @@ public:
CPPUNIT_TEST(testTableStyleUndo);
CPPUNIT_TEST(testRedlineParam);
CPPUNIT_TEST(testRedlineViewAuthor);
CPPUNIT_TEST(testTdf91292);
CPPUNIT_TEST(testTdf78727);
CPPUNIT_TEST(testRedlineTimestamp);
CPPUNIT_TEST(testCursorWindows);
......@@ -4789,6 +4791,23 @@ void SwUiWriterTest::testRedlineViewAuthor()
CPPUNIT_ASSERT_EQUAL(aAuthor, xField->getPropertyValue("Author").get<OUString>());
}
void SwUiWriterTest::testTdf91292()
{
createDoc("tdf91292_paraBackground.docx");
uno::Reference<beans::XPropertySet> xPropertySet(getParagraph(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Solid background color", drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xPropertySet, "FillStyle"));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Background Color", static_cast<sal_Int32>(0x5C2D91), getProperty<sal_Int32>(xPropertySet, "FillColor"));
// remove background color
xPropertySet->setPropertyValue("FillStyle", uno::makeAny( drawing::FillStyle_NONE));
// Save it and load it back.
reload("Office Open XML Text", "tdf91292_paraBackground.docx");
xPropertySet.set( getParagraph(1), uno::UNO_QUERY );
CPPUNIT_ASSERT_EQUAL_MESSAGE("No background color", drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xPropertySet, "FillStyle"));
}
void SwUiWriterTest::testTdf78727()
{
SwDoc* pDoc = createDoc("tdf78727.docx");
......
......@@ -8325,6 +8325,10 @@ void DocxAttributeOutput::FormatFillStyle( const XFillStyleItem& rFillStyle )
m_oFillStyle.reset(rFillStyle.GetValue());
else
m_bIgnoreNextFill = false;
// Don't round-trip grabbag OriginalBackground if the background has been cleared.
if ( m_pBackgroundAttrList.is() && rFillStyle.GetValue() == drawing::FillStyle_NONE )
m_pBackgroundAttrList.clear();
}
void DocxAttributeOutput::FormatFillGradient( const XFillGradientItem& rFillGradient )
......
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