diff options
author | Tushar Bende <tushar.bende@synerzip.com> | 2013-11-27 20:04:58 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-06 09:38:14 +0000 |
commit | 5efc2a34a54327961bb393fcf07a562b90f462bd (patch) | |
tree | b57a70d831a1b4e2dacb73b6975ffa61797cab04 /sw | |
parent | e413521e0bd402530ff0308d9e05331e6bdc0c25 (diff) |
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 <w:cantSplit w:val="false"/> in trPr which was causing problem that all the cell
data was getting displayed on same page.
Change-Id: I5a20976ca91099de191eb1e2a7290b96dcdc6777
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/2_table_doc.docx | bin | 0 -> 10090 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/2_table_doc.docx b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx Binary files differnew file mode 100644 index 000000000000..21513ec2cc72 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/2_table_doc.docx 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 <w:cantSplit w:val="false"/> + // in table row property,As default row prop is allow row to break across page. + // writing <w:cantSplit w:val="false"/> 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 <w:cantSplit w:val="false"/> + // 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 ); |