sw/qa/extras/ooxmlexport/data/tdf102466.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 34 ++++++++++++++++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 +- 3 files changed, 36 insertions(+), 2 deletions(-)
New commits: commit 686585dffceba87cacabb38ee58295b873bf4751 Author: Justin Luth <justin_l...@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_l...@sil.org> Tested-by: Justin Luth <justin_l...@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 <c...@libreoffice.org> Reviewed-by: Serge Krot (CIB) <serge.k...@cib.de> Reviewed-on: https://gerrit.libreoffice.org/48300 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@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..a9ea0a2ce59a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1203,8 +1203,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap ) } m_bParaChanged = false; - if( !IsInShape() && (!pParaContext || !pParaContext->IsFrameMode()) ) - { // If the paragraph is in a frame, shape or header/footer, 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. SetIsFirstParagraphInSection(false); SetIsLastParagraphInSection(false); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits