summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-08 09:11:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-08 09:51:42 +0000
commitc1eebcdac9f2b289fd363399130c485ca5ff444c (patch)
treea34d4cd3477e8699dd00df753fcab62152c2298e /writerfilter/source/dmapper/DomainMapperTableHandler.cxx
parentbbf6c5171706e55edcf8e011a536264f4f2efd99 (diff)
tdf#79329 DOCX import: fix missing outer table with floattable at cell start
The bug document has a normal table, then its C1 cell starts with a nested table, which is floating. The problem is that converting the nested table to a textframe invalidates the start text range of the C1 cell in the outer table we store, so the conversion of the outer table from text to table fails. This never worked, so to avoid the regression just don't convert inner floating tables to textframes when they're anchored at the cell start. A more general fix in the future can be addressing the actual invalidation of the cell start/end text ranges, and then this specific fix will not be necessary anymore. Change-Id: I12cefa41977cf719b07b0fb3ef9ec423c17ef3b1 Reviewed-on: https://gerrit.libreoffice.org/30685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 99087d50e645..9cdfe1c639a9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -982,7 +982,7 @@ static void lcl_ApplyCellParaProps(uno::Reference<table::XCell> const& xCell,
}
}
-void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel)
+void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart)
{
#ifdef DEBUG_WRITERFILTER
TagLogger::getInstance().startElement("tablehandler.endTable");
@@ -1127,7 +1127,10 @@ 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);
- if (xTextAppendAndConvert.is())
+ // Only execute the conversion if the table is not anchored at
+ // the start of an outer table cell, that's not yet
+ // implemented.
+ if (xTextAppendAndConvert.is() && !bTableStartsAtCellStart)
xTextAppendAndConvert->convertToTextFrame(xStart, xEnd, comphelper::containerToSequence(aFrameProperties));
}
}