summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-05 23:29:06 +0100
committerMichael Stahl <mstahl@redhat.com>2014-03-06 00:20:00 +0100
commit2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2 (patch)
tree93a2410bebc185bf729ce5850823518277f2ab8f /sw/qa/extras
parentd3fcaef7dce044b7e053278a7ea972dc957ca7e2 (diff)
rhbz#988516: DOCX import: fix context stack when importing header/footer
When a header/footer substream is parsed, a ParagraphGroup is started, but not ended; so the properties of the last paragraph in the header/footer are applied to a paragraph in the body. The obvious fix to add a call to endParagraphGroup() at the end of w:p element breaks table cells. So add a call to endParagraphGroup() at the end of the "hdr"/"ftr" element. (The problem in the bugdoc became much more visible with commit ca555c596043c88894b964ac5e21f5a7271d5f3b, but was there before) Change-Id: Ib054f1882793049b39424c1076ba5d4b319cd027
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlimport/data/rhbz988516.docxbin0 -> 15513 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/rhbz988516.docx b/sw/qa/extras/ooxmlimport/data/rhbz988516.docx
new file mode 100644
index 000000000000..38e2dcff3240
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/rhbz988516.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 239289906fd6..4f384d8ea13b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -198,6 +198,18 @@ DECLARE_OOXMLIMPORT_TEST(testN757890, "n757890.docx")
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue);
}
+DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx")
+{
+ // The problem was that the list properties of the footer leaked into body
+ CPPUNIT_ASSERT_EQUAL(OUString(),
+ getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Enclosure 3"), getParagraph(2)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString(),
+ getProperty<OUString>(getParagraph(2), "NumberingStyleName"));
+ CPPUNIT_ASSERT_EQUAL(OUString(),
+ getProperty<OUString>(getParagraph(3), "NumberingStyleName"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx")
{
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);