tdf#104394 writerfilter: no addDummyParaForTable when PrevFramed
The dummy paragraph is only supposed to be added when the table
starts the section. In this case, a framed paragraph was
the first item in the section.
Since it ends up being a floating item, it is probably not
correct to turn off GetIsFirstParagraphInSection.
In any case, this is a much more targetted fix,
and thus much less likely to lead to regressions.
Change-Id: I7fb2c6189ddbff5d46828b27d68667c9d4a31122
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148656
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148670
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf104394_lostTextbox.docx b/sw/qa/extras/ooxmlexport/data/tdf104394_lostTextbox.docx
new file mode 100644
index 0000000..472d072
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf104394_lostTextbox.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index ce1aec0..1d2c371 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -87,6 +87,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153526_commentInNumbering, "tdf153526_commentInN
CPPUNIT_ASSERT_EQUAL(13, getParagraphs());
}
DECLARE_OOXMLEXPORT_TEST(testTdf104394_lostTextbox, "tdf104394_lostTextbox.docx")
{
// This was only one page b/c the textbox was missing.
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert)
{
// Given a docx document with a shape with vert="mongolianVert".
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index ae4a82c..3565b13 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3044,7 +3044,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
*/
if(m_pImpl->m_nTableDepth == 0 && m_pImpl->GetIsFirstParagraphInSection()
&& !m_pImpl->GetIsDummyParaAddedForTableInSection() && !m_pImpl->GetIsTextFrameInserted()
&& !IsInHeaderFooter())
&& !m_pImpl->GetIsPreviousParagraphFramed() && !IsInHeaderFooter())
{
m_pImpl->AddDummyParaForTableInSection();
}