diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-06-24 10:21:18 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-17 22:48:42 +0200 |
commit | d9feaf67be30e7a2aa729db93e489c61f57bb580 (patch) | |
tree | f3228aa606e6d6550e287c96b3a75bcf2f97ba15 /sd | |
parent | 4ca03b46b53818a25636a96b5e42b3a0b116bc35 (diff) |
tdf#107584: Load/save page background transparency
Change-Id: I17bd01dc129f0e530d5e227a5ddc12f11486e85d
Reviewed-on: https://gerrit.libreoffice.org/39206
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
(cherry picked from commit 7562c5f37ca03267da5873143601811bebf6d620)
Reviewed-on: https://gerrit.libreoffice.org/40045
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odp/page_transparent_background.odp | bin | 0 -> 11508 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/page_transparent_background.odp b/sd/qa/unit/data/odp/page_transparent_background.odp Binary files differnew file mode 100644 index 000000000000..02b11976a15d --- /dev/null +++ b/sd/qa/unit/data/odp/page_transparent_background.odp diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 80a03416d759..d65615a2094e 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -94,6 +94,7 @@ public: void testEmbeddedPdf(); void testAuthorField(); void testTdf100926(); + void testPageWithTransparentBackground(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -110,6 +111,7 @@ public: CPPUNIT_TEST(testEmbeddedPdf); CPPUNIT_TEST(testAuthorField); CPPUNIT_TEST(testTdf100926); + CPPUNIT_TEST(testPageWithTransparentBackground); CPPUNIT_TEST_SUITE_END(); @@ -602,6 +604,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(); |