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

DOCX export: handle <w:cnfStyle> row property

Change-Id: Ice1cf2ce078b130130c44952ec2be0f8642f21a8
üst dbaff6d0
...@@ -1980,6 +1980,25 @@ DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.d ...@@ -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 // 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); 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") DECLARE_OOXMLEXPORT_TEST(testcantSplit, "2_table_doc.docx")
......
...@@ -2921,6 +2921,20 @@ void DocxAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t p ...@@ -2921,6 +2921,20 @@ void DocxAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t p
TableHeight( pTableTextNodeInfoInner ); TableHeight( pTableTextNodeInfoInner );
TableCanSplit( 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 ); m_pSerializer->endElementNS( XML_w, XML_trPr );
} }
......
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