Kaydet (Commit) 5ce92b73 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwXTextFrame: restore semi-lost BackColor property

In the past in case FillStyle was set, BackColor wasn't ignored, now it
is, since 6e61ecd0 (Merge back branch
alg_writerframes to trunk, 2014-03-19).

The intention there was that in case FillStyle is set, FillColor will be
used: so to keep both new users and old filters happy, just restore
handling of BackColor in case FillStyle is set, but not FillColor.

Change-Id: Ie034a959e72e48b617cf598af8f7afd030bb50c4
üst de7cdbc5
...@@ -1678,8 +1678,6 @@ DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx") ...@@ -1678,8 +1678,6 @@ DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx")
getParagraphOfText(1, xText, "DML1"); getParagraphOfText(1, xText, "DML1");
} }
#if 0
// FIXME port to FillAttributes
DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
{ {
// Vertical position of the textbox was incorrect due to incorrect nested mce handling. // Vertical position of the textbox was incorrect due to incorrect nested mce handling.
...@@ -1704,7 +1702,6 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx") ...@@ -1704,7 +1702,6 @@ DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 1), "CharWeight")); CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 1), "CharWeight"));
CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xGroup->getByIndex(1), "TextVerticalAdjust")); CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xGroup->getByIndex(1), "TextVerticalAdjust"));
} }
#endif
DECLARE_OOXMLIMPORT_TEST(testMissingPath, "missing-path.docx") DECLARE_OOXMLIMPORT_TEST(testMissingPath, "missing-path.docx")
{ {
......
...@@ -331,11 +331,11 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI ...@@ -331,11 +331,11 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
} }
if(bXFillStyleItemUsed) if(bXFillStyleItemUsed)
{
if(pXFillStyleItem)
{ {
XFillStyleItem aXFillStyleItem; XFillStyleItem aXFillStyleItem;
if(pXFillStyleItem)
{
aXFillStyleItem.PutValue(*pXFillStyleItem); aXFillStyleItem.PutValue(*pXFillStyleItem);
rToSet.Put(aXFillStyleItem); rToSet.Put(aXFillStyleItem);
} }
...@@ -348,6 +348,14 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI ...@@ -348,6 +348,14 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
aXFillColorItem.PutValue(*pXFillColorItem); aXFillColorItem.PutValue(*pXFillColorItem);
rToSet.Put(aXFillColorItem); rToSet.Put(aXFillColorItem);
} }
else if (aXFillStyleItem.GetValue() == XFILL_SOLID && pCol)
{
// Fill style set to solid, but no fill color is given.
// On the other hand, we have a BackColor, so use that.
SvxBrushItem aBrush(RES_BACKGROUND);
aBrush.PutValue(*pCol, MID_BACK_COLOR);
sw::setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
}
if(pXFillGradientItem || pXFillGradientNameItem) if(pXFillGradientItem || pXFillGradientNameItem)
{ {
......
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