summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx6
-rw-r--r--sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptxbin0 -> 73085 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx22
3 files changed, 28 insertions, 0 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 644c31790d64..5071a7bd52d4 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -1376,6 +1376,12 @@ void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector<Constraint>&
aChildrenToShrink.insert(rRule.msForName);
}
+ if (nDir == XML_fromT || nDir == XML_fromB)
+ {
+ // TODO consider rules for vertical linear layout as well.
+ aChildrenToShrink.clear();
+ }
+
if (!aChildrenToShrink.empty())
{
// Have scaling info from rules: then only count scaled children.
diff --git a/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx b/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx
new file mode 100644
index 000000000000..cf1a23a6151e
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index f9ec7c430fb0..4a7da0915f24 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -111,6 +111,7 @@ public:
void testFillColorList();
void testTdf134221();
void testLinearRule();
+ void testLinearRuleVert();
void testAutofitSync();
void testSnakeRows();
@@ -161,6 +162,7 @@ public:
CPPUNIT_TEST(testFillColorList);
CPPUNIT_TEST(testTdf134221);
CPPUNIT_TEST(testLinearRule);
+ CPPUNIT_TEST(testLinearRuleVert);
CPPUNIT_TEST(testAutofitSync);
CPPUNIT_TEST(testSnakeRows);
@@ -1568,6 +1570,26 @@ void SdImportTestSmartArt::testLinearRule()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testLinearRuleVert()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx"), PPTX);
+
+ uno::Reference<drawing::XShape> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ // Get the P1 shape.
+ uno::Reference<drawing::XShape> xShape = getChildShape(getChildShape(xGroup, 1), 1);
+ uno::Reference<text::XTextRange> xShapeText(xShape, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("P1"), xShapeText->getString());
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 2020
+ // - Actual : 10308
+ // i.e. the first item on the vertical linear layout used ~all space, the other items were not
+ // visible.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2020), xShape->getSize().Height);
+
+ xDocShRef->DoClose();
+}
+
void SdImportTestSmartArt::testAutofitSync()
{
sd::DrawDocShellRef xDocShRef = loadURL(