ODF filter: handle draw:shadow-opacity for Writer frames

Change-Id: I3ad39e5de5b6999d6c2182c1ec622ae7f873cafe
This commit is contained in:
Miklos Vajna
2013-08-24 12:20:04 +02:00
parent 2a01c49f76
commit ac6a2038ac
3 changed files with 12 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ public:
void testFdo58949();
void testCharacterBorder();
void testFdo43807();
void testTextframeTransparentShadow();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -43,6 +44,7 @@ void Test::run()
{"fdo58949.docx", &Test::testFdo58949},
{"charborder.odt", &Test::testCharacterBorder },
{"fdo43807.odt", &Test::testFdo43807 },
{"textframe-transparent-shadow.odt", &Test::testTextframeTransparentShadow},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -371,6 +373,15 @@ void Test::testFdo43807()
CPPUNIT_ASSERT_EQUAL(OUString("User Defined Drop Caps"),getProperty<OUString>(xSet,"DropCapCharStyleName"));
}
void Test::testTextframeTransparentShadow()
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
uno::Reference<drawing::XShape> xPicture(xDrawPage->getByIndex(0), uno::UNO_QUERY);
// ODF stores opacity of 75%, that means 25% transparency.
CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty<sal_Int32>(xPicture, "ShadowTransparence"));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();

View File

@@ -708,6 +708,7 @@ XMLPropertyMapEntry aXMLFramePropMap[] =
MG_ED( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ),
// RES_SHADOW
MG_E( "ShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ),
MG_E( "ShadowTransparence", DRAW, SHADOW_OPACITY, XML_TYPE_NEG_PERCENT, 0 ),
// RES_FRMMACRO
// TODO
// RES_COL