summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-12-25 22:26:14 +0300
committerJustin Luth <justin_luth@sil.org>2019-01-26 19:35:38 +0100
commitf08362c0b64b6a1f746c4c0ab008e4817595e69e (patch)
treebf88c384c897584e931e07fec00c473ad7410acb
parentb226383a83e41bbced9fc2a02dc09a449401ec97 (diff)
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_luth@sil.org>
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx2
2 files changed, 4 insertions, 2 deletions
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 )
{