[Libreoffice-commits] core.git: sw/qa writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 29 18:26:20 UTC 2018


 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 6aeba04b31cc33135f84bd7ea38a04ee9faa14ec
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Sat Dec 29 18:50:18 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Sat Dec 29 19:25:58 2018 +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_luth at sil.org>

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 66599999f9a4..4b0d7bd8d1d7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -462,6 +462,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 aa3588cde860..5affdd4d5703 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2882,6 +2882,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 89deb65f1b56..c20912dabdd5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -604,8 +604,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);


More information about the Libreoffice-commits mailing list