Kaydet (Commit) 7b250d56 authored tarafından Justin Luth's avatar Justin Luth

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/31227Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
üst b0c3665b
...@@ -61,6 +61,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPad ...@@ -61,6 +61,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPad
CPPUNIT_ASSERT_EQUAL( 3, getPages() ); 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") DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx")
{ {
xmlDocPtr pXmlDoc = parseExport("word/document.xml"); xmlDocPtr pXmlDoc = parseExport("word/document.xml");
......
...@@ -175,18 +175,6 @@ DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx") ...@@ -175,18 +175,6 @@ DECLARE_OOXMLIMPORT_TEST(testN751017, "n751017.docx")
CPPUNIT_ASSERT(bFoundGet); 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") DECLARE_OOXMLIMPORT_TEST(testN751077, "n751077.docx")
{ {
/* /*
......
...@@ -3267,6 +3267,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) ...@@ -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. // 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() bool bRemove = !m_pImpl->GetParaChanged() && m_pImpl->GetParaSectpr()
&& !bSingleParagraph && !bSingleParagraph
&& !( pContext && pContext->isSet(PROP_BREAK_TYPE) )
&& !m_pImpl->GetIsDummyParaAddedForTableInSection() && !m_pImpl->GetIsDummyParaAddedForTableInSection()
&& !m_pImpl->GetIsLastParagraphFramed(); && !m_pImpl->GetIsLastParagraphFramed();
PropertyMapPtr xContext = bRemove ? m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) : PropertyMapPtr(); PropertyMapPtr xContext = bRemove ? m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) : PropertyMapPtr();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment