diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-01 12:01:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-01 12:12:54 +0200 |
commit | 102bb87ca1a5dee3a09442bf503a54bb703c79ea (patch) | |
tree | b498577dc525b13ef0a93652b19a7bba5934f77b | |
parent | 8fdd994aa793664652da2794b46d3a63a237b189 (diff) |
SwXTextFrame: also restore semi-lost BackColorTransparency property
Change-Id: I2af01a87218d08baf399069b90085d01d49983a8
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 11 |
2 files changed, 9 insertions, 11 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 2d96eb2f0132..de70fa3d9bed 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -518,8 +518,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrames, "textframes.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount()); } -#if 0 -// FIXME port to FillAttributes DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") { uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); @@ -536,7 +534,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); } -#endif DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") { @@ -830,8 +827,6 @@ DECLARE_OOXMLEXPORT_TEST(testN822175, "n822175.odt") CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround")); } -#if 0 -// FIXME port to FillAttributes DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx") { // The problem was that TextFrame imported and exported the wrong value for transparency @@ -841,7 +836,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx") uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32( 80 ), getProperty< sal_Int32 >( xFrame, "BackColorTransparency" ) ); } -#endif DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx") { @@ -948,8 +942,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") CPPUNIT_FAIL("Did not find bullet with level 0"); } -#if 0 -// FIXME port to FillAttributes DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") { // The shape had no background, no paragraph adjust and no font color. @@ -960,7 +952,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); } -#endif DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx") { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 3dd741b2c779..5efcf0f47417 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -333,6 +333,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI if(bXFillStyleItemUsed) { XFillStyleItem aXFillStyleItem; + SvxBrushItem aBrush(RES_BACKGROUND); if(pXFillStyleItem) { @@ -350,9 +351,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI } else if (aXFillStyleItem.GetValue() == XFILL_SOLID && pCol) { - // Fill style set to solid, but no fill color is given. + // Fill style is 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); } @@ -447,6 +447,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI aXFillTransparenceItem.PutValue(*pXFillTransparenceItem); rToSet.Put(aXFillTransparenceItem); } + else if (aXFillStyleItem.GetValue() == XFILL_SOLID && pColTrans) + { + // Fill style is set to solid, but no fill transparency is given. + // On the other hand, we have a BackColorTransparency, so use that. + aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY); + sw::setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet); + } if(pXGradientStepCountItem) { |