summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-07 11:08:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-07 11:30:42 +0100
commitfc46d7f60b5cd8901115769f44b054da8b2a3100 (patch)
tree913a2798eeda86658fb813b371a4eca72f1aa66d /sw
parent0121f632ef72bbdb0167ec8520a9bdf0a275274e (diff)
DOCX filter: roundtrip paragraph style link
Change-Id: Ide29e98b73410d8917742f2eeb15bdcbd9de87cc
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
2 files changed, 11 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d137de545f12..a9e562454ad3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1304,6 +1304,8 @@ DECLARE_OOXML_TEST(testStyleInheritance, "style-inheritance.docx")
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='ListParagraph']/w:uiPriority", "val", "34");
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:qFormat", 1);
assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Normal']/w:rsid", "val", "00780346");
+
+ assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Heading1']/w:link", "val", "Heading1Char");
}
DECLARE_OOXML_TEST(testCalendar1, "calendar1.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index bd49937610ed..2782d4cfde32 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3617,17 +3617,19 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
const uno::Sequence<beans::PropertyValue>& rGrabBag = aAny.get< uno::Sequence<beans::PropertyValue> >();
bool bQFormat = false, bUnhideWhenUsed = false;
- OUString aRsid, aUiPriority;
+ OUString aLink, aRsid, aUiPriority;
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 == "unhideWhenUsed")
+ bUnhideWhenUsed = true;
else
SAL_WARN("sw.ww8", "Unhandled style property: " << rGrabBag[i].Name);
}
@@ -3640,6 +3642,10 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND);
if (bUnhideWhenUsed)
m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND);
+ if (!aLink.isEmpty())
+ m_pSerializer->singleElementNS(XML_w, XML_link,
+ FSNS(XML_w, XML_val), OUStringToOString(aLink, RTL_TEXTENCODING_UTF8).getStr(),
+ FSEND);
if (!aRsid.isEmpty())
m_pSerializer->singleElementNS(XML_w, XML_rsid,
FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(),