From 9a156365277c93bd66c2ef21c42bfa377eaf314b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 5 Mar 2014 23:29:06 +0100 Subject: [PATCH 2/2] 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 (cherry picked from commit 2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2) Reviewed-on: https://gerrit.libreoffice.org/8477 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- sw/qa/extras/ooxmlimport/data/rhbz988516.docx | Bin 0 -> 15513 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 ++++++++++++ writerfilter/source/ooxml/model.xml | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlimport/data/rhbz988516.docx diff --git a/sw/qa/extras/ooxmlimport/data/rhbz988516.docx b/sw/qa/extras/ooxmlimport/data/rhbz988516.docx new file mode 100644 index 0000000000000000000000000000000000000000..38e2dcff324036a333060f10475fa60a6c872074 GIT binary patch literal 15513 zcmeIZ1$SIYvMnrTW@ZM9EwU|UX0(`@S+bZ}vMgq1W@ct)wwM`Tx!=rmx2M1N{eXMV zT2<@RI=SOSMnz=q%!rhg00lz>f&hX70sumx(rk6EoSBKe<#Um<{0_y|%4kxX9_wfXujK8kJWVvdvB{x3GzZLG1hUI}KSuFvEYfmD15B^ryX9v*4v0NJXQt4AO1_Crkg-5yR&;3pQO3{HeoF>t67MP~!HhlFvT7 zm4^b}zU7rrlnWcTG$_gVGumLs2H%(Z>qZ5Fy2`-5oq{G8@-Jq&5Qaow)1vQja}EMT z9+jY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_WbIc# z&F=qoF<=mSKnVWx`NdzO-(RnPIL#<4@pl1#KOps2@FswD{pGmS@4&yG8u=>_44~`( z>kP^7l727w|5H{BAc6N^2LOJD|6bPoC;S9(hTsqQUy7W6NB>@+`X^ckkR1F2{g-mp z-_gHUIR1(L3aASC1O0owA8>H|bs JJIAkI{|EA+bCm!9 literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index dca64b7..4c8a790 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -189,6 +189,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(getParagraph(1), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString("Enclosure 3"), getParagraph(2)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString(), + getProperty(getParagraph(2), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString(), + getProperty(getParagraph(3), "NumberingStyleName")); +} + DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx") { uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index a049fde..6018582 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -22557,7 +22557,9 @@ - + + + -- 1.8.3.1