diff options
Diffstat (limited to 'writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx')
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx index edd6e02ff8ea..2f9faefab55f 100644 --- a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx +++ b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx @@ -366,6 +366,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTextboxTextlineTop) sal_Int16 nExpectedOrient = text::VertOrientation::BOTTOM; CPPUNIT_ASSERT_EQUAL(nExpectedOrient, nActualOrient); } + +CPPUNIT_TEST_FIXTURE(Test, testLayoutInCellWrapnoneColumn) +{ + // Given a file with a table, then a shape anchored inside the cell: + OUString aURL + = m_directories.getURLFromSrc(DATA_DIRECTORY) + "layout-in-cell-wrapnone-column.docx"; + + // When loading that document: + getComponent() = loadFromDesktop(aURL); + + // Then make sure the shape can leave the cell: + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(1), uno::UNO_QUERY); + uno::Reference<container::XNamed> xNamedShape(xShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Text Box 1"), xNamedShape->getName()); + bool bFollowingTextFlow = true; + // Without the accompanying fix in place, this test would have failed, the shape was not allowed + // to leave the cell, leading to incorrect layout. + CPPUNIT_ASSERT(xShape->getPropertyValue("IsFollowingTextFlow") >>= bFollowingTextFlow); + CPPUNIT_ASSERT(!bFollowingTextFlow); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |