diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-01 09:03:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-02 09:20:49 +0200 |
commit | 3cf789a15450efcdcf8dd95eeb71bfc746591f1c (patch) | |
tree | 14817b9508575cdde1581de3e608e5762b809707 /writerfilter/source | |
parent | 948d606b0260a33a5db77061f560afebde3fcdb7 (diff) |
tdf#79639 DOCX import: don't delay text frame conversion of in-header tables
Floating tables may or may not be converted to table-in-textframes
during import, depending on if we guess that it'll be a multi-page table
with minimal wrapping or a real wrapped table.
If the floating table is in a header or footer, then it won't be a
multi-page one, so can do the conversion right away.
Change-Id: I8d5ff8c5fe00037d5cef92dea6b54de6806214bc
(cherry picked from commit 81ef96a2417c7843dfed0558c920ad3064e58921)
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 809429ddbda6..b08e52a3c90f 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1113,12 +1113,19 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) // Also, when the anchor is within a table, then do it here as well, // as xStart/xEnd would not point to the start/end at conversion // time anyway. + // Next exception: it's pointless to delay the conversion if the + // table is not in the body text. sal_Int32 nTableWidth = 0; m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH, nTableWidth); - if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1) + if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter()) m_rDMapper_Impl.m_aPendingFloatingTables.push_back(FloatingTableInfo(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth)); else - m_xText->convertToTextFrame(xStart, xEnd, comphelper::containerToSequence(aFrameProperties)); + { + // m_xText points to the body text, get to 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); + if (xTextAppendAndConvert.is()) + xTextAppendAndConvert->convertToTextFrame(xStart, xEnd, comphelper::containerToSequence(aFrameProperties)); + } } } |