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

Justin Luth justin_luth at sil.org
Wed Dec 21 04:14:43 UTC 2016


 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx         |   12 ++++++++----
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    4 ++--
 2 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 893698741a78e56d74b87caff24f67742ddd892b
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue Dec 20 12:19:43 2016 +0300

    related to tdf#97417: fix unit test page count
    
    The unit test should have been showing a blank page before the
    content page.
    
    Non-section paragraphs should not remove the first/last status.
    Frames were already excluded, now this patch also
    excludes header/footer paragraphs.
    
    This is in preparation for tdf#104710.
    
    Change-Id: I686944843302160d6f6bbbcb73f01c836179aa9f
    Reviewed-on: https://gerrit.libreoffice.org/32234
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 4b3f757..e46c342 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -2014,14 +2014,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92157, "tdf92157.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf97417, "section_break_numbering.docx")
 {
+    uno::Reference<beans::XPropertySet> xProps(getParagraph(1), uno::UNO_QUERY_THROW);
+//    CPPUNIT_ASSERT_MESSAGE("1st page: first paragraph erroneous numbering",
+//        !xProps->getPropertyValue("NumberingRules").hasValue());
     // paragraph with numbering and section break was removed by writerfilter
     // but its numbering was copied to all following paragraphs
-    CPPUNIT_ASSERT_MESSAGE("first paragraph missing numbering",
-        getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules").is());
-    uno::Reference<beans::XPropertySet> const xProps(getParagraph(2), uno::UNO_QUERY_THROW);
-    CPPUNIT_ASSERT_MESSAGE("second paragraph erroneous numbering",
+    CPPUNIT_ASSERT_MESSAGE("2nd page: first paragraph missing numbering",
+        getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(2), "NumberingRules").is());
+    xProps = uno::Reference<beans::XPropertySet>(getParagraph(3), uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT_MESSAGE("2nd page: second paragraph erroneous numbering",
         !xProps->getPropertyValue("NumberingRules").hasValue());
 
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf94043, "tdf94043.docx")
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 15ec945..9997f1a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1210,8 +1210,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
         SetIsPreviousParagraphFramed(false);
 
     m_bParaChanged = false;
-    if (!pParaContext || !pParaContext->IsFrameMode())
-    { // If the paragraph is in a frame, it's not a paragraph of the section itself.
+    if( !IsInHeaderFooter() && (!pParaContext || !pParaContext->IsFrameMode()) )
+    { // If the paragraph is in a frame or header/footer, it's not a paragraph of the section itself.
         m_bIsFirstParaInSection = false;
         m_bIsLastParaInSection = false;
     }


More information about the Libreoffice-commits mailing list