diff options
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 12 | ||||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 19 |
2 files changed, 24 insertions, 7 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 12dcae71663c..51b4c8c96472 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -1224,10 +1224,16 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, aParagraph->getProperties().setLevel(nLevel); if (nLevel >= nStartBulletsAtLevel) { + if (!aParagraph->getProperties().getParaLeftMargin().has_value()) + { + sal_Int32 nLeftMargin = 285750 * (nLevel - nStartBulletsAtLevel + 1) / EMU_PER_HMM; + aParagraph->getProperties().getParaLeftMargin() = nLeftMargin; + } + + if (!aParagraph->getProperties().getFirstLineIndentation().has_value()) + aParagraph->getProperties().getFirstLineIndentation() = -285750 / EMU_PER_HMM; + // It is not possible to change the bullet style for text. - sal_Int32 nLeftMargin = 285750 * (nLevel - nStartBulletsAtLevel + 1) / EMU_PER_HMM; - aParagraph->getProperties().getParaLeftMargin() = nLeftMargin; - aParagraph->getProperties().getFirstLineIndentation() = -285750 / EMU_PER_HMM; OUString aBulletChar = OUString::fromUtf8(u8"•"); aParagraph->getProperties().getBulletList().setBulletChar(aBulletChar); aParagraph->getProperties().getBulletList().setSuffixNone(); diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 842cc979ca9c..f0ab9ff067f5 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -101,7 +101,7 @@ public: void testFontSize(); void testVerticalBlockList(); void testBulletList(); - void testMissingBullet(); + void testMissingBulletAndIndent(); void testRecursion(); void testDataFollow(); void testOrgChart2(); @@ -145,7 +145,7 @@ public: CPPUNIT_TEST(testFontSize); CPPUNIT_TEST(testVerticalBlockList); CPPUNIT_TEST(testBulletList); - CPPUNIT_TEST(testMissingBullet); + CPPUNIT_TEST(testMissingBulletAndIndent); CPPUNIT_TEST(testRecursion); CPPUNIT_TEST(testDataFollow); CPPUNIT_TEST(testOrgChart2); @@ -1278,7 +1278,7 @@ void SdImportTestSmartArt::testVerticalBlockList() xDocShRef->DoClose(); } -void SdImportTestSmartArt::testMissingBullet() +void SdImportTestSmartArt::testMissingBulletAndIndent() { sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-missing-bullet.pptx"), @@ -1298,8 +1298,19 @@ void SdImportTestSmartArt::testMissingBullet() sal_Int16 nNumberingLevel = -1; xPara1->getPropertyValue("NumberingLevel")>>= nNumberingLevel; - CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nNumberingLevel); + + uno::Reference< container::XIndexAccess > xNumRule; + xPara1->getPropertyValue("NumberingRules") >>= xNumRule; + uno::Sequence<beans::PropertyValue> aBulletProps; + xNumRule->getByIndex(1) >>= aBulletProps; + + for (int i = 0; i < aBulletProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aBulletProps[i]; + if(rProp.Name == "LeftMargin") + CPPUNIT_ASSERT_EQUAL(sal_Int32(309), rProp.Value.get<sal_Int32>()); + } } void SdImportTestSmartArt::testBulletList() |