diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-10-19 21:07:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-10-20 09:01:34 +0200 |
commit | c719db99166a7b4770855a9599ec65c70cd256c5 (patch) | |
tree | f8021c911255e7ad7b099ab731d8d56b6c1ee882 /sd | |
parent | 9e455724e50bf512683b1cddfeb7493e047c19ae (diff) |
tdf#137417 oox smartart: avoid considering rules in vertical linear layouts
Regression from commit 0024c48b4822062995effed7db4f1281196384bb (oox
smartart: consider rules when scaling in linear layout, 2020-07-31), the
problem is that I only tested horizontal layouts and this is not working
for vertical layouts.
Just disable the vertical case for now, to avoid unwanted side effects.
Change-Id: I31a894157996a2371b8d0ec482ee91dc4d5b053e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104541
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx | bin | 0 -> 73085 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests-smartart.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx b/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx Binary files differnew file mode 100644 index 000000000000..cf1a23a6151e --- /dev/null +++ b/sd/qa/unit/data/pptx/smartart-linear-rule-vert.pptx 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( |