sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx                |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx              |    1 +
 writerfilter/source/dmapper/DomainMapper_Impl.hxx         |    3 +++
 4 files changed, 15 insertions(+)

New commits:
commit b761504aa81ac8e2f61ba87899a965de19dc35cc
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Sat Dec 29 18:50:18 2018 +0300
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Jan 28 15:03:06 2019 +0100

    tdf#120511 writerfilter: track inserted frame per section
    
    The logic using IsTextFrameInserted is worried about whether
    a frame has been inserted before a table *in this section*,
    so track frame's existence per section, not per document.
    
    Change-Id: I8aa8a695b89727832e65535adae3fc3c94f95be5
    Reviewed-on: https://gerrit.libreoffice.org/65720
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_l...@sil.org>
    (cherry picked from commit 6aeba04b31cc33135f84bd7ea38a04ee9faa14ec)
    Reviewed-on: https://gerrit.libreoffice.org/65722

diff --git a/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx 
b/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx
new file mode 100644
index 000000000000..6a6d6f17bae7
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf120511_eatenSection.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index c9e569cece74..d9dd00a69fbd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -488,6 +488,17 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeA
                          getProperty<sal_Int32>(xShape->getStart(), 
"ParaTopMargin"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, 
"tdf120511_eatenSection.docx")
+{
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", 
"height").toInt32();
+    sal_Int32 nWidth  = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", 
"width").toInt32();
+    CPPUNIT_ASSERT_MESSAGE( "Page1 is portrait", nWidth < nHeight );
+    nHeight = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", 
"height").toInt32();
+    nWidth  = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", 
"width").toInt32();
+    CPPUNIT_ASSERT_MESSAGE( "Page2 is landscape", nWidth > nHeight );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf104354, "tdf104354.docx")
 {
     uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 5e9bed49044a..a44771dbd8ab 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2883,6 +2883,7 @@ void DomainMapper::lcl_endSectionGroup()
             if (m_pImpl->GetIsDummyParaAddedForTableInSection())
                 m_pImpl->RemoveDummyParaForTableInSection();
         }
+        m_pImpl->SetIsTextFrameInserted( false );
         m_pImpl->PopProperties(CONTEXT_SECTION);
     }
 }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 02f029a4732c..6006d2465f13 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -605,8 +605,11 @@ public:
     bool GetIsFirstParagraphInShape() { return m_bIsFirstParaInShape; }
     void SetIsDummyParaAddedForTableInSection( bool bIsAdded );
     bool GetIsDummyParaAddedForTableInSection() { return 
m_bDummyParaAddedForTableInSection;}
+
+    /// Track if a textframe has been inserted into this section
     void SetIsTextFrameInserted( bool bIsInserted );
     bool GetIsTextFrameInserted() { return m_bTextFrameInserted;}
+
     void SetIsPreviousParagraphFramed( bool bIsFramed ) { 
m_bIsPreviousParagraphFramed = bIsFramed; }
     bool GetIsPreviousParagraphFramed() { return m_bIsPreviousParagraphFramed; 
}
     void SetParaSectpr(bool bParaSectpr);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to