diff options
author | A_GAN <ganzouri97@gmail.com> | 2020-06-22 23:39:16 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-29 18:32:57 +0200 |
commit | 2803b09ec024cb0b8cf25ec6fe08412649f40d5e (patch) | |
tree | a548fde334adfec3435a70a189b97698e5d78d13 /sd | |
parent | cb0c7e26e5708010b1fe941ae2f66134f31ed876 (diff) |
OOXML/ODF Support for Shadow blur radius
Adding export support for OOXML. Adding import/export support for ODF
Changing some values in test cases as convertEMUtoHmm round the fraction.
Add two test functions for OOXML and ODF export.
Change-Id: Ie5d862b46b5264ead4954f407fee2837b5151cd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96907
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odg/shadow-blur.odg | bin | 0 -> 12837 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 16 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 25 |
3 files changed, 41 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odg/shadow-blur.odg b/sd/qa/unit/data/odg/shadow-blur.odg Binary files differnew file mode 100644 index 000000000000..a67b8e1866fc --- /dev/null +++ b/sd/qa/unit/data/odg/shadow-blur.odg diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index a3ff094b7f21..498443d12236 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -197,6 +197,7 @@ public: void testTdf132282(); void testTdf132201EffectOrder(); void testShapeSoftEdgeEffect(); + void testShapeShadowBlurEffect(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -311,6 +312,7 @@ public: CPPUNIT_TEST(testTdf132282); CPPUNIT_TEST(testTdf132201EffectOrder); CPPUNIT_TEST(testShapeSoftEdgeEffect); + CPPUNIT_TEST(testShapeShadowBlurEffect); CPPUNIT_TEST_SUITE_END(); @@ -2911,6 +2913,20 @@ void SdOOXMLExportTest2::testShapeSoftEdgeEffect() CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nRadius); // 18 pt } +void SdOOXMLExportTest2::testShapeShadowBlurEffect() +{ + auto xDocShRef + = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-blur-effect.pptx"), PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef)); + bool bHasShadow = false; + xShape->getPropertyValue("Shadow") >>= bHasShadow; + CPPUNIT_ASSERT(bHasShadow); + sal_Int32 nRadius = -1; + xShape->getPropertyValue("ShadowBlur") >>= nRadius; + CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 11 pt +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index a2186fae62af..a6ad545b3221 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -76,6 +76,7 @@ public: void testTdf126761(); void testGlow(); void testSoftEdges(); + void testShadowBlur(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -112,6 +113,7 @@ public: CPPUNIT_TEST(testTdf126761); CPPUNIT_TEST(testGlow); CPPUNIT_TEST(testSoftEdges); + CPPUNIT_TEST(testShadowBlur); CPPUNIT_TEST_SUITE_END(); @@ -1307,6 +1309,29 @@ void SdExportTest::testSoftEdges() xDocShRef->DoClose(); } +void SdExportTest::testShadowBlur() +{ + auto xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odg/shadow-blur.odg"), ODG); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef)); + + sal_Int32 nRad = 0; + CPPUNIT_ASSERT(xShape->getPropertyValue("ShadowBlur") >>= nRad); + CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRad); // 11 pt = 388 Hmm + + xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "content.xml"); + + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]", + "family", "graphic"); + assertXPath( + pXmlDoc, + "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties", + "shadow-blur", "0.388cm"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |