diff options
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx | 14 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/data/floattable-footnote-redline.docx | bin | 0 -> 9673 bytes | |||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SettingsTable.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SettingsTable.hxx | 2 |
5 files changed, 24 insertions, 1 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx index 5d8d5efc50cc..b72b81913978 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx @@ -183,6 +183,20 @@ CPPUNIT_TEST_FIXTURE(Test, testDOCXFloatingTableHeader) // 2233 pages and then there was a layout loop. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), nLastPage); } + +CPPUNIT_TEST_FIXTURE(Test, testDOCXFloatingTableFootnoteRedline) +{ + // Given a document with a floating table in a footnote, with track changes recorded (but not + // visible): + // When importing that document: + loadFromFile(u"floattable-footnote-redline.docx"); + + // Then make sure the table is imported as inline, till Writer layout is ready to handle + // floating tables in footnotes: + uno::Reference<drawing::XDrawPageSupplier> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xModel->getDrawPage(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), xDrawPage->getCount()); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/qa/cppunittests/dmapper/data/floattable-footnote-redline.docx b/writerfilter/qa/cppunittests/dmapper/data/floattable-footnote-redline.docx Binary files differnew file mode 100644 index 000000000000..10904ce43eb5 --- /dev/null +++ b/writerfilter/qa/cppunittests/dmapper/data/floattable-footnote-redline.docx diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 2092ba4096ae..e63d1cf9615f 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1599,7 +1599,12 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) // m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header. uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert(m_rDMapper_Impl.GetTopTextAppend(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xFrameAnchor; - if (xTextAppendAndConvert.is()) + + // Writer layout has problems with redlines on floating table rows in footnotes, avoid + // them. + bool bInFootnote = m_rDMapper_Impl.IsInFootOrEndnote(); + bool bRecordChanges = m_rDMapper_Impl.GetSettingsTable()->GetRecordChanges(); + if (xTextAppendAndConvert.is() && !(bInFootnote && bRecordChanges)) { std::deque<css::uno::Any> aFramedRedlines = m_rDMapper_Impl.m_aStoredRedlines[StoredRedlines::FRAME]; std::vector<sal_Int32> redPos, redLen; diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 43ef02f68134..b16846420682 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -778,6 +778,8 @@ bool SettingsTable::GetNoLeading() const bool SettingsTable::GetGutterAtTop() const { return m_pImpl->m_bGutterAtTop; } +bool SettingsTable::GetRecordChanges() const { return m_pImpl->m_bRecordChanges; } + }//namespace dmapper } //namespace writerfilter diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx index a0af31bed6bb..471d15b7a999 100644 --- a/writerfilter/source/dmapper/SettingsTable.hxx +++ b/writerfilter/source/dmapper/SettingsTable.hxx @@ -97,6 +97,8 @@ public: const OUString& GetCurrentDatabaseDataSource() const; bool GetGutterAtTop() const; + bool GetRecordChanges() const; + private: // Properties virtual void lcl_attribute(Id Name, Value& val) override; |