svx/source/tbxctrls/tbcontrl.cxx    |    4 ----
 sw/source/uibase/docvw/edtwin.cxx   |    2 +-
 sw/source/uibase/shells/textsh1.cxx |   12 +++++++++---
 3 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit e93b7f6a5c5f9ee86546d95d7fe70ecc26b71b91
Author:     Justin Luth <[email protected]>
AuthorDate: Wed Aug 10 14:00:47 2022 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Wed Aug 24 01:07:07 2022 +0200

    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 <[email protected]>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index db147949c306..a97bc0b12d31 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3749,10 +3749,6 @@ void SvxColorToolBoxControl::execute(sal_Int16 
/*nSelectModifier*/)
         case SID_ATTR_CHAR_COLOR2 :
             aCommand    = ".uno:CharColorExt";
             break;
-
-        case SID_ATTR_CHAR_COLOR_BACKGROUND :
-            aCommand    = ".uno:CharBackgroundExt";
-            break;
     }
 
     auto aArgs( comphelper::InitPropertySequence( {
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();

Reply via email to