summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-06 17:05:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-11-08 10:28:04 -0600
commit267addb68a7665e71d3f263030c05466d746cbc8 (patch)
tree55030e5874a8a29ba422d5ce577b759501002ee8
parent3fff431f152f23180e2ce58e7d1dc6b6b45ab332 (diff)
cp#1000015 DOCX export: fix not-well-formed XML on redline end + hyperlink
(cherry picked from commit 7813bd3113beb2b2860f9eb213c5c67ef54f5bf0) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Change-Id: I3a87a0277952ba0a422df8988151f8b14e166e06 Reviewed-on: https://gerrit.libreoffice.org/6606 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/cp1000015.odtbin0 -> 8044 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
3 files changed, 12 insertions, 3 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/cp1000015.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fd1c30aea46b..798336000437 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -75,6 +75,7 @@ public:
void testFdo58577();
void testFdo60990();
void testBnc834035();
+ void testCp1000015();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -134,6 +135,7 @@ void Test::run()
{"fdo58577.odt", &Test::testFdo58577},
{"fdo60990.odt", &Test::testFdo60990},
{"bnc834035.odt", &Test::testBnc834035},
+ {"cp1000015.odt", &Test::testCp1000015},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -772,6 +774,13 @@ void Test::testBnc834035()
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink", "anchor", "_Toc363553908");
}
+void Test::testCp1000015()
+{
+ // Redline and hyperlink end got exported in an incorrect order.
+ getParagraph(1, "Hello.");
+ getParagraph(2, "http://www.google.com/");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d7c008fac99a..15e2c558f519 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -648,6 +648,9 @@ void DocxAttributeOutput::EndRun()
WritePostponedMath();
WritePendingPlaceholder();
+ // if there is some redlining in the document, output it
+ EndRedline();
+
if ( m_closeHyperlinkInThisRun )
{
if ( m_startedHyperlink )
@@ -665,9 +668,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()