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

sushil_shinde sushil.shinde at synerzip.com
Tue May 20 01:16:46 PDT 2014


 sw/qa/extras/ooxmlexport/data/fdo78654.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx     |   11 +++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx |    2 ++
 3 files changed, 13 insertions(+)

New commits:
commit d2a19aad658cc0e8939c16b5137c15727c3cdff9
Author: sushil_shinde <sushil.shinde at synerzip.com>
Date:   Thu May 15 19:22:12 2014 +0530

    fdo#78654 LO was exporting corrupt docx file.
    
       If docx file contains multiple hyperlinks in one paragraph
       and one of the hyperlink contains "PAGEREF" field. End tag
       for "PAGEREF" field was not exported hence it was causing
       corruption in exported file.
       Fixed export part of field end tags in case of "PAGEREF".
       Added unit test.
    
    Change-Id: I18a3625213bf7269e3f441859a27acc38cf6ff45
    Reviewed-on: https://gerrit.libreoffice.org/9364
    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/fdo78654.docx b/sw/qa/extras/ooxmlexport/data/fdo78654.docx
new file mode 100644
index 0000000..81d7bd0
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78654.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 67ccaae..7f3a5b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3370,6 +3370,17 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFDO78654 , "fdo78654.docx")
+{
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+    // In case of two "Hyperlink" tags in one paragraph and one of them
+    // contains "PAGEREF" field then field end tag was missing from hyperlink.
+    assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink[3]/w:r[5]/w:fldChar", "fldCharType", "end" );
+}
+
+
 DECLARE_OOXMLEXPORT_TEST(testfdo78599,"fdo78599.docx")
 {
      xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4c6c7d0..19807f4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -823,6 +823,8 @@ void DocxAttributeOutput::EndRun()
                     FSNS( XML_w, XML_fldCharType ), "separate",
                     FSEND );
             m_pSerializer->endElementNS( XML_w, XML_r );
+            // At start of every "PAGEREF" field m_endPageRef value should be true.
+            m_endPageRef = true;
         }
 
     m_pSerializer->startElementNS( XML_w, XML_r, FSEND );


More information about the Libreoffice-commits mailing list