diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-29 16:25:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-29 16:31:32 +0100 |
commit | 5aa360cae0383f270c12708e7e94179a7fde6711 (patch) | |
tree | 015c2238e2e2860790fb335207f0e45de89a009c | |
parent | 8dd2a4f0c80db25f744147206ff1e69cf976f73f (diff) |
Resolves: fdo#80468 and fdo#81223 image/frame backgrounds wrong
writer has code to fill in missing new properties from the old properties
if they exist. But xmloff is stripping them out before they get there.
Don't strip them out, and add in a missing check for one of the
archaic bg colors and add a regression test for fdo#81223
Change-Id: I9a541a9bee0a01c90f2c33383f1144ecd8b0bfff
-rw-r--r-- | include/xmloff/XMLShapeStyleContext.hxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/data/fdo81223.odt | bin | 0 -> 9428 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/XMLShapeStyleContext.cxx | 15 |
5 files changed, 16 insertions, 19 deletions
diff --git a/include/xmloff/XMLShapeStyleContext.hxx b/include/xmloff/XMLShapeStyleContext.hxx index b0f7a3aef24d..89662c09be30 100644 --- a/include/xmloff/XMLShapeStyleContext.hxx +++ b/include/xmloff/XMLShapeStyleContext.hxx @@ -37,9 +37,6 @@ protected: OUString m_sListStyleName; bool m_bIsNumRuleAlreadyConverted; - //UUUU - bool m_bIsFillStyleAlreadyConverted : 1; - protected: virtual void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, diff --git a/sw/qa/extras/odfimport/data/fdo81223.odt b/sw/qa/extras/odfimport/data/fdo81223.odt Binary files differnew file mode 100644 index 000000000000..21343d3dd91d --- /dev/null +++ b/sw/qa/extras/odfimport/data/fdo81223.odt diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 8cd4b09b1064..76f00bb96cd4 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -478,6 +478,16 @@ DECLARE_ODFIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.odt") CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 2), "CharWeight")); } +DECLARE_ODFIMPORT_TEST(fdo81223, "fdo81223.odt") +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + sal_Int32 nValue(0); + xFrame->getPropertyValue("BackColor") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeffffff), nValue); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 31e00cf5c340..5dee0e832309 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -355,11 +355,14 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI aXFillColorItem.PutValue(*pXFillColorItem); rToSet.Put(aXFillColorItem); } - else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && pCol) + else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && (pCol || pRGBCol)) { // Fill style is set to solid, but no fill color is given. // On the other hand, we have a BackColor, so use that. - aBrush.PutValue(*pCol, MID_BACK_COLOR); + if (pCol) + aBrush.PutValue(*pCol, MID_BACK_COLOR); + else + aBrush.PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B); setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet); } diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index 31c32d720af0..f3d1d1980725 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -53,8 +53,7 @@ XMLShapeStyleContext::XMLShapeStyleContext( SvXMLStylesContext& rStyles, sal_uInt16 nFamily) : XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), - m_bIsNumRuleAlreadyConverted( false ), - m_bIsFillStyleAlreadyConverted(false) //UUUU + m_bIsNumRuleAlreadyConverted( false ) { } @@ -186,18 +185,6 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet } } - //UUUU need to filter out old fill definitions when the new ones are used. The new - // ones are used when a FillStyle is defined - if(!m_bIsFillStyleAlreadyConverted && GetProperties().size()) - { - if(doNewDrawingLayerFillStyleDefinitionsExist(OUString("FillStyle"))) - { - deactivateOldFillStyleDefinitions(getStandardSet()); - } - - m_bIsFillStyleAlreadyConverted = true; - } - struct _ContextID_Index_Pair aContextIDs[] = { { CTF_DASHNAME , -1 }, |