diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/ooo39845-7.odt | bin | 0 -> 14361 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 |
3 files changed, 10 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt Binary files differnew file mode 100644 index 000000000000..ee8d139359b4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 5e1893708acd..f702fa9cfc2e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -677,6 +677,13 @@ DECLARE_OOXMLEXPORT_TEST(testOO34469, "ooo34469-1.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "2.9.2.Creating New files|outline"); } +DECLARE_OOXMLEXPORT_TEST(testOO39845, "ooo39845-7.odt") +{ + if (xmlDocPtr pXmlDoc = parseExport()) + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink[1]", "anchor", "Figure4|graphic"); +} + + 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 25eec02846e8..aecd1d1adac7 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1058,9 +1058,6 @@ void DocxAttributeOutput::EndRun() { StartField_Impl( *pIt ); - if (m_startedHyperlink) - ++m_nFieldsInHyperlink; - // Remove the field from the stack if only the start has to be written // Unknown fields should be removed too if ( !pIt->bClose || ( pIt->eType == ww::eUNKNOWN ) ) @@ -1069,6 +1066,9 @@ void DocxAttributeOutput::EndRun() continue; } + if (m_startedHyperlink) + ++m_nFieldsInHyperlink; + if ( m_pHyperlinkAttrList ) { m_nFieldsInHyperlink++; |