summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-08-14 13:08:54 +0300
committerJustin Luth <justin_luth@sil.org>2018-08-16 06:40:30 +0200
commit9202597373f745b7b83dde1396636e1e619e4e81 (patch)
tree3d723190bef3f60b6cef7bac652c37a7fa257fed
parent0f369c16bd7443a5f5ac07aa5801d9e817963e5a (diff)
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@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx3
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx5
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx2
3 files changed, 10 insertions, 0 deletions
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 );