summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--writerfilter/inc/resourcemodel/TableManager.hxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
3 files changed, 17 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2db8917f5c06..f2ab8edc3d7c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1168,12 +1168,9 @@ void Test::testTableFloatingMargins()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xFrame, "TopMargin"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(xFrame, "BottomMargin"));
- if (m_bImport)
- {
- // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table.
- xmlDocPtr pXmlDoc = parseExport();
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:pict/v:rect/v:textbox/w:txbxContent/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
- }
+ // Paragraph bottom margin wasn't 0 in the A1 cell of the floating table.
+ xmlDocPtr pXmlDoc = parseExport();
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:pict/v:rect/v:textbox/w:txbxContent/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
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
@@ -531,6 +531,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
*/
bool isInTable();
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( );
}