oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 2 +- sd/qa/unit/import-tests-smartart.cxx | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-)
New commits: commit 397b64afc62a5632a6648598558a4d2c3ca0d283 Author: Miklos Vajna <vmik...@collabora.co.uk> AuthorDate: Fri Oct 26 17:45:49 2018 +0200 Commit: Miklos Vajna <vmik...@collabora.co.uk> CommitDate: Fri Oct 26 19:08:26 2018 +0200 oox smartart, linear layout: take horizontal position from constraints Both horizontal size and position looks sane now. Change-Id: I6f040e4f0ff49be74420fafc4bcc5e899b6e94f7 Reviewed-on: https://gerrit.libreoffice.org/62397 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Jenkins diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index e8665542b876..78fd0c97481e 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -415,7 +415,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, aCurrShape->setSize(aSize); aCurrShape->setChildSize(aChildSize); - aCurrPos.X += nIncX * (aChildSize.Width + fSpace*aChildSize.Width); + aCurrPos.X += nIncX * (aSize.Width + fSpace*aSize.Width); aCurrPos.Y += nIncY * (aChildSize.Height + fSpace*aChildSize.Height); } break; diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 864fc1ad11f5..3f0d274f2c6a 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -380,12 +380,19 @@ void SdImportTestSmartArt::testVertialBoxList() // constraint wanted. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11852), xParentText->getSize().Width); - uno::Reference<drawing::XShape> xSecondChild(xShapeGroup->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xSecondChild.is()); + uno::Reference<drawing::XShape> xChildText(xShapeGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChildText.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); + CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(10000), xChildText->getSize().Width); + + // Assert that the right edge of the parent text is closer to the slide + // boundary than the right edge of the parent text. + // Without the accompanying fix in place, this test would have failed with + // 'Expected greater than: 25656, Actual : 21165'. + CPPUNIT_ASSERT_GREATER(xParentText->getPosition().X + xParentText->getSize().Width, + xChildText->getPosition().X + xChildText->getSize().Width); xDocShRef->DoClose(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits