summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-06 16:56:54 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-06 17:24:19 +0200
commit994cca6b4d090abf7b262ab8b16a46528bef6c21 (patch)
treef4f7684e13e96b5b4b5bb3f1f1f78de50e9c6ef0 /sw
parentdbaff6d0b62426ef76acb0a08140eab1371381be (diff)
DOCX export: handle <w:cnfStyle> row property
Change-Id: Ice1cf2ce078b130130c44952ec2be0f8642f21a8
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx19
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx14
2 files changed, 33 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d595af3371a2..b2427148c464 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1980,6 +1980,25 @@ DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.d
// check that one cell attribute present in the original document has been preserved
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/*", 1);
+ // Check that w:cnfStyle row, cell and paragraph property is preserved.
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "val", "100000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstRow", "1");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastRow", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "firstColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:trPr/w:cnfStyle", "lastColumn", "0");
+
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "val", "001000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddVBand", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenVBand", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "oddHBand", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc/w:tcPr/w:cnfStyle", "evenHBand", "0");
+
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "val", "100000000000");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowFirstColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "firstRowLastColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowFirstColumn", "0");
+ assertXPath(pXmlDocument, "//w:tbl/w:tr[1]/w:tc[2]/w:p/w:pPr/w:cnfStyle", "lastRowLastColumn", "0");
+
}
DECLARE_OOXMLEXPORT_TEST(testcantSplit, "2_table_doc.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3db0385d4ef7..92b7b1e4f436 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2921,6 +2921,20 @@ void DocxAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t p
TableHeight( pTableTextNodeInfoInner );
TableCanSplit( pTableTextNodeInfoInner );
+ const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox();
+ const SwTableLine* pTableLine = pTableBox->GetUpper();
+ if (const SfxGrabBagItem* pItem = sw::util::HasItem<SfxGrabBagItem>(pTableLine->GetFrmFmt()->GetAttrSet(), RES_FRMATR_GRABBAG))
+ {
+ const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag();
+ std::map<OUString, uno::Any>::const_iterator it = rGrabBag.find("RowCnfStyle");
+ if (it != rGrabBag.cend())
+ {
+ uno::Sequence<beans::PropertyValue> aAttributes = it->second.get< uno::Sequence<beans::PropertyValue> >();
+ m_pTableStyleExport->CnfStyle(aAttributes);
+ }
+ }
+
+
m_pSerializer->endElementNS( XML_w, XML_trPr );
}