summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-10 20:33:11 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-02-10 20:57:09 +0100
commit05506b377a81bcbdd0191aa592f17987f2ddcd34 (patch)
treedb5e1d8785eeec46b9bd929788c48d08b179c8ae /sw
parentc782212abf4114b6dd366c38a44574be21c81eb1 (diff)
ooxml: preserve font theme color tint property
Change-Id: I5cbc8fda63a9fd2999555d5a46ea3a063685ffc7
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/theme-preservation.docxbin14798 -> 15154 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
3 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx
index 778e10646ed3..1c94b47be75d 100644
--- a/sw/qa/extras/ooxmlexport/data/theme-preservation.docx
+++ b/sw/qa/extras/ooxmlexport/data/theme-preservation.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ce4ff79af1a8..f6e168b67f0a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2098,6 +2098,10 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
// check the font theme values in style definitions
assertXPath(pXmlStyles, "/w:styles/w:style[1]/w:rPr/w:rFonts", "eastAsiaTheme", "minorEastAsia");
+ // check the color theme values in style definitions
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeColor", "accent1");
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Custom1']/w:rPr/w:color", "themeTint", "99");
+
// check direct format font theme values have been preserved
xmlDocPtr pXmlDocument = parseExport("word/document.xml");
if (!pXmlDocument)
@@ -2109,6 +2113,8 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, "theme-preservation.docx")
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");
// check the themeFontLang values in settings file
xmlDocPtr pXmlSettings = parseExport("word/settings.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3733c7c04369..6e57286c92d9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6196,6 +6196,12 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
AddToAttrList( m_pColorAttrList, FSNS( XML_w, XML_themeShade ),
OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
}
+ else if ( i->first == "CharThemeColorTint" )
+ {
+ i->second >>= str;
+ AddToAttrList( m_pColorAttrList, FSNS( XML_w, XML_themeTint ),
+ OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
else if( i->first == "CharThemeFontNameCs" ||
i->first == "CharThemeFontNameAscii" ||
i->first == "CharThemeFontNameEastAsia" ||