diff options
author | nd101 <Fong@nd.com.cn> | 2019-08-14 16:07:22 +0800 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2019-08-23 13:20:08 +0200 |
commit | e2b16c5660a8f3f72c1d1ba74ce565e8628b3dbb (patch) | |
tree | 985db65cf79ed2e813480823c1b1baa206ff2d32 /sd | |
parent | 54b47a81fdba4fb42f7f5eaee65292014567cd29 (diff) |
tdf#126741 - fix dash dot dot line style import problem, for pptx
To make it consistent with MS PowerPoint, make the dash dot dot
line start with dash instead of dots.
Based on Regina Henschel's technical analysis and code pointers,
but only make change to the lgDashDotDot case and leave
everything else untouched.
Change-Id: Ide533a562005c617eca9d556a63b6aec39017e93
Reviewed-on: https://gerrit.libreoffice.org/77443
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf126741.pptx | bin | 0 -> 32437 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf126741.pptx b/sd/qa/unit/data/pptx/tdf126741.pptx Binary files differnew file mode 100644 index 000000000000..ca74d1c34914 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf126741.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index d17122744fdb..dc1c4246ff35 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -39,6 +39,8 @@ #include <svx/svdomedia.hxx> #include <svx/svdoole2.hxx> #include <svx/xflclit.hxx> +#include <svx/xlineit0.hxx> +#include <svx/xlndsit.hxx> #include <animations/animationnodehelper.hxx> #include <unotools/mediadescriptor.hxx> #include <rtl/ustring.hxx> @@ -216,6 +218,7 @@ public: void testTdf125360_2(); void testTdf125551(); void testTdf126234(); + void testTdf126741(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -309,6 +312,7 @@ public: CPPUNIT_TEST(testTdf125360_2); CPPUNIT_TEST(testTdf125551); CPPUNIT_TEST(testTdf126234); + CPPUNIT_TEST(testTdf126741); CPPUNIT_TEST_SUITE_END(); @@ -2508,6 +2512,32 @@ void SdOOXMLExportTest2::testTdf126234() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf126741() +{ + sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126741.pptx"), PPTX ); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + // dash dot dot line style import fix + const SdrPage *pPage = GetPage( 1, xDocShRef ); + SdrObject *const pObj = pPage->GetObj(0); + CPPUNIT_ASSERT(pObj); + + const XLineStyleItem& rStyleItem = dynamic_cast<const XLineStyleItem&>( + pObj->GetMergedItem(XATTR_LINESTYLE)); + const XLineDashItem& rDashItem = dynamic_cast<const XLineDashItem&>( + pObj->GetMergedItem(XATTR_LINEDASH)); + + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_DASH, rStyleItem.GetValue()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), rDashItem.GetDashValue().GetDots()); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(280), rDashItem.GetDashValue().GetDotLen()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), rDashItem.GetDashValue().GetDashes()); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), rDashItem.GetDashValue().GetDashLen()); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(105), rDashItem.GetDashValue().GetDistance()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |