diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-06-06 13:43:06 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-06-06 13:56:55 +0200 |
commit | 1534c3363336003c4f84cfec1bf988fef6663f8a (patch) | |
tree | d717824921e4c143af77a36267bcb5cd3f82044b /sw/qa | |
parent | 4f1684dc3724f9364f226fd0eb21b01ba07cf017 (diff) |
fdo#79558: Do not overwrite w:shd value
When a w:shd has some pattern with two colors, LO blends both to
render the paragraph background. We must compare that blended color
with the paragraph color on export to know if the user has edited it
or not. We were using the w:fill attribute to compare, but that was
incorrect.
Modified an existing unit test to check this behaviour. The unit test
had to be retouched because Word remove some redundant information
from the original .docx file when I saved it again with some
background changes.
Change-Id: Ia2f1ddc4afd2637e1d87b6eccd441c26853045c4
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/theme-preservation.docx | bin | 15154 -> 15173 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx Binary files differindex 1c94b47be75d..2de4374da59e 100644 --- a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx +++ 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 4c6dcdae0992..596c292c23bd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1930,9 +1930,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") // check theme font color value has been preserved assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeColor", "accent3"); OUString sThemeShade = getXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color", "themeShade"); - CPPUNIT_ASSERT_EQUAL(sThemeShade.toInt32(16), sal_Int32(0xbf)); - assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:r[1]/w:rPr/w:color", "themeColor", "accent1"); - assertXPath(pXmlDocument, "/w:document/w:body/w:p[7]/w:r[1]/w:rPr/w:color", "themeTint", "99"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbf), sThemeShade.toInt32(16)); // check the themeFontLang values in settings file xmlDocPtr pXmlSettings = parseExport("word/settings.xml"); @@ -1956,8 +1954,12 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx") CPPUNIT_ASSERT_EQUAL(OUString("Trebuchet MS"), getProperty<OUString>(getParagraph(5, "Major theme font"), "CharFontName")); - // check the paragraph background theme color has been preserved + // check the paragraph background pattern has been preserved including theme colors + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "val", "thinHorzStripe"); assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFill", "text2"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeFillTint", "33"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeColor", "accent1"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p[6]/w:pPr/w:shd", "themeShade", "80"); } DECLARE_OOXMLEXPORT_TEST(testTableThemePreservation, "table-theme-preservation.docx") |