summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-composite-infer-right.pptxbin0 -> 23234 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-composite-infer-right.pptx b/sd/qa/unit/data/pptx/smartart-composite-infer-right.pptx
new file mode 100644
index 000000000000..ca417499fa16
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-composite-infer-right.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index edb8edaed9f2..35920ae76ac0 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -111,6 +111,7 @@ public:
void testLinearRuleVert();
void testAutofitSync();
void testSnakeRows();
+ void testCompositeInferRight();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -161,6 +162,7 @@ public:
CPPUNIT_TEST(testLinearRuleVert);
CPPUNIT_TEST(testAutofitSync);
CPPUNIT_TEST(testSnakeRows);
+ CPPUNIT_TEST(testCompositeInferRight);
CPPUNIT_TEST_SUITE_END();
};
@@ -1637,6 +1639,30 @@ void SdImportTestSmartArt::testSnakeRows()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testCompositeInferRight()
+{
+ // Load a smartart which contains a composite algorithm.
+ // One contraint says that the left of the text should be the right of the image.
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/smartart-composite-infer-right.pptx"),
+ PPTX);
+
+ uno::Reference<drawing::XShape> xDiagram(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xMiddle = getChildShape(xDiagram, 1);
+ uno::Reference<drawing::XShape> xImage = getChildShape(xMiddle, 1);
+ uno::Reference<drawing::XShape> xText = getChildShape(xMiddle, 2);
+ sal_Int32 nRightOfImage = xImage->getPosition().X + xImage->getSize().Width;
+ sal_Int32 nLeftOfText = xText->getPosition().X;
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected greater than: 7925
+ // - Actual : 2430
+ // i.e. the text was overlapping with the image.
+ CPPUNIT_ASSERT_GREATER(nRightOfImage, nLeftOfText);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();