From d4d0df13bd4291b7f988bdce68a087a58bb4c70f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 21 Aug 2013 16:01:12 +0200 Subject: DOCX import: fix handling of textframes having shape text ending with a table Change-Id: I82ef1072bfeb1195152ef7f1ea743653ac102b37 --- writerfilter/inc/resourcemodel/TableManager.hxx | 8 ++++++++ writerfilter/source/dmapper/DomainMapper.cxx | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'writerfilter') diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx index 72841ff25ee5..ed512509a1ec 100644 --- a/writerfilter/inc/resourcemodel/TableManager.hxx +++ b/writerfilter/inc/resourcemodel/TableManager.hxx @@ -530,6 +530,14 @@ public: */ virtual void endLevel(); + /** + * Signal that the next paragraph definitely won't be part of any table. + */ + void endTable() + { + setRowEnd(false); + } + /** Tells whether a table has been started or not */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index e5726901abdd..d4061aa1aee7 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3558,6 +3558,12 @@ void DomainMapper::lcl_endShape( ) { if (m_pImpl->GetTopContext()) { + // End the current table, if there are any. Otherwise the unavoidable + // empty paragraph at the end of the shape text will cause problems: if + // the shape text ends with a table, the extra paragraph will be + // handled as an additional row of the ending table. + m_pImpl->getTableManager().endTable(); + lcl_endParagraphGroup(); m_pImpl->PopShapeContext( ); } -- cgit