diff options
author | Paul Trojahn <paul.trojahn@gmail.com> | 2017-11-13 18:27:22 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-12-18 15:46:40 +0100 |
commit | 3b4f14f4da046dab25362114db737968634cd720 (patch) | |
tree | 1d11378090d4d5d4e8b8a6cfa605c28b7a33830b /sd/qa | |
parent | 61b1d631331551b43bc7d619be33bfbfeff7cad6 (diff) |
tdf#90626 PPTX: Fix image bullet size
This solution comes with a few limitations. The bullet isn't centered in
Powerpoint and has to be between 25% and 400% of the size of the first
character in the paragraph. This isn't optimal, but should produce
acceptable results under most circumstances.
Change-Id: I6c37169282aa351b81d78e06678424203b78f6d7
Reviewed-on: https://gerrit.libreoffice.org/44911
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/odp/tdf90626.odp | bin | 0 -> 12363 bytes | |||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf90626.pptx | bin | 0 -> 24027 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 17 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 19 |
4 files changed, 36 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf90626.odp b/sd/qa/unit/data/odp/tdf90626.odp Binary files differnew file mode 100644 index 000000000000..cea98fcd7018 --- /dev/null +++ b/sd/qa/unit/data/odp/tdf90626.odp diff --git a/sd/qa/unit/data/pptx/tdf90626.pptx b/sd/qa/unit/data/pptx/tdf90626.pptx Binary files differnew file mode 100644 index 000000000000..ef31fc92f126 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf90626.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 2a380b3fc7ab..a3d477d2d1f6 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -124,6 +124,7 @@ public: void testGroupsRotatedPosition(); void testAccentColor(); void testTdf68759(); + void testTdf90626(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -173,6 +174,7 @@ public: CPPUNIT_TEST(testGroupsRotatedPosition); CPPUNIT_TEST(testAccentColor); CPPUNIT_TEST(testTdf68759); + CPPUNIT_TEST(testTdf90626); CPPUNIT_TEST_SUITE_END(); @@ -1319,6 +1321,21 @@ void SdOOXMLExportTest2::testTdf68759() assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm", "flipH", "1"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm/a:off", "x", "5934960"); assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic[3]/p:spPr/a:xfrm/a:off", "y", "1615320"); + +} + +void SdOOXMLExportTest2::testTdf90626() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf90626.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[1]/a:pPr/a:buSzPct", "val", "46986"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[2]/a:pPr/a:buSzPct", "val", "150568"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[3]/a:pPr/a:buSzPct", "val", "46986"); + assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p[4]/a:pPr/a:buSzPct", "val", "150568"); } CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 0d2ede053bae..5f91f1ad2f75 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -165,6 +165,7 @@ public: void testTdf109187(); void testTdf108926(); void testTdf100065(); + void testTdf90626(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -238,6 +239,7 @@ public: CPPUNIT_TEST(testTdf109187); CPPUNIT_TEST(testTdf108926); CPPUNIT_TEST(testTdf100065); + CPPUNIT_TEST(testTdf90626); CPPUNIT_TEST_SUITE_END(); }; @@ -2285,6 +2287,23 @@ void SdImportTest::testTdf100065() xDocShRef->DoClose(); } +void SdImportTest::testTdf90626() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf90626.pptx"), PPTX); + const SdrPage *pPage = GetPage(1, xDocShRef); + SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>(pPage->GetObj(1)); + CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr); + const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); + for(int i = 0; i < 4; i++) + { + const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(i).GetItem(EE_PARA_NUMBULLET); + CPPUNIT_ASSERT(pNumFmt); + CPPUNIT_ASSERT_DOUBLES_EQUAL(long(371), pNumFmt->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight(), long(1)); + } + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |