[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - 2 commits - sw/qa writerfilter/source

Thorsten Behrens Thorsten.Behrens at CIB.de
Tue Jan 23 15:22:28 UTC 2018


Rebased ref, commits from common ancestor:
commit 3c23efb49c501ad9e4f99e33dd80fc2fdd7b7ba6
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Tue Jan 23 15:31:31 2018 +0100

    We don't need this
    
    Change-Id: Ide67559b13016e764c6753b9f5a4ec237bc283f3

diff --git a/sw/qa/core/data/ooxml/pass/ofz4825-1.docx b/sw/qa/core/data/ooxml/pass/ofz4825-1.docx
deleted file mode 100644
index ce8e6493af45..000000000000
Binary files a/sw/qa/core/data/ooxml/pass/ofz4825-1.docx and /dev/null differ
commit f24db79e31c86181c603ca0ee1c1d82d30652c2e
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>
    
    tdf#102466 Added unit test: ensure 1st page is not missing
    
    Change-Id: Icbc97d6a69447575aa2980a700a663ece226f781
    Reviewed-on: https://gerrit.libreoffice.org/44273
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Serge Krot (CIB) <Serge.Krot at cib.de>
    Reviewed-on: https://gerrit.libreoffice.org/48300
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf102466.docx b/sw/qa/extras/ooxmlexport/data/tdf102466.docx
new file mode 100644
index 000000000000..68a88799ce66
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf102466.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 0fdfe003e161..a4c8cbdcd511 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -1039,6 +1039,40 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92521, "tdf92521.odt")
         assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:sectPr", 1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf102466, "tdf102466.docx")
+{
+    // the problem was: file is truncated: the first page is missing.
+
+    // check how much pages we have
+    CPPUNIT_ASSERT_EQUAL(10, getPages());
+
+    // check content of the first page
+    {
+        uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XIndexAccess> xIndexAccess(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+        uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+
+        // no border
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xFrame, "LineWidth"));
+    }
+
+    // Make sure we have 19 tables created
+    {
+        uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(19), xTables->getCount( ));
+
+        // check the text inside first cell of the first table
+        uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+        uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+
+        const OUString aMustHaveText = "Requerimientos del  Cliente";
+        const OUString aActualText   = xCell->getString();
+
+        CPPUNIT_ASSERT(aActualText.indexOf(aMustHaveText) > 0);
+    }
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf81345_045Original,"tdf81345.docx")
 {
     //Header wasn't replaced  and columns were missing because no new style was created.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f41e406409dc..82a202109613 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1203,7 +1203,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
     }
 
     m_bParaChanged = false;
-    if( !IsInShape() && (!pParaContext || !pParaContext->IsFrameMode()) )
+    if( !IsInHeaderFooter() && !IsInShape() && (!pParaContext || !pParaContext->IsFrameMode()) )
     { // If the paragraph is in a frame, shape or header/footer, it's not a paragraph of the section itself.
         SetIsFirstParagraphInSection(false);
         SetIsLastParagraphInSection(false);


More information about the Libreoffice-commits mailing list