summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-03 16:27:37 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-03 22:19:20 +0200
commitae61569eea0719a882010cfbb260a1a0d690d974 (patch)
treec65a7a303fd6f656b15b68655ebb1ce54fd38a78 /sw/qa
parentf9636d50e6543302f236164aeebadab2733e849b (diff)
oox: Do not overwrite table style properties
Some table properties can be defined by the table style but cells can overwrite them in their cell properties section. Our exporter was writing all the cell properties in all cases, regardless of them being defined by the theme or not, and we shouldn't do that if we want the document to work properly in Word. To fix the issue I store the style-defined cell properties (the format of all four borders) in the table grab bag. The exporter recovers them and compares with the cell properties before writing them; if the cell property matches the stlye-defined one, we don't write it to the document. An existing unit test was slightly modified to check that the actual cell properties are not being skipped. Change-Id: I3aa12d76fb8f73d3fd300f254d19e1683fb6146c
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/table-theme-preservation.docxbin37411 -> 37479 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx5
2 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx
index fe6b9537bfa9..522dac899417 100644
--- a/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx
+++ b/sw/qa/extras/ooxmlexport/data/table-theme-preservation.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b68b8722be16..1e1fd6dac6a3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1956,6 +1956,11 @@ DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.d
// check table style has been preserved
assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tblPr/w:tblStyle", "val", "Sombreadoclaro-nfasis1");
+ // check table style is not overwritten by other properties
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:tcPr/w:tcBorders/*", 0);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[3]/w:tcPr/w:tcBorders/*", 0);
+ // 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);
}