diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-04 14:36:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-04 15:09:29 +0100 |
commit | 97561260ffe26734b11ba629a035c1bccc7c8994 (patch) | |
tree | a3614c48db4aadf8bbe666a4840932b71cd403eb | |
parent | 1f07a1c722efd86074abca2476f6c28ce2ba2757 (diff) |
DOCX filter: roundtrip themeTint and themeShade
Change-Id: Idaf5f6ef13df1ee821d23b8366d25924d26ff4c2
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/quicktables.docx | bin | 0 -> 12205 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxtablestyleexport.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 5 |
4 files changed, 20 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/quicktables.docx b/sw/qa/extras/ooxmlexport/data/quicktables.docx Binary files differnew file mode 100644 index 000000000000..5060d3dbae23 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/quicktables.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c7498d432d41..ed0b0005368c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1341,6 +1341,16 @@ DECLARE_OOXML_TEST(testCalendar2, "calendar2.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99"); } +DECLARE_OOXML_TEST(testQuicktables, "quicktables.docx") +{ + xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); + + // These were missing in the Calendar3 table style. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts", "cstheme", "majorBidi"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:color", "themeTint", "80"); + CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeShade").equalsIgnoreAsciiCase("BF")); +} + DECLARE_OOXML_TEST(testSmartart, "smartart.docx") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index f909876d6880..8e468f006c7a 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -176,6 +176,10 @@ void lcl_TableStyleRColor(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); else if (rColor[i].Name == "themeColor") pAttributeList->add(FSNS(XML_w, XML_themeColor), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); + else if (rColor[i].Name == "themeTint") + pAttributeList->add(FSNS(XML_w, XML_themeTint), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); + else if (rColor[i].Name == "themeShade") + pAttributeList->add(FSNS(XML_w, XML_themeShade), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); } sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList); pSerializer->singleElementNS(XML_w, XML_color, xAttributeList); @@ -214,6 +218,8 @@ void lcl_TableStyleRRFonts(sax_fastparser::FSHelperPtr pSerializer, uno::Sequenc pAttributeList->add(FSNS(XML_w, XML_eastAsiaTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); else if (rRFonts[i].Name == "asciiTheme") pAttributeList->add(FSNS(XML_w, XML_asciiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); + else if (rRFonts[i].Name == "cstheme") + pAttributeList->add(FSNS(XML_w, XML_cstheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); else if (rRFonts[i].Name == "hAnsiTheme") pAttributeList->add(FSNS(XML_w, XML_hAnsiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index d026fa5e0866..9a6488f2f2f5 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -972,6 +972,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( sStringValue )); break; case NS_ooxml::LN_CT_Fonts_cstheme: + m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "cstheme", ThemeTable::getStringForTheme(nIntValue)); if (m_pImpl->GetTopContext()) m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) )); break; @@ -1444,8 +1445,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeColor", TDefTableHandler::getThemeColorTypeString(nIntValue)); break; case NS_ooxml::LN_CT_Color_themeTint: + m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeTint", OUString::number(nIntValue, 16)); + break; case NS_ooxml::LN_CT_Color_themeShade: - //unsupported + m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeShade", OUString::number(nIntValue, 16)); break; case NS_ooxml::LN_CT_DocGrid_linePitch: { |