summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-27 15:51:55 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-27 16:22:25 +0100
commit150420cbff39967e9376cab05b6af45b642edae8 (patch)
treefdb97975fb696f12c1150802c350564b8d42511c /sw
parenta4bdeebac28852e382331439017dae85b3881a95 (diff)
DOCX export: fix style's next element order
Change-Id: I03e91a448794efc2b91f3a6fb6c29dda3403ce9b
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/zoom.docxbin3795 -> 10825 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx14
3 files changed, 16 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/zoom.docx b/sw/qa/extras/ooxmlexport/data/zoom.docx
index 6c2cd469decb..a61069f48c04 100644
--- a/sw/qa/extras/ooxmlexport/data/zoom.docx
+++ b/sw/qa/extras/ooxmlexport/data/zoom.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 400745ee34f9..b90075d0497e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -94,6 +94,15 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx")
sal_Int16 nValue = 0;
xPropertySet->getPropertyValue("ZoomValue") >>= nValue;
CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue);
+
+ // Validation test: order of elements were wrong.
+ xmlDocPtr pXmlDoc = parseExport("word/styles.xml");
+ if (!pXmlDoc)
+ return;
+ // Order was: rsid, next.
+ int nNext = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "next");
+ int nRsid = getXPathPosition(pXmlDoc, "/w:styles/w:style[3]", "rsid");
+ CPPUNIT_ASSERT(nNext < nRsid);
}
DECLARE_OOXMLEXPORT_TEST(defaultTabStopNotInStyles, "empty.odt")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 09bfa06d7d63..4e48125b5b8d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3977,6 +3977,13 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
FSEND );
}
+ if ( nNext != nId && eType != STYLE_TYPE_LIST)
+ {
+ m_pSerializer->singleElementNS( XML_w, XML_next,
+ FSNS( XML_w, XML_val ), m_rExport.pStyles->GetStyleId(nNext).getStr(),
+ FSEND );
+ }
+
if (!aLink.isEmpty())
m_pSerializer->singleElementNS(XML_w, XML_link,
FSNS(XML_w, XML_val), OUStringToOString(aLink, RTL_TEXTENCODING_UTF8).getStr(),
@@ -3999,13 +4006,6 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType,
FSNS(XML_w, XML_val), OUStringToOString(aRsid, RTL_TEXTENCODING_UTF8).getStr(),
FSEND);
- if ( nNext != nId && eType != STYLE_TYPE_LIST)
- {
- m_pSerializer->singleElementNS( XML_w, XML_next,
- FSNS( XML_w, XML_val ), m_rExport.pStyles->GetStyleId(nNext).getStr(),
- FSEND );
- }
-
if ( bAutoUpdate )
m_pSerializer->singleElementNS( XML_w, XML_autoRedefine, FSEND );
}