diff options
author | Justin Luth <jluth@mail.com> | 2022-08-10 14:00:47 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-08-24 01:07:07 +0200 |
commit | e93b7f6a5c5f9ee86546d95d7fe70ecc26b71b91 (patch) | |
tree | 7979a12fca68e08100a102bd85d6d31a9d46f888 /sw | |
parent | 65747afbb644607c0d2a1fbf354a1a080292b285 (diff) |
NFC related tdf#85592: simplify SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
I am tring to replace Writer-only uno:BackColor
with uno:CharBackColor. The problem is this template flag
which gets calls in svx and then does nothing in editeng.
But I don't see any reason why this call should be
transformed into a template (_ext) call.
We can easily just keep the same call
and do the state-checking only slightly different.
All this other stuff makes _EXT seem much more
complicated than it is.
If I am right that this is a Non-Functional-Change,
then I am well on my way to fixing this bug report.
Change-Id: Idc08117217837f217ea5ca390005802c2fad392b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138101
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 2f166579a27c..bfa5d91db8ee 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5094,7 +5094,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) case SID_ATTR_CHAR_COLOR_EXT: nId = RES_CHRATR_COLOR; break; - case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT: + case SID_ATTR_CHAR_COLOR_BACKGROUND: nId = RES_CHRATR_BACKGROUND; break; } diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 647ef76ade64..7e4247118526 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1284,11 +1284,11 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.SetAttrItem( SvxColorItem(aSet, RES_CHRATR_COLOR) ); } - else if (nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND) + else if (nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT) { - if (!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT) + if (!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND) { - aTempl.nColor = SID_ATTR_CHAR_COLOR_BACKGROUND_EXT; + aTempl.nColor = SID_ATTR_CHAR_COLOR_BACKGROUND; rEdtWin.SetApplyTemplate(aTempl); } } @@ -1856,6 +1856,12 @@ void SwTextShell::GetState( SfxItemSet &rSet ) } break; case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT: + { + SwEditWin& rEdtWin = GetView().GetEditWin(); + SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); + rSet.Put(SfxBoolItem(nWhich, pApply && pApply->nColor == SID_ATTR_CHAR_COLOR_BACKGROUND)); + } + break; case SID_ATTR_CHAR_COLOR_EXT: { SwEditWin& rEdtWin = GetView().GetEditWin(); |