diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-04 11:16:36 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-04 12:42:45 +0100 |
commit | 832586588c3ed5f1686a4ecebc2ed198ce049b24 (patch) | |
tree | b6095280069772918fb60f193b89f0a06b11a624 /sw | |
parent | 2bb5f4773cc73a13bcd1460c02bc33bb4e60225c (diff) |
DOCX filter: more run properties table style roundtrip work
Implement roundtrip of smallCaps, spacing, caps and color's themeColor
attribute.
Change-Id: I1ac88de030356a5ce08a28ac16cd159a426d2be9
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/calendar2.docx | bin | 9178 -> 12180 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxtablestyleexport.cxx | 16 |
3 files changed, 19 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/calendar2.docx b/sw/qa/extras/ooxmlexport/data/calendar2.docx Binary files differindex e89222f895bc..4e7d4ed3c072 100644 --- a/sw/qa/extras/ooxmlexport/data/calendar2.docx +++ b/sw/qa/extras/ooxmlexport/data/calendar2.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index b4ecd7d7b18e..c7498d432d41 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1332,6 +1332,10 @@ DECLARE_OOXML_TEST(testCalendar2, "calendar2.docx") // These run properties were missing assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "val", "en-US"); assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:rPr/w:lang", "bidi", "ar-SA"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:caps", 1); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:smallCaps", "val", "0"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeColor", "accent1"); + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:spacing", "val", "20"); // Table borders were also missing assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99"); diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index cc92461373a9..f909876d6880 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -174,6 +174,8 @@ void lcl_TableStyleRColor(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence { if (rColor[i].Name == "val") 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()); } sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList); pSerializer->singleElementNS(XML_w, XML_color, xAttributeList); @@ -285,7 +287,7 @@ void lcl_TableStyleRPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be pSerializer->startElementNS(XML_w, XML_rPr, FSEND); uno::Sequence<beans::PropertyValue> aRFonts, aLang, aColor; - OUString aB, aI, aSz, aSzCs; + OUString aB, aI, aSz, aSzCs, aCaps, aSmallCaps, aSpacing; for (sal_Int32 i = 0; i < rRPr.getLength(); ++i) { if (rRPr[i].Name == "rFonts") @@ -302,12 +304,24 @@ void lcl_TableStyleRPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be aSz = rRPr[i].Value.get<OUString>(); else if (rRPr[i].Name == "szCs") aSzCs = rRPr[i].Value.get<OUString>(); + else if (rRPr[i].Name == "caps") + aCaps = rRPr[i].Value.get<OUString>(); + else if (rRPr[i].Name == "smallCaps") + aSmallCaps = rRPr[i].Value.get<OUString>(); + else if (rRPr[i].Name == "spacing") + aSpacing = rRPr[i].Value.get<OUString>(); } lcl_TableStyleRRFonts(pSerializer, aRFonts); lcl_TableStyleRLang(pSerializer, aLang); lcl_handleBoolean(aB, XML_b, pSerializer); lcl_handleBoolean(aI, XML_i, pSerializer); + lcl_handleBoolean(aCaps, XML_caps, pSerializer); + lcl_handleBoolean(aSmallCaps, XML_smallCaps, pSerializer); lcl_TableStyleRColor(pSerializer, aColor); + if (!aSpacing.isEmpty()) + pSerializer->singleElementNS(XML_w, XML_spacing, + FSNS(XML_w, XML_val), OUStringToOString(aSpacing, RTL_TEXTENCODING_UTF8).getStr(), + FSEND); if (!aSz.isEmpty()) pSerializer->singleElementNS(XML_w, XML_sz, FSNS(XML_w, XML_val), OUStringToOString(aSz, RTL_TEXTENCODING_UTF8).getStr(), |