Kaydet (Commit) 97561260 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX filter: roundtrip themeTint and themeShade

Change-Id: Idaf5f6ef13df1ee821d23b8366d25924d26ff4c2
üst 1f07a1c7
...@@ -1341,6 +1341,16 @@ DECLARE_OOXML_TEST(testCalendar2, "calendar2.docx") ...@@ -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"); 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") DECLARE_OOXML_TEST(testSmartart, "smartart.docx")
{ {
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
......
...@@ -176,6 +176,10 @@ void lcl_TableStyleRColor(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence ...@@ -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()); pAttributeList->add(FSNS(XML_w, XML_val), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
else if (rColor[i].Name == "themeColor") else if (rColor[i].Name == "themeColor")
pAttributeList->add(FSNS(XML_w, XML_themeColor), OUStringToOString(rColor[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); 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); sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
pSerializer->singleElementNS(XML_w, XML_color, xAttributeList); pSerializer->singleElementNS(XML_w, XML_color, xAttributeList);
...@@ -214,6 +218,8 @@ void lcl_TableStyleRRFonts(sax_fastparser::FSHelperPtr pSerializer, uno::Sequenc ...@@ -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()); pAttributeList->add(FSNS(XML_w, XML_eastAsiaTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
else if (rRFonts[i].Name == "asciiTheme") else if (rRFonts[i].Name == "asciiTheme")
pAttributeList->add(FSNS(XML_w, XML_asciiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); 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") else if (rRFonts[i].Name == "hAnsiTheme")
pAttributeList->add(FSNS(XML_w, XML_hAnsiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr()); pAttributeList->add(FSNS(XML_w, XML_hAnsiTheme), OUStringToOString(rRFonts[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
} }
......
...@@ -972,6 +972,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) ...@@ -972,6 +972,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( sStringValue )); m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( sStringValue ));
break; break;
case NS_ooxml::LN_CT_Fonts_cstheme: case NS_ooxml::LN_CT_Fonts_cstheme:
m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "cstheme", ThemeTable::getStringForTheme(nIntValue));
if (m_pImpl->GetTopContext()) if (m_pImpl->GetTopContext())
m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) )); m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
break; break;
...@@ -1444,8 +1445,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) ...@@ -1444,8 +1445,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeColor", TDefTableHandler::getThemeColorTypeString(nIntValue)); m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeColor", TDefTableHandler::getThemeColorTypeString(nIntValue));
break; break;
case NS_ooxml::LN_CT_Color_themeTint: 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: case NS_ooxml::LN_CT_Color_themeShade:
//unsupported m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "themeShade", OUString::number(nIntValue, 16));
break; break;
case NS_ooxml::LN_CT_DocGrid_linePitch: case NS_ooxml::LN_CT_DocGrid_linePitch:
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment