From 5efc2a34a54327961bb393fcf07a562b90f462bd Mon Sep 17 00:00:00 2001 From: Tushar Bende Date: Wed, 27 Nov 2013 20:04:58 +0530 Subject: fdo#71784:Preserve prop "allow row to break across pages" during export Description: If in original doc for table if "allow row to break across pages" is checked then during export it used to write in trPr which was causing problem that all the cell data was getting displayed on same page. Change-Id: I5a20976ca91099de191eb1e2a7290b96dcdc6777 --- sw/qa/extras/ooxmlexport/data/2_table_doc.docx | Bin 0 -> 10090 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 ++++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlexport/data/2_table_doc.docx diff --git a/sw/qa/extras/ooxmlexport/data/2_table_doc.docx b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx new file mode 100644 index 000000000000..21513ec2cc72 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ab264fd77ed0..c4d6e44e304c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2060,6 +2060,18 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts", "cstheme", "majorBidi"); } +DECLARE_OOXMLEXPORT_TEST(testcantSplit, "2_table_doc.docx") +{ + // if Split table value is true for a table then during export do not write + // in table row property,As default row prop is allow row to break across page. + // writing during export was causing problem that all the cell data used to come on same page + xmlDocPtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit",0); + assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val","true"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 6e9cf53954d6..53c574d763c0 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2279,7 +2279,9 @@ void DocxAttributeOutput::TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t p const SwFmtRowSplit& rSplittable = pLineFmt->GetRowSplit( ); const char* pCantSplit = ( !rSplittable.GetValue( ) ) ? "true" : "false"; - + // if rSplittable is true then no need to write + // as default row prop is allow row to break across page. + if( !rSplittable.GetValue( ) ) m_pSerializer->singleElementNS( XML_w, XML_cantSplit, FSNS( XML_w, XML_val ), pCantSplit, FSEND ); -- cgit