Kaydet (Commit) 3a0c0af7 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#96113 sw: don't overwrite fo:background-color on ODT frame import

The situation is similar to commit
79fb61ef (tdf#92379: svx: don't
overwrite fo:background-color on ODF import, 2015-08-21), except that
here text frames had the problem of loosing colors when transparency is
set.

Fix the problem by informing getSvxBrushItemFromSourceSet() about if
we're in XML import or not.

Change-Id: Id1adf60b14a3762f0a2a43c49caeed9f6ea039be
üst 6502c0dd
......@@ -631,5 +631,11 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether"));
}
DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt")
{
// Background of the formula frame was white (0xffffff), not green.
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(1), "BackColor"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1803,7 +1803,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
if(RES_BACKGROUND == pEntry->nWID)
{
const SwAttrSet& rSet = pFormat->GetAttrSet();
const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND, true, pDoc->IsInXMLImport()));
SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
aChangedBrushItem.PutValue(aValue, nMemberId);
......
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