Kaydet (Commit) 7562c5f3 authored tarafından Katarina Behrens's avatar Katarina Behrens

tdf#107584: Load/save page background transparency

Change-Id: I17bd01dc129f0e530d5e227a5ddc12f11486e85d
Reviewed-on: https://gerrit.libreoffice.org/39206Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 0922085d
......@@ -89,6 +89,7 @@ public:
void testEmbeddedPdf();
void testAuthorField();
void testTdf100926();
void testPageWithTransparentBackground();
CPPUNIT_TEST_SUITE(SdExportTest);
......@@ -105,6 +106,7 @@ public:
CPPUNIT_TEST(testEmbeddedPdf);
CPPUNIT_TEST(testAuthorField);
CPPUNIT_TEST(testTdf100926);
CPPUNIT_TEST(testPageWithTransparentBackground);
CPPUNIT_TEST_SUITE_END();
......@@ -597,6 +599,31 @@ void SdExportTest::testTdf100926()
xDocShRef->DoClose();
}
void SdExportTest::testPageWithTransparentBackground()
{
::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/page_transparent_background.odp"), ODP );
xDocShRef = saveAndReload( xDocShRef.get(), ODP );
uno::Reference< drawing::XDrawPagesSupplier > xDoc(
xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "There should be exactly one page", static_cast<sal_Int32>(1), xDoc->getDrawPages()->getCount() );
uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) );
uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY );
uno::Any aAny = xPropSet->getPropertyValue( "Background" );
CPPUNIT_ASSERT_MESSAGE("Slide background is missing", aAny.hasValue());
uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
aAny >>= aXBackgroundPropSet;
sal_Int32 nTransparence;
aAny = aXBackgroundPropSet->getPropertyValue( "FillTransparence" );
aAny >>= nTransparence;
CPPUNIT_ASSERT_EQUAL_MESSAGE("Slide background transparency is wrong", sal_Int32(42), nTransparence);
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -313,6 +313,7 @@ const XMLPropertyMapEntry aXMLSDPresPageProps[] =
DPMAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLHATCHNAME ),
GMAP( "FillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, 0 ),
DPMAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLBITMAPNAME ),
DPMAP( "FillTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT|MID_FLAG_MULTI_PROPERTY, 0 ),
DPMAP( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLTRANSNAME ),
DPMAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
DPMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
......
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