summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogeshBharate <yogesh.bharate@synerzip.com>2013-11-08 19:40:34 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-14 14:22:05 +0100
commite658db0163fed882f41a7f556f505c672a2560bb (patch)
tree52d2fe6dfdbb2ea16de56fd6db6bce4bc0b7ca75
parentd360febd39b554c92136f9d08d400400e1caf933 (diff)
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
-rw-r--r--sw/qa/extras/ooxmlexport/data/hyperlink.docxbin0 -> 12564 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx1
3 files changed, 10 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/hyperlink.docx
Binary files 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 <w:t>blah</w:t>'s by line breaks etc.