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

Dinesh Patil dinesh.patil at synerzip.com
Thu May 22 00:46:18 PDT 2014


 sw/qa/extras/ooxmlexport/data/fdo78886.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx     |    9 +++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx |    1 +
 3 files changed, 10 insertions(+)

New commits:
commit c5547beb47e6eb94cf917a319fcc426a36fed7af
Author: Dinesh Patil <dinesh.patil at synerzip.com>
Date:   Tue May 20 15:29:27 2014 +0530

    fdo#78886 File getting corrupted after Roundtrip due to fieldChar
    
    In a hyperlink, extra field with fldCharType="end" is getting added
    even though there is no begin and separate fldCharType. When hyperlink is
    closing pageref was not set to false. Due to which LO was adding extra
    end fldCharType.
    
    Change-Id: I0f54ab03c38cec2888cf9a1638ec5435da90099c
    Reviewed-on: https://gerrit.libreoffice.org/9414
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/fdo78886.docx b/sw/qa/extras/ooxmlexport/data/fdo78886.docx
new file mode 100644
index 0000000..e364948
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78886.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 16d13a2..a039e0b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3437,6 +3437,15 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78300,"fdo78300.docx")
                 0);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo78886, "fdo78886.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+
+    assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:tc[1]/w:p[1]/w:hyperlink[1]/w:r[2]/w:fldChar[1]", 0);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFdo78651, "fdo78651.docx")
 {
     xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index fb5933d..aafb31c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -802,6 +802,7 @@ void DocxAttributeOutput::EndRun()
             }
             m_pSerializer->endElementNS( XML_w, XML_hyperlink );
             m_startedHyperlink = false;
+            m_endPageRef = false;
             m_nHyperLinkCount--;
         }
         m_closeHyperlinkInPreviousRun = false;


More information about the Libreoffice-commits mailing list