summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-07 12:00:58 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-07 14:21:55 +0100
commit14641f650e548ad3341809a22deb46f5ec93fa24 (patch)
treedafd7c138e152815fa44ba9caeba96d1a01e9611 /sw
parentc367a7e3cab3753eba3e0647cc4f013d882c521f (diff)
DOCX filter: roundtrip paragraph customStyle
Change-Id: I7fec154ff3b39845e91301b4fb607381e80e13f7
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
2 files changed, 7 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 0714c16a5c08..432aae158d0c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1308,6 +1308,8 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx")
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link", "val", "Heading1Char");
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:locked", 1);
+
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading11']", "customStyle", "1");
}
DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8721dbffb34d..15bcff116261 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3593,7 +3593,7 @@ oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML()
void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate )
{
- bool bQFormat = false, bUnhideWhenUsed = false, bLocked = false, bDefault = false;
+ bool bQFormat = false, bUnhideWhenUsed = false, bLocked = false, bDefault = false, bCustomStyle = false;
OUString aLink, aRsid, aUiPriority;
FastAttributeList* pStyleAttributeList = m_pSerializer->createAttrList();
if (eType == STYLE_TYPE_PARA)
@@ -3619,6 +3619,8 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
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);
}
@@ -3635,6 +3637,8 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
pStyleAttributeList->add(FSNS( XML_w, XML_styleId ), m_rExport.pStyles->GetStyleId(nId).getStr());
if (bDefault)
pStyleAttributeList->add(FSNS(XML_w, XML_default), "1");
+ if (bCustomStyle)
+ pStyleAttributeList->add(FSNS(XML_w, XML_customStyle), "1");
XFastAttributeListRef xStyleAttributeList(pStyleAttributeList);
m_pSerializer->startElementNS( XML_w, XML_style, xStyleAttributeList);