diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-30 10:37:25 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-30 11:37:00 +0200 |
commit | 6c82a9fa1da15d5f83f524f6897028906dda337e (patch) | |
tree | fc1d2efbdbf2c8cd9f1092d8e553eafd9d8ae01c /writerfilter/qa | |
parent | 89a887015044bf1208ab3820a357945c336a0c91 (diff) |
DOCX import: fix overlapping floating tables when anchored inside a table
The WW8 import does the same in SwWW8ImplReader::StartTable(), now we're
on par with that.
Change-Id: I2ce0d96d255d8f405203f36a358559687b36e9e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99762
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter/qa')
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx | 15 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/data/nested-floating-table.docx | bin | 0 -> 12915 bytes |
2 files changed, 15 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx index a1a7595cee76..e49ea59d9cb5 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextTablesSupplier.hpp> +#include <com/sun/star/drawing/XDrawPageSupplier.hpp> using namespace ::com::sun::star; @@ -65,6 +66,20 @@ CPPUNIT_TEST_FIXTURE(Test, test1cellInsidevRightborder) // i.e. the request to have no table-level right border was lost on import. CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), aBorder.LineWidth); } + +CPPUNIT_TEST_FIXTURE(Test, testNestedFloatingTable) +{ + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "nested-floating-table.docx"; + getComponent() = loadFromDesktop(aURL); + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference<beans::XPropertySet> xFrame(xDrawPage->getByIndex(0), uno::UNO_QUERY); + bool bIsFollowingTextFlow = false; + xFrame->getPropertyValue("IsFollowingTextFlow") >>= bIsFollowingTextFlow; + // Without the accompanying fix in place, this test would have failed, the nested floating table + // was partly positioned outside the table cell, leading to overlapping text. + CPPUNIT_ASSERT(bIsFollowingTextFlow); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/qa/cppunittests/dmapper/data/nested-floating-table.docx b/writerfilter/qa/cppunittests/dmapper/data/nested-floating-table.docx Binary files differnew file mode 100644 index 000000000000..73fd922fccd5 --- /dev/null +++ b/writerfilter/qa/cppunittests/dmapper/data/nested-floating-table.docx |