[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Apr 1 03:13:17 PDT 2014
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 ---------
sw/source/core/unocore/unoframe.cxx | 11 +++++++++--
2 files changed, 9 insertions(+), 11 deletions(-)
New commits:
commit 102bb87ca1a5dee3a09442bf503a54bb703c79ea
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Apr 1 12:01:05 2014 +0200
SwXTextFrame: also restore semi-lost BackColorTransparency property
Change-Id: I2af01a87218d08baf399069b90085d01d49983a8
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2d96eb2..de70fa3 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 3dd741b..5efcf0f 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)
{
More information about the Libreoffice-commits
mailing list