summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-10-26 17:45:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-10-26 19:08:26 +0200
commit397b64afc62a5632a6648598558a4d2c3ca0d283 (patch)
tree6bb48cb857f850594ddd29f845690e623376059e
parenta23ef14e671ad427b2cef81a4482ce006c347846 (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Jenkins
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.cxx2
-rw-r--r--sd/qa/unit/import-tests-smartart.cxx13
2 files changed, 11 insertions, 4 deletions
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();
}