summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-07-31 11:04:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-05 11:25:42 +0200
commit84a3c0a924dd074c2c3255739e037f475b7238a5 (patch)
tree8864964f3427b7d50dc6f1ff4bcd79d4e860dd73 /sd
parent88b58f002d0faec31f1a1a3d5d50d5f0beb6bd17 (diff)
oox smartart: consider rules when scaling in linear layout
The bugdoc has an arrow shape which is 100% wide, and there are multiple shapes before it, which also have a 100% wide constraint. The reason PowerPoint scales down the shapes (but not the arrow) is because rules declare it should happen this way. So start taking rules into account in linear layouts. (cherry picked from commit 0024c48b4822062995effed7db4f1281196384bb) Change-Id: I352443277e88be0eb711659489587127727a258f Conflicts: sd/qa/unit/import-tests-smartart.cxx Change-Id: I352443277e88be0eb711659489587127727a258f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100102 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/smartart-linear-rule.pptxbin0 -> 43353 bytes
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-linear-rule.pptx b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx
new file mode 100644
index 000000000000..f5fbb5c87a54
--- /dev/null
+++ b/sd/qa/unit/data/pptx/smartart-linear-rule.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index f08b60c30193..84d6450b0df7 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -109,6 +109,7 @@ public:
void testOrgChart2();
void testTdf131553();
void testFillColorList();
+ void testLinearRule();
CPPUNIT_TEST_SUITE(SdImportTestSmartArt);
@@ -155,6 +156,7 @@ public:
CPPUNIT_TEST(testOrgChart2);
CPPUNIT_TEST(testTdf131553);
CPPUNIT_TEST(testFillColorList);
+ CPPUNIT_TEST(testLinearRule);
CPPUNIT_TEST_SUITE_END();
};
@@ -1509,6 +1511,23 @@ void SdImportTestSmartArt::testFillColorList()
xDocShRef->DoClose();
}
+void SdImportTestSmartArt::testLinearRule()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/smartart-linear-rule.pptx"), PPTX);
+
+ uno::Reference<drawing::XShape> xGroup(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ // Last child, then again last child.
+ uno::Reference<drawing::XShape> xShape = getChildShape(getChildShape(xGroup, 1), 3);
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected greater than: 17500 (19867)
+ // - Actual : 4966
+ // i.e. the width of the background arrow was too small.
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(17500), xShape->getSize().Width);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTestSmartArt);
CPPUNIT_PLUGIN_IMPLEMENT();