diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/ooo34469-1.odt | bin | 0 -> 16812 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 8 |
3 files changed, 12 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt b/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt Binary files differnew file mode 100644 index 000000000000..7cf031fb2fcd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo34469-1.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 9121588c9d3f..5e1893708acd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -671,6 +671,12 @@ DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, "fixed-date-field.docx") } } +DECLARE_OOXMLEXPORT_TEST(testOO34469, "ooo34469-1.odt") +{ + if (xmlDocPtr pXmlDoc = parseExport()) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating New files|outline"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 16068b00f912..25eec02846e8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1051,7 +1051,7 @@ void DocxAttributeOutput::EndRun() } // Write field starts - for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); ) + for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin() + nFieldsInPrevHyperlink; pIt != m_Fields.end(); ) { // Add the fields starts for all but hyperlinks and TOCs if ( pIt->bOpen && pIt->pField ) @@ -1265,6 +1265,7 @@ void DocxAttributeOutput::EndRun() EndField_Impl( m_Fields.back( ) ); m_Fields.pop_back(); } + m_nFieldsInHyperlink = 0; m_pSerializer->endElementNS( XML_w, XML_hyperlink ); m_startedHyperlink = false; @@ -1273,12 +1274,15 @@ void DocxAttributeOutput::EndRun() m_closeHyperlinkInThisRun = false; } - if(!m_startedHyperlink) + if (!m_startedHyperlink) + { while ( m_Fields.begin() != m_Fields.end() ) { EndField_Impl( m_Fields.front( ) ); m_Fields.erase( m_Fields.begin( ) ); } + m_nFieldsInHyperlink = 0; + } } void DocxAttributeOutput::DoWriteBookmarks() |