diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-autofit-sync.pptx | bin | 0 -> 45546 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx b/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx Binary files differnew file mode 100644 index 000000000000..f682c143f584 --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 28dafbc1d9af..254e209acbac 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -110,6 +110,7 @@ public: void testTdf131553(); void testFillColorList(); void testLinearRule(); + void testAutofitSync(); CPPUNIT_TEST_SUITE(SdImportTestSmartArt); @@ -157,6 +158,7 @@ public: CPPUNIT_TEST(testTdf131553); CPPUNIT_TEST(testFillColorList); CPPUNIT_TEST(testLinearRule); + CPPUNIT_TEST(testAutofitSync); CPPUNIT_TEST_SUITE_END(); }; @@ -1548,6 +1550,34 @@ void SdImportTestSmartArt::testLinearRule() xDocShRef->DoClose(); } +void SdImportTestSmartArt::testAutofitSync() +{ + sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-autofit-sync.pptx"), PPTX); + + uno::Reference<drawing::XShape> xDiagram(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xMiddle = getChildShape(xDiagram, 2); + uno::Reference<beans::XPropertySet> xFirstInner(getChildShape(getChildShape(xMiddle, 0), 0), + uno::UNO_QUERY); + sal_Int16 nFirstScale = 0; + CPPUNIT_ASSERT(xFirstInner->getPropertyValue("TextFitToSizeScale") >>= nFirstScale); + CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(0), nFirstScale); + uno::Reference<beans::XPropertySet> xSecondInner(getChildShape(getChildShape(xMiddle, 2), 0), + uno::UNO_QUERY); + sal_Int16 nSecondScale = 0; + CPPUNIT_ASSERT(xSecondInner->getPropertyValue("TextFitToSizeScale") >>= nSecondScale); + CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(0), nSecondScale); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 56 + // - Actual : 100 + // i.e. the left shape had no scale-down and the right shape was scaled down, even if it was + // requested that their scaling matches. + CPPUNIT_ASSERT_EQUAL(nSecondScale, nFirstScale); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt); CPPUNIT_PLUGIN_IMPLEMENT(); |