From 7813bd3113beb2b2860f9eb213c5c67ef54f5bf0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 6 Nov 2013 17:05:03 +0100 Subject: cp#1000015 DOCX export: fix not-well-formed XML on redline end + hyperlink Change-Id: I3a87a0277952ba0a422df8988151f8b14e166e06 --- sw/qa/extras/ooxmlexport/data/cp1000015.odt | Bin 0 -> 8044 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 +++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/cp1000015.odt (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/cp1000015.odt b/sw/qa/extras/ooxmlexport/data/cp1000015.odt new file mode 100644 index 000000000000..7d8dc9f10712 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/cp1000015.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 1355f51fb710..d137de545f12 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1548,6 +1548,13 @@ DECLARE_OOXML_TEST(testFdo69644, "fdo69644.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5); } +DECLARE_OOXML_TEST(testCp1000015, "cp1000015.odt") +{ + // Redline and hyperlink end got exported in an incorrect order. + getParagraph(1, "Hello."); + getParagraph(2, "http://www.google.com/"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8f5859fee635..bd49937610ed 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -712,6 +712,9 @@ void DocxAttributeOutput::EndRun() WritePostponedMath(); WritePendingPlaceholder(); + // if there is some redlining in the document, output it + EndRedline(); + if ( m_closeHyperlinkInThisRun ) { if ( m_startedHyperlink ) @@ -729,9 +732,6 @@ void DocxAttributeOutput::EndRun() delete m_Fields.front().pField; m_Fields.erase( m_Fields.begin( ) ); } - - // if there is some redlining in the document, output it - EndRedline(); } void DocxAttributeOutput::WriteCommentRanges() -- cgit