From e658db0163fed882f41a7f556f505c672a2560bb Mon Sep 17 00:00:00 2001 From: YogeshBharate Date: Fri, 8 Nov 2013 19:40:34 +0530 Subject: Fixed missing hyperlink end tag Problem Description : The 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 --- sw/qa/extras/ooxmlexport/data/hyperlink.docx | Bin 0 -> 12564 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 ++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlexport/data/hyperlink.docx diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink.docx b/sw/qa/extras/ooxmlexport/data/hyperlink.docx new file mode 100644 index 000000000000..5f5289790cb0 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 24d242b7c0e1..12abe5bf4a59 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 2760f15826ca..881d9de7bde1 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 blah's by line breaks etc. -- cgit