diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-09-19 10:58:59 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-09-19 13:41:50 +0200 |
commit | ab825c665c1ee509769bdaf0ae95fc111a357fc6 (patch) | |
tree | dc27a2a066bcc93c878088f25da10eb01a27416c /sw/qa/extras/unowriter | |
parent | 34daa253f323cb8b80d6d10a8cdac85e2fa9378d (diff) |
Related: tdf#124600 sw anchored object allow overlap: add UNO API
And fix the pool item's operator==() that forgot to take allow-overlap
into account.
Change-Id: I34ec29eed95d821cfccebbb15675e0f576b6454d
Reviewed-on: https://gerrit.libreoffice.org/79115
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras/unowriter')
-rw-r--r-- | sw/qa/extras/unowriter/unowriter.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index ffb57d836f48..e16562372bc3 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -644,6 +644,32 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testXTextCursor_setPropertyValues) getProperty<OUString>(xCursorProps, "CharStyleName")); } +CPPUNIT_TEST_FIXTURE(SwUnoWriter, testShapeAllowOverlap) +{ + // Test the AllowOverlap frame/shape property. + + // Create a new document and insert a rectangle. + loadURL("private:factory/swriter", nullptr); + uno::Reference<lang::XMultiServiceFactory> xDocument(mxComponent, uno::UNO_QUERY); + awt::Point aPoint(1000, 1000); + awt::Size aSize(10000, 10000); + uno::Reference<drawing::XShape> xShape( + xDocument->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY); + xShape->setPosition(aPoint); + xShape->setSize(aSize); + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xDocument, uno::UNO_QUERY); + xDrawPageSupplier->getDrawPage()->add(xShape); + + // The property is on by default, turn it off & verify. + uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY); + xShapeProperties->setPropertyValue("AllowOverlap", uno::makeAny(false)); + CPPUNIT_ASSERT(!getProperty<bool>(xShapeProperties, "AllowOverlap")); + + // Turn it back to on & verify. + xShapeProperties->setPropertyValue("AllowOverlap", uno::makeAny(true)); + CPPUNIT_ASSERT(getProperty<bool>(xShapeProperties, "AllowOverlap")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |