Kaydet (Commit) 102bb87c authored tarafından Miklos Vajna's avatar Miklos Vajna

SwXTextFrame: also restore semi-lost BackColorTransparency property

Change-Id: I2af01a87218d08baf399069b90085d01d49983a8
üst 8fdd994a
...@@ -518,8 +518,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrames, "textframes.odt") ...@@ -518,8 +518,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrames, "textframes.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount()); CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount());
} }
#if 0
// FIXME port to FillAttributes
DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx")
{ {
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
...@@ -536,7 +534,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") ...@@ -536,7 +534,6 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color);
} }
#endif
DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx")
{ {
...@@ -830,8 +827,6 @@ DECLARE_OOXMLEXPORT_TEST(testN822175, "n822175.odt") ...@@ -830,8 +827,6 @@ DECLARE_OOXMLEXPORT_TEST(testN822175, "n822175.odt")
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround")); CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(xFrame, "Surround"));
} }
#if 0
// FIXME port to FillAttributes
DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx") DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx")
{ {
// The problem was that TextFrame imported and exported the wrong value for transparency // The problem was that TextFrame imported and exported the wrong value for transparency
...@@ -841,7 +836,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx") ...@@ -841,7 +836,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66688, "fdo66688.docx")
uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL( sal_Int32( 80 ), getProperty< sal_Int32 >( xFrame, "BackColorTransparency" ) ); CPPUNIT_ASSERT_EQUAL( sal_Int32( 80 ), getProperty< sal_Int32 >( xFrame, "BackColorTransparency" ) );
} }
#endif
DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx") DECLARE_OOXMLEXPORT_TEST(testFdo66773, "fdo66773.docx")
{ {
...@@ -948,8 +942,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") ...@@ -948,8 +942,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx")
CPPUNIT_FAIL("Did not find bullet with level 0"); CPPUNIT_FAIL("Did not find bullet with level 0");
} }
#if 0
// FIXME port to FillAttributes
DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt")
{ {
// The shape had no background, no paragraph adjust and no font color. // The shape had no background, no paragraph adjust and no font color.
...@@ -960,7 +952,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") ...@@ -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(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")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"));
} }
#endif
DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx") DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx")
{ {
......
...@@ -333,6 +333,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI ...@@ -333,6 +333,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
if(bXFillStyleItemUsed) if(bXFillStyleItemUsed)
{ {
XFillStyleItem aXFillStyleItem; XFillStyleItem aXFillStyleItem;
SvxBrushItem aBrush(RES_BACKGROUND);
if(pXFillStyleItem) if(pXFillStyleItem)
{ {
...@@ -350,9 +351,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI ...@@ -350,9 +351,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
} }
else if (aXFillStyleItem.GetValue() == XFILL_SOLID && pCol) 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. // On the other hand, we have a BackColor, so use that.
SvxBrushItem aBrush(RES_BACKGROUND);
aBrush.PutValue(*pCol, MID_BACK_COLOR); aBrush.PutValue(*pCol, MID_BACK_COLOR);
sw::setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet); sw::setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
} }
...@@ -447,6 +447,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI ...@@ -447,6 +447,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
aXFillTransparenceItem.PutValue(*pXFillTransparenceItem); aXFillTransparenceItem.PutValue(*pXFillTransparenceItem);
rToSet.Put(aXFillTransparenceItem); 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) if(pXGradientStepCountItem)
{ {
......
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