sw/qa/extras/uiwriter/uiwriter2.cxx | 4 ++-- sw/source/core/txtnode/ndtxt.cxx | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
New commits: commit f08362c0b64b6a1f746c4c0ab008e4817595e69e Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Tue Dec 25 22:26:14 2018 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Sat Jan 26 19:35:38 2019 +0100 tdf#99573 uiwriter: clear RES_BACKGROUND -> XATTR_FILL_* The paragraph background wasn't being cleared when hard formatting was removed (unless roundtripped via .ODT only) because a couple of years ago RES_BACKGROUND was aliased to XATTR_FILL, but lots of edge cases are still missed. Perhaps there is a more generic place to handle "reset attribute", but I didn't find it. SwFormat is where most of the aliasing is happening. Change-Id: I9d0a3c70f03f0a5b22155e689e27e3372535aec6 Reviewed-on: https://gerrit.libreoffice.org/65609 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 8b05f26e6241..147936818d68 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -126,7 +126,7 @@ void SwUiWriterTest2::testTdf47471_paraStyleBackground() lcl_dispatchCommand(mxComponent, ".uno:ResetAttributes", {}); // the background color should revert to the color for 00Background style - //CPPUNIT_ASSERT_EQUAL(sal_Int32(14605542), getProperty<sal_Int32>(getParagraph(2), "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14605542), getProperty<sal_Int32>(getParagraph(2), "FillColor")); // the paragraph style should not be reset CPPUNIT_ASSERT_EQUAL(OUString("00Background"), getProperty<OUString>(getParagraph(2), "ParaStyleName")); @@ -136,7 +136,7 @@ void SwUiWriterTest2::testTdf47471_paraStyleBackground() // Save it and load it back. reload("writer8", "tdf47471_paraStyleBackgroundRT.odt"); - //CPPUNIT_ASSERT_EQUAL(sal_Int32(14605542), getProperty<sal_Int32>(getParagraph(2), "FillColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14605542), getProperty<sal_Int32>(getParagraph(2), "FillColor")); // on round-trip, the paragraph style name was lost CPPUNIT_ASSERT_EQUAL(OUString("00Background"), getProperty<OUString>(getParagraph(2), "ParaStyleName")); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index f02c2a636546..115171009dea 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -5026,6 +5026,8 @@ namespace { } else if ( rWhich == RES_PARATR_OUTLINELEVEL ) mrTextNode.ResetEmptyListStyleDueToResetOutlineLevelAttr(); + else if ( rWhich == RES_BACKGROUND ) + mrTextNode.ResetAttr( XATTR_FILL_FIRST, XATTR_FILL_LAST ); if ( !bRemoveFromList ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits