diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/zoom.docx | bin | 3795 -> 10825 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 14 |
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 Binary files differindex 6c2cd469decb..a61069f48c04 100644 --- a/sw/qa/extras/ooxmlexport/data/zoom.docx +++ b/sw/qa/extras/ooxmlexport/data/zoom.docx 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 ); } |