diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/mailmerge/data/missing-default-line-color.ott | bin | 0 -> 15093 bytes | |||
-rw-r--r-- | sw/qa/extras/mailmerge/data/one-empty-address.ods | bin | 0 -> 8013 bytes | |||
-rw-r--r-- | sw/qa/extras/mailmerge/mailmerge.cxx | 23 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/mailmerge/data/missing-default-line-color.ott b/sw/qa/extras/mailmerge/data/missing-default-line-color.ott Binary files differnew file mode 100644 index 000000000000..dad5a7bed989 --- /dev/null +++ b/sw/qa/extras/mailmerge/data/missing-default-line-color.ott diff --git a/sw/qa/extras/mailmerge/data/one-empty-address.ods b/sw/qa/extras/mailmerge/data/one-empty-address.ods Binary files differnew file mode 100644 index 000000000000..abffed956aee --- /dev/null +++ b/sw/qa/extras/mailmerge/data/one-empty-address.ods diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 1b8dc2e4ec57..33f8f43bb620 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -71,6 +71,29 @@ DECLARE_DFLT_MAILMERGE_TEST(testMultiPageAnchoredDraws, "multiple-page-anchored- } } +DECLARE_DFLT_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-color.ott", "one-empty-address.ods", "one-empty-address") +{ + executeMailMerge(); + // The document was created by LO version which didn't write out the default value for line color + // (see XMLGraphicsDefaultStyle::SetDefaults()). + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxMMComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + // Lines do not have a line color. + CPPUNIT_ASSERT( !xPropertySet->getPropertySetInfo()->hasPropertyByName( "LineColor" )); + SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxMMComponent.get()); + CPPUNIT_ASSERT(pTxtDoc); + uno::Reference< lang::XMultiServiceFactory > xFact( mxMMComponent, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xDefaults( xFact->createInstance( "com.sun.star.drawing.Defaults" ), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xDefaults.is()); + uno::Reference< beans::XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo()); + CPPUNIT_ASSERT( xInfo->hasPropertyByName( "LineColor" )); + sal_uInt32 lineColor; + xDefaults->getPropertyValue( "LineColor" ) >>= lineColor; + // And the default value is black (wasn't copied properly by mailmerge). + CPPUNIT_ASSERT_EQUAL( COL_BLACK, lineColor ); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 7701873f32a5..710db732352a 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -853,6 +853,7 @@ void SwDoc::ReplaceDefaults(const SwDoc& rSource) RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, + XATTR_START, XATTR_END-1, 0 }; |