[Libreoffice-commits] core.git: sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Wed Jun 3 07:50:50 PDT 2015


 sw/qa/extras/ooxmlexport/data/ooo39845-7.odt  |binary
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |    7 +++++++
 sw/source/filter/ww8/docxattributeoutput.cxx  |    6 +++---
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 77df4faa4783df38383020a6236136a88eb51069
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 3 15:20:13 2015 +0100

    fix crash on export of ooo39845-7.sxw to .docx
    
    only bump m_nFieldsInHyperlink if the field isn't erased
    from the stack
    
    Change-Id: Idb75d087f6fa3ce3cd399623d8ace1e7f3899b5c

diff --git a/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt
new file mode 100644
index 0000000..ee8d139
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/ooo39845-7.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 5e18937..f702fa9 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 25eec02..aecd1d1 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++;


More information about the Libreoffice-commits mailing list