[Libreoffice-commits] core.git: test/source
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 2 13:03:49 UTC 2019
test/source/sheet/shape.cxx | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
New commits:
commit 8603d7029b0d62032a5c9d2e039117799be9e798
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Apr 2 08:17:46 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Apr 2 15:03:22 2019 +0200
tdf#124329 Test setting ResizeWithCell via UNO API
Change-Id: Iab8733e5a5df2b189197df89c3e08cd3463f2ec7
Reviewed-on: https://gerrit.libreoffice.org/70111
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/test/source/sheet/shape.cxx b/test/source/sheet/shape.cxx
index e9d26af4a2a0..ac50a1a11223 100644
--- a/test/source/sheet/shape.cxx
+++ b/test/source/sheet/shape.cxx
@@ -48,6 +48,15 @@ void Shape::testShapeProperties()
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Anchor (XCell)",
xShape->getPropertyValue("Anchor") >>= xCellGet);
+ // Shape should not resize with cell by default
+ bool bIsResizeWithCell;
+ xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell;
+ CPPUNIT_ASSERT_MESSAGE("Shape should not resize with the cell", !bIsResizeWithCell);
+
+ xShape->setPropertyValue("ResizeWithCell", uno::Any(true));
+ xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell;
+ CPPUNIT_ASSERT_MESSAGE("Shape should resize with the cell", bIsResizeWithCell);
+
// Now anchor to sheet again
aNewValue <<= xSheet;
xShape->setPropertyValue("Anchor", aNewValue);
@@ -55,6 +64,15 @@ void Shape::testShapeProperties()
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Anchor (XSpreadsheet)",
xShape->getPropertyValue("Anchor") >>= xSheetGet);
+ // Setting ResizeWithCell while anchored to page should not have any effect
+ xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell;
+ CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should be false for sheet anchored shapes",
+ !bIsResizeWithCell);
+ xShape->setPropertyValue("ResizeWithCell", uno::Any(true));
+ xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell;
+ CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should be unchangeable for sheet anchored shapes",
+ !bIsResizeWithCell);
+
sal_Int32 nHoriOrientPositionGet = 0;
sal_Int32 nHoriOrientPositionSet = 0;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue HoriOrientPosition",
More information about the Libreoffice-commits
mailing list