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

YogeshBharate yogesh.bharate at synerzip.com
Thu Nov 14 05:22:29 PST 2013


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

New commits:
commit e658db0163fed882f41a7f556f505c672a2560bb
Author: YogeshBharate <yogesh.bharate at synerzip.com>
Date:   Fri Nov 8 19:40:34 2013 +0530

    Fixed missing hyperlink end tag
    
    Problem Description :
    The <w:hyperlink> tag is not terminated properly due to that the file get corrupted.
    Also unit test is added for export.
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    Revewied on:
    	https://gerrit.libreoffice.org/6619
    
    Change-Id: I2480ab624ab572e411bd1511030c0da1b7f5d183

diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink.docx b/sw/qa/extras/ooxmlexport/data/hyperlink.docx
new file mode 100644
index 0000000..5f52897
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/hyperlink.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 24d242b..12abe5b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1718,6 +1718,16 @@ DECLARE_OOXML_TEST(testLineSpacingexport, "test_line_spacing.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "line", "31680");
 }
 
+DECLARE_OOXML_TEST(testHyperlineIsEnd, "hyperlink.docx")
+{
+    // Check  that the document.xml contents all the tag properly closed.
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    // If  document.xml miss any ending tag then parseExport() returns NULL which fail the test case.
+    CPPUNIT_ASSERT(pXmlDoc) ;
+    // Check hyperlink is properly open.
+    assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink",1);
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2760f15..881d9de 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1232,7 +1232,6 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh
     if( m_closeHyperlinkInThisRun )
     {
         m_closeHyperlinkInPreviousRun = true;
-        m_closeHyperlinkInThisRun = false;
     }
 
     // one text can be split into more <w:t>blah</w:t>'s by line breaks etc.


More information about the Libreoffice-commits mailing list