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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 16 04:40:53 UTC 2018


 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx   |    3 +++
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx   |    5 +++++
 writerfilter/source/dmapper/PropertyMap.cxx |    2 ++
 3 files changed, 10 insertions(+)

New commits:
commit 9202597373f745b7b83dde1396636e1e619e4e81
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Aug 14 13:08:54 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Thu Aug 16 06:40:30 2018 +0200

    tdf#106572 writerfilter: don't write to dummy paragraph
    
    I found a few existing unit tests that this fixes, and
    a few unit tests that already worked without this. So
    something else is at play here, but it doesn't appear
    to be hurt by this fix since each one still starts
    with "First Page" style.
    
    Change-Id: Idc61279fc5fddc9df62b6ab7a9bcd3822d52cbbb
    Reviewed-on: https://gerrit.libreoffice.org/59033
    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/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 04f393309ee0..beaa1b936cc4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -299,6 +299,9 @@ DECLARE_OOXMLEXPORT_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx")
     if (!pXmlDoc)
         return;
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32());
+
+    // tdf#106572 - preventative test matching danger conditions, but imported OK anyway
+    CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(fdo69656, "Table_cell_auto_width_fdo69656.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 404c40b1b149..040b4e4766ff 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -760,6 +760,11 @@ DECLARE_OOXMLEXPORT_TEST(testN779642, "n779642.docx")
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", text::VertOrientation::BOTTOM, nValue);
     xFrame->getPropertyValue("VertOrientRelation") >>= nValue;
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", text::RelOrientation::PAGE_PRINT_AREA, nValue);
+
+    // tdf#106572 - perhaps not the best test to hijack since this file
+    // produces an error in Word, but it nicely matches danger points,
+    // and has a different first footer, so nice visual confirmation.
+    CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTbLrHeight, "tblr-height.docx")
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 46b846289219..7ca56ed219a3 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1026,6 +1026,8 @@ uno::Reference< beans::XPropertySet > lcl_GetRangeProperties( bool bIsFirstSecti
         uno::Reference< container::XEnumerationAccess > xEnumAccess( rDM_Impl.GetBodyText(), uno::UNO_QUERY_THROW );
         uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration();
         xRangeProperties.set( xEnum->nextElement(), uno::UNO_QUERY_THROW );
+        if ( rDM_Impl.GetIsDummyParaAddedForTableInSection() && xEnum->hasMoreElements() )
+            xRangeProperties.set( xEnum->nextElement(), uno::UNO_QUERY_THROW );
     }
     else if ( xStartingRange.is() )
         xRangeProperties.set( xStartingRange, uno::UNO_QUERY_THROW );


More information about the Libreoffice-commits mailing list