diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-08 13:46:33 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-08 14:23:12 +0100 |
commit | 961e319da7e8aa16b64ceee421e896802cbb82c1 (patch) | |
tree | 752a57ec8c67fa1283ac4221e8f9dec5c655c49c /sw | |
parent | d632598049b473a6e06dde853b54cf5206604a9e (diff) |
DOCX filter: handle numbering style's qFormat, rsid and friends
Change-Id: Ia261995b98e2108ab673c7b240a1aa822d3db96e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 57 |
2 files changed, 34 insertions, 26 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c6af87de21e7..ecbabb45e5ac 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1314,6 +1314,9 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx") // Additional char style properties should be also roundtripped. assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='DefaultParagraphFont']", "default", "1"); + + // Finally check the same for numbering styles. + assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NoList']", "default", "1"); } DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx") diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index eaae87870579..2ff5e613b2a9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3596,36 +3596,41 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, bool bQFormat = false, bUnhideWhenUsed = false, bSemiHidden = false, bLocked = false, bDefault = false, bCustomStyle = false; OUString aLink, aRsid, aUiPriority; FastAttributeList* pStyleAttributeList = m_pSerializer->createAttrList(); + uno::Any aAny; if (eType == STYLE_TYPE_PARA || eType == STYLE_TYPE_CHAR) { const SwFmt* pFmt = m_rExport.pStyles->GetSwFmt(nId); - uno::Any aAny; pFmt->GetGrabBagItem(aAny); - const uno::Sequence<beans::PropertyValue>& rGrabBag = aAny.get< uno::Sequence<beans::PropertyValue> >(); - - for (sal_Int32 i = 0; i < rGrabBag.getLength(); ++i) - { - if (rGrabBag[i].Name == "uiPriority") - aUiPriority = rGrabBag[i].Value.get<OUString>(); - else if (rGrabBag[i].Name == "qFormat") - bQFormat = true; - else if (rGrabBag[i].Name == "link") - aLink = rGrabBag[i].Value.get<OUString>(); - else if (rGrabBag[i].Name == "rsid") - aRsid = rGrabBag[i].Value.get<OUString>(); - else if (rGrabBag[i].Name == "unhideWhenUsed") - bUnhideWhenUsed = true; - else if (rGrabBag[i].Name == "semiHidden") - bSemiHidden = true; - else if (rGrabBag[i].Name == "locked") - bLocked = true; - else if (rGrabBag[i].Name == "default") - bDefault = rGrabBag[i].Value.get<sal_Bool>(); - else if (rGrabBag[i].Name == "customStyle") - bCustomStyle = rGrabBag[i].Value.get<sal_Bool>(); - else - SAL_WARN("sw.ww8", "Unhandled style property: " << rGrabBag[i].Name); - } + } + else + { + const SwNumRule* pRule = m_rExport.pStyles->GetSwNumRule(nId); + pRule->GetGrabBagItem(aAny); + } + const uno::Sequence<beans::PropertyValue>& rGrabBag = aAny.get< uno::Sequence<beans::PropertyValue> >(); + + for (sal_Int32 i = 0; i < rGrabBag.getLength(); ++i) + { + if (rGrabBag[i].Name == "uiPriority") + aUiPriority = rGrabBag[i].Value.get<OUString>(); + else if (rGrabBag[i].Name == "qFormat") + bQFormat = true; + else if (rGrabBag[i].Name == "link") + aLink = rGrabBag[i].Value.get<OUString>(); + else if (rGrabBag[i].Name == "rsid") + aRsid = rGrabBag[i].Value.get<OUString>(); + else if (rGrabBag[i].Name == "unhideWhenUsed") + bUnhideWhenUsed = true; + else if (rGrabBag[i].Name == "semiHidden") + bSemiHidden = true; + else if (rGrabBag[i].Name == "locked") + bLocked = true; + else if (rGrabBag[i].Name == "default") + bDefault = rGrabBag[i].Value.get<sal_Bool>(); + else if (rGrabBag[i].Name == "customStyle") + bCustomStyle = rGrabBag[i].Value.get<sal_Bool>(); + else + SAL_WARN("sw.ww8", "Unhandled style property: " << rGrabBag[i].Name); } const char* pType = 0; |