oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 12 +++++++++--- sd/qa/unit/import-tests-smartart.cxx | 19 +++++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-)
New commits: commit 73cac1031131021819a0fbd4d60554196aea230c Author: Gülşah Köse <[email protected]> AuthorDate: Thu Feb 20 14:13:40 2020 +0300 Commit: Gülşah Köse <[email protected]> CommitDate: Mon Feb 24 08:23:59 2020 +0100 tdf130839: Corrects second level left margin in Smartart Change-Id: Ifec339759427336fd53012e0a8a906d240be9654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89085 Tested-by: Jenkins Reviewed-by: Gülşah Köse <[email protected]> (cherry picked from commit eeaa7aba6e7ace8b69d7056645b15be2f996d8fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89277 diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 14af84da6ac4..1b6a821f3a0a 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 2d47381c4e67..d14c4bc6950a 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); @@ -1277,7 +1277,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"), @@ -1297,8 +1297,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() _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
