summaryrefslogtreecommitdiff
path: root/sd/qa/unit/export-tests.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/qa/unit/export-tests.cxx')
-rw-r--r--sd/qa/unit/export-tests.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a47815a50748..c23d098a1b90 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -158,6 +158,7 @@ public:
void testTdf80224();
void testTdf92527();
void testTdf99224();
+ void testTdf105739();
CPPUNIT_TEST_SUITE(SdExportTest);
CPPUNIT_TEST(testFdo90607);
@@ -214,6 +215,7 @@ public:
CPPUNIT_TEST(testExtFileField);
CPPUNIT_TEST(testAuthorField);
CPPUNIT_TEST(testTdf99224);
+ CPPUNIT_TEST(testTdf105739);
CPPUNIT_TEST_SUITE_END();
@@ -1744,6 +1746,38 @@ void SdExportTest::testTdf99224()
xShell->DoClose();
}
+void SdExportTest::testTdf105739()
+{
+ // Gradient was lost during saving to ODP
+ sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf105739.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xShell = saveAndReload(xShell.get(), ODP, &tempFile);
+ uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
+ uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
+ uno::Any aAny = xPropSet->getPropertyValue("Background");
+ CPPUNIT_ASSERT(aAny.hasValue());
+ if (aAny.hasValue())
+ {
+ uno::Reference< beans::XPropertySet > aXBackgroundPropSet;
+ aAny >>= aXBackgroundPropSet;
+
+ // Test fill type
+ drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
+ aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle;
+ CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle);
+
+ // Test gradient properties
+ com::sun::star::awt::Gradient aFillGradient;
+ aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aFillGradient;
+ CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aFillGradient.Style);
+ CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor);
+ CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor);
+ }
+
+ xShell->DoClose();
+}
+
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();