diff options
author | Justin Luth <justin_luth@sil.org> | 2016-11-26 12:30:03 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2016-11-26 10:38:19 +0000 |
commit | 7b250d56981f78e77454a2a3fd670731b2358e75 (patch) | |
tree | f3c6b238bfd3eef44ccf6707bc968c838e2148e5 | |
parent | b0c3665b2a74256e8dca9743073c668df30839b4 (diff) |
tdf#103975 docx import: don't remove sectPr with BreakItem
If an empty sectPr paragraph contains Page/Column break
information, do not discard it.
Change-Id: If817debccb924eb9cf0ffdc374c960d25908370f
Reviewed-on: https://gerrit.libreoffice.org/31227
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/rhbz988516.docx (renamed from sw/qa/extras/ooxmlimport/data/rhbz988516.docx) | bin | 15513 -> 15513 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 1 |
4 files changed, 14 insertions, 12 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/rhbz988516.docx b/sw/qa/extras/ooxmlexport/data/rhbz988516.docx Binary files differindex 38e2dcff3240..38e2dcff3240 100644 --- a/sw/qa/extras/ooxmlimport/data/rhbz988516.docx +++ b/sw/qa/extras/ooxmlexport/data/rhbz988516.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 2182cbc1daab..8d117e675738 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -61,6 +61,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPad CPPUNIT_ASSERT_EQUAL( 3, getPages() ); } +DECLARE_OOXMLEXPORT_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(3)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(2), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(3), "NumberingStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(4), "NumberingStyleName")); + + // tdf#103975 The problem was that an empty paragraph with page break info was removed. + CPPUNIT_ASSERT_EQUAL( 3, getPages() ); +} + DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 1e9a5e62b34d..05a490497af2 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -175,18 +175,6 @@ DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") CPPUNIT_ASSERT(bFoundGet); } -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(testN751077, "n751077.docx") { /* diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 18c991b7ac52..26168b8c191f 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3267,6 +3267,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) // no runs, we should not create a paragraph for it in Writer, unless that would remove the whole section. bool bRemove = !m_pImpl->GetParaChanged() && m_pImpl->GetParaSectpr() && !bSingleParagraph + && !( pContext && pContext->isSet(PROP_BREAK_TYPE) ) && !m_pImpl->GetIsDummyParaAddedForTableInSection() && !m_pImpl->GetIsLastParagraphFramed(); PropertyMapPtr xContext = bRemove ? m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) : PropertyMapPtr(); |