summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-01 09:03:05 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:21:38 +0200
commitba36de7fb5a103586236b28d2e4f35f415a79adf (patch)
tree4d33d2c5d695784ef21028ba8aa2615625efff49 /writerfilter
parent791f26ab2c4b677a69e3c5078036a8daedcca44f (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')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx11
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));
+ }
}
}