[Libreoffice-commits] core.git: oox/source sd/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Oct 19 19:35:46 UTC 2018
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 4 +++-
sd/qa/unit/import-tests-smartart.cxx | 7 +++++++
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit b61d2784271bf8b042642c378f50e8b446682548
Author: Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Fri Oct 19 16:49:48 2018 +0200
Commit: Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Oct 19 21:34:07 2018 +0200
oox smartart: fix width of shapes with agl=lin, linDir=fromT
Smaller width only makes sense in the fromL/fromR cases, I think.
Change-Id: I21c643b90556e47593b62abc2466e808d1ef31e5
Reviewed-on: https://gerrit.libreoffice.org/62024
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index ed0678340e4b..7ef0e456ce0f 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -358,7 +358,9 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
awt::Size aChildSize = rShape->getSize();
- aChildSize.Width /= (nCount + (nCount-1)*fSpace);
+ // Lineral vertically: no adjustment of width.
+ if (nDir != XML_fromT)
+ aChildSize.Width /= (nCount + (nCount-1)*fSpace);
aChildSize.Height /= (nCount + (nCount-1)*fSpace);
awt::Point aCurrPos(0, 0);
diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx
index 1c2ef31f2958..9ffb432ce104 100644
--- a/sd/qa/unit/import-tests-smartart.cxx
+++ b/sd/qa/unit/import-tests-smartart.cxx
@@ -371,6 +371,13 @@ void SdImportTestSmartArt::testVertialBoxList()
// 'actual: 0'.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xShapeGroup->getCount());
+ uno::Reference<drawing::XShape> xSecondChild(xShapeGroup->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xSecondChild.is());
+ // Without the accompanying fix in place, this test would have failed with
+ // 'actual: 7361' (and with the fix: 'actual: 16932', i.e. the width of the
+ // parent).
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(10000), xSecondChild->getSize().Width);
+
xDocShRef->DoClose();
}
More information about the Libreoffice-commits
mailing list