diff options
author | Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com> | 2019-06-04 13:51:40 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-06-04 17:23:32 +0200 |
commit | 1e1535d46f9d89a2584409d88f35b57ef920eefa (patch) | |
tree | ebc2c1dccfeb1c4b3e2c66a3cd2d9b067f91385d /sd/qa/unit | |
parent | 8caa7d1824ff87a82ba2f6f16351dfab5b219f63 (diff) |
SmartArt: bullet list improvements
by default start bullet list at second level
use stBulletLvl parameter to change this behaviour
Change-Id: I5084e7bf1902fdca83bea6d57a8c1f37dd2e65be
Reviewed-on: https://gerrit.libreoffice.org/73440
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-bullet-list.pptx | bin | 0 -> 40468 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 32 |
2 files changed, 31 insertions, 1 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-bullet-list.pptx b/sd/qa/unit/data/pptx/smartart-bullet-list.pptx Binary files differnew file mode 100644 index 000000000000..d95bdb769140 --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-bullet-list.pptx diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 722cb142fbfc..775411c57bba 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -78,6 +78,7 @@ public: void testCenterCycle(); void testFontSize(); void testVerticalBlockList(); + void testBulletList(); CPPUNIT_TEST_SUITE(SdImportTestSmartArt); @@ -117,6 +118,7 @@ public: CPPUNIT_TEST(testCenterCycle); CPPUNIT_TEST(testFontSize); CPPUNIT_TEST(testVerticalBlockList); + CPPUNIT_TEST(testBulletList); CPPUNIT_TEST_SUITE_END(); }; @@ -674,7 +676,7 @@ void SdImportTestSmartArt::testAccentProcess() uno::Reference<container::XIndexAccess> xRules(xPara->getPropertyValue("NumberingRules"), uno::UNO_QUERY); - comphelper::SequenceAsHashMap aRule(xRules->getByIndex(1)); + comphelper::SequenceAsHashMap aRule(xRules->getByIndex(0)); CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8(u8"•"), aRule["BulletChar"].get<OUString>()); } @@ -1244,6 +1246,34 @@ void SdImportTestSmartArt::testVerticalBlockList() xDocShRef->DoClose(); } +void SdImportTestSmartArt::testBulletList() +{ + sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-bullet-list.pptx"), + PPTX); + uno::Reference<drawing::XShapes> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + CPPUNIT_ASSERT(xGroup.is()); + + uno::Reference<text::XText> xText(xGroup->getByIndex(1), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParasAccess(xText, uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParas = xParasAccess->createEnumeration(); + xParas->nextElement(); // skip parent + + // child levels should have bullets + uno::Reference<beans::XPropertySet> xPara1(xParas->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xRules1(xPara1->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aRule1(xRules1->getByIndex(1)); + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8(u8"•"), aRule1["BulletChar"].get<OUString>()); + + uno::Reference<beans::XPropertySet> xPara2(xParas->nextElement(), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xRules2(xPara2->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aRule2(xRules2->getByIndex(2)); + CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8(u8"•"), aRule2["BulletChar"].get<OUString>()); + + xDocShRef->DoClose(); +} + + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt); CPPUNIT_PLUGIN_IMPLEMENT(); |