diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-12-04 14:23:21 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-12-04 18:52:04 +0100 |
commit | 13ce74fd9b5f7b9ea9d3dab34eed27a63aae5468 (patch) | |
tree | ab6067864ef474db6657cb3f49320e93aabeb29f /sw | |
parent | 983002475fba1879fd00c75417342be55153b797 (diff) |
fdo#64232: Unit test for font theme attributes preservation
The unit test checks three cases:
* attributes in run properties
* attributes in default run properties
* attributes in style definitions
Change-Id: Ie3224f41bd29e8b258dbd6823b7c9549e1ef5b1e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/theme-preservation.docx | bin | 0 -> 8129 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx Binary files differnew file mode 100644 index 000000000000..c1d879aa05df --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 084968c226b1..ab264fd77ed0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2040,6 +2040,26 @@ DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor")); } +DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") +{ + // check default font theme values have been preserved + xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + if (!pXmlStyles) + return; + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "asciiTheme", "minorHAnsi"); + assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:rPrDefault/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia"); + + // check the font theme values in style definitions + assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia"); + + // check direct format font theme values have been preserved + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts", "hAnsiTheme", "majorBidi"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts", "cstheme", "majorBidi"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |