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>
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 b9432a3..9e637fb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -128,6 +128,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks)
    assertXPath(pXmlDoc, "//w:br", 2);
}

DECLARE_OOXMLEXPORT_TEST(testTdf104394_lostTextbox, "tdf104394_lostTextbox.docx")
{
    // This was only one page b/c the textbox was missing.
    CPPUNIT_ASSERT_EQUAL(2, getPages());
}

DECLARE_OOXMLEXPORT_TEST(testTdf153613_anchoredAfterPgBreak, "tdf153613_anchoredAfterPgBreak.docx")
{
    const auto& pLayout = parseLayoutDump();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b7e94ff50e..c526968 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3173,7 +3173,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();
        }