Kaydet (Commit) d4d0df13 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: fix handling of textframes having shape text ending with a table

Change-Id: I82ef1072bfeb1195152ef7f1ea743653ac102b37
üst 43c7735d
......@@ -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);
......
......@@ -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
*/
......
......@@ -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( );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment