[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Mon May 25 04:35:08 PDT 2015


 sw/qa/extras/ooxmlexport/data/hyperlink-field.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx         |    8 ++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx      |   10 +++++-----
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit d40c30e4e42e7c020486644a1340966f59241cbb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 25 11:06:46 2015 +0100

    fix assert on export of ooo40760-1.sxw to docx
    
    and a pile more
    
    Change-Id: I7334233c789bb0ed7a60387ef7d84dd34ab5a187
    (cherry picked from commit 3185b6c8caf97afa602c864f588d079cbbe04038)

diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt
new file mode 100644
index 0000000..0c265cf
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 47589f6..f97d6a3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -270,6 +270,14 @@ DECLARE_OOXMLEXPORT_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt")
        return;
 }
 
+DECLARE_OOXMLEXPORT_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+
+    if (!pXmlDoc)
+       return;
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTablePreferredWidth, "tablePreferredWidth.docx")
 {
     xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7ee225c..6b10ae4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1058,11 +1058,6 @@ void DocxAttributeOutput::EndRun()
         {
             StartField_Impl( *pIt );
 
-            if ( m_pHyperlinkAttrList )
-            {
-                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 ) )
@@ -1070,6 +1065,11 @@ void DocxAttributeOutput::EndRun()
                 pIt = m_Fields.erase( pIt );
                 continue;
             }
+
+            if ( m_pHyperlinkAttrList )
+            {
+                m_nFieldsInHyperlink++;
+            }
         }
         ++pIt;
     }


More information about the Libreoffice-commits mailing list