summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-snake-rows.pptxbin0 -> 52877 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-snake-rows.pptx b/sd/qa/unit/data/pptx/smartart-snake-rows.pptx
new file mode 100644
index 000000000000..7f5e82df3eaf
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-snake-rows.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 4844afe5a84e..1746b7c58f4a 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -108,6 +108,7 @@ public:
void testFillColorList();
void testLinearRule();
void testAutofitSync();
+ void testSnakeRows();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -155,6 +156,7 @@ public:
CPPUNIT_TEST(testFillColorList);
CPPUNIT_TEST(testLinearRule);
CPPUNIT_TEST(testAutofitSync);
+ CPPUNIT_TEST(testSnakeRows);
CPPUNIT_TEST_SUITE_END();
};
@@ -1571,6 +1573,30 @@ void SdImportTestSmartArt::testAutofitSync()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testSnakeRows()
+{
+ // Load a smartart which contains a snake algorithm.
+ // The expected layout of the 6 children is a 3x2 grid.
+ sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-snake-rows.pptx"), PPTX);
+
+ uno::Reference<drawing::XShapes> xDiagram(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ std::set<sal_Int32> aYPositions;
+ for (sal_Int32 nChild = 0; nChild < xDiagram->getCount(); ++nChild)
+ {
+ uno::Reference<drawing::XShape> xChild(xDiagram->getByIndex(nChild), uno::UNO_QUERY);
+ aYPositions.insert(xChild->getPosition().Y);
+ }
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 3
+ // - Actual : 4
+ // i.e. one more unwanted row appeared. This is better, but the ideal would be just 2 rows.
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aYPositions.size());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();