diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-20 16:50:23 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-22 18:51:18 +0100 |
commit | 736b0709796d96325542b624ce27a7dc83419cfb (patch) | |
tree | e7d722bc2a3109761b47c785bc44649a29a6ce56 /sd | |
parent | 1fdd1e8f2e91e44762b2b8017125cc1ffb00d4af (diff) |
tdf#130058: sd_export_ooxml2: Add unittest
Change-Id: I6265be73decebca66f9cd5c4350f80525250d718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106282
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf130058.pptx | bin | 0 -> 40724 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 39 |
2 files changed, 39 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf130058.pptx b/sd/qa/unit/data/pptx/tdf130058.pptx Binary files differnew file mode 100644 index 000000000000..cb28109ec7be --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf130058.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 4c7dc3d0eb42..c35ecd6d4563 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -159,6 +159,7 @@ public: void testTdf115005_FallBack_Images_On(); void testTdf115005_FallBack_Images_Off(); void testTdf118806(); + void testTdf130058(); void testTdf111789(); void testTdf100348_convert_Fontwork2TextWarp(); void testTdf1225573_FontWorkScaleX(); @@ -280,6 +281,7 @@ public: CPPUNIT_TEST(testTdf115005_FallBack_Images_On); CPPUNIT_TEST(testTdf115005_FallBack_Images_Off); CPPUNIT_TEST(testTdf118806); + CPPUNIT_TEST(testTdf130058); CPPUNIT_TEST(testTdf111789); CPPUNIT_TEST(testTdf100348_convert_Fontwork2TextWarp); CPPUNIT_TEST(testTdf1225573_FontWorkScaleX); @@ -1993,6 +1995,37 @@ void SdOOXMLExportTest2::testTdf118806() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf130058() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf130058.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + bool bHasShadow = false; + xShape->getPropertyValue("Shadow") >>= bHasShadow; + CPPUNIT_ASSERT(bHasShadow); + double fShadowDist = 0.0; + xShape->getPropertyValue("ShadowXDistance") >>= fShadowDist; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(0), fShadowDist); + xShape->getPropertyValue("ShadowYDistance") >>= fShadowDist; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(141), fShadowDist); + sal_Int32 nColor = 0; + xShape->getPropertyValue("ShadowColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x000000), nColor); + sal_Int32 nTransparency = 0; + xShape->getPropertyValue("ShadowTransparence") >>= nTransparency; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(57), nTransparency); + double fShadowSizeX = 0.0; + xShape->getPropertyValue("ShadowSizeX") >>= fShadowSizeX; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(1000), fShadowSizeX); + double fShadowSizeY = 0.0; + xShape->getPropertyValue("ShadowSizeY") >>= fShadowSizeY; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(1000), fShadowSizeY); + + xDocShRef->DoClose(); +} + void SdOOXMLExportTest2::testTdf111789() { // Shadow properties were not exported for text shapes. @@ -2017,6 +2050,12 @@ void SdOOXMLExportTest2::testTdf111789() sal_Int32 nTransparency = 0; xShape->getPropertyValue("ShadowTransparence") >>= nTransparency; CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7), nTransparency); + double fShadowSizeX = 0.0; + xShape->getPropertyValue("ShadowSizeX") >>= fShadowSizeX; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(100000), fShadowSizeX); + double fShadowSizeY = 0.0; + xShape->getPropertyValue("ShadowSizeY") >>= fShadowSizeY; + CPPUNIT_ASSERT_EQUAL(static_cast<double>(100000), fShadowSizeY); } // Second text shape has no shadow |