sd/sdi/NotesPanelView.sdi                 |   10 ++++++++
 sd/source/ui/view/NotesPanelViewShell.cxx |   35 ++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)

New commits:
commit 47db8dfc39241a7444a7af73372368b9e13f5580
Author:     Sarper Akdemir <sarper.akde...@allotropia.de>
AuthorDate: Wed Apr 9 16:06:04 2025 +0200
Commit:     Sarper Akdemir <sarper.akde...@allotropia.de>
CommitDate: Wed Apr 9 17:58:32 2025 +0200

    tdf#166075: sd: notes pane: enable sidebar list format button
    
    support slots FN_NUM_BULLET_ON & FN_NUM_NUMBERING_ON to properly
    report back whether or not numbering functionality is available in
    notes pane.
    
    Change-Id: I94fd395a328a45db3bc7c394b7473a22edf0c957
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183943
    Tested-by: Jenkins
    Reviewed-by: Sarper Akdemir <sarper.akde...@allotropia.de>

diff --git a/sd/sdi/NotesPanelView.sdi b/sd/sdi/NotesPanelView.sdi
index 8fb46d84a527..4d9607e8e9cc 100644
--- a/sd/sdi/NotesPanelView.sdi
+++ b/sd/sdi/NotesPanelView.sdi
@@ -159,6 +159,16 @@ interface NotesPanelView
     [
         ExecMethod = FuTemporaryModify ;
     ]
+    FN_NUM_BULLET_ON
+    [
+        ExecMethod = FuTemporaryModify;
+        StateMethod = GetAttrState;
+    ]
+    FN_NUM_NUMBERING_ON
+    [
+        ExecMethod = FuTemporaryModify;
+        StateMethod = GetAttrState;
+    ]
     SID_OUTLINE_BULLET // ole : no, status : ?
     [
         ExecMethod = FuTemporaryModify ;
diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx 
b/sd/source/ui/view/NotesPanelViewShell.cxx
index aa4c893360fc..ad4294cb43ad 100644
--- a/sd/source/ui/view/NotesPanelViewShell.cxx
+++ b/sd/source/ui/view/NotesPanelViewShell.cxx
@@ -549,6 +549,20 @@ void NotesPanelViewShell::GetAttrState(SfxItemSet& rSet)
                 rSet.DisableItem(nWhich);
             }
             break;
+            case FN_NUM_BULLET_ON:
+            case FN_NUM_NUMBERING_ON:
+            {
+                bool bIsBullet = false;
+                bool bIsNumbering = false;
+                OutlinerView* pOlView = 
mpNotesPanelView->GetTextEditOutlinerView();
+                if (pOlView)
+                {
+                    pOlView->IsBulletOrNumbering(bIsBullet, bIsNumbering);
+                }
+                rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, bIsBullet));
+                rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON, bIsNumbering));
+            }
+            break;
 
             default:
                 break;
@@ -883,6 +897,24 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& 
rReq)
         }
         break;
 
+        case FN_NUM_BULLET_ON:
+        {
+            // The value (sal_uInt16)0xFFFF means set bullet on/off.
+            SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF));
+            GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET, 
SfxCallMode::RECORD,
+                                                         { &aItem });
+        }
+        break;
+
+        case FN_NUM_NUMBERING_ON:
+        {
+            // The value (sal_uInt16)0xFFFF means set bullet on/off.
+            SfxUInt16Item aItem(FN_SVX_SET_NUMBER, sal_uInt16(0xFFFF));
+            GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER, 
SfxCallMode::RECORD,
+                                                         { &aItem });
+        }
+        break;
+
         case SID_OUTLINE_BULLET:
         case FN_SVX_SET_BULLET:
         case FN_SVX_SET_NUMBER:
@@ -890,6 +922,9 @@ void NotesPanelViewShell::FuTemporaryModify(SfxRequest& 
rReq)
             SetCurrentFunction(FuBulletAndPosition::Create(this, 
GetActiveWindow(),
                                                            
mpNotesPanelView.get(), GetDoc(), rReq));
             Cancel();
+            SfxBindings& rBindings = GetViewFrame()->GetBindings();
+            rBindings.Invalidate(FN_NUM_BULLET_ON);
+            rBindings.Invalidate(FN_NUM_NUMBERING_ON);
         }
         break;
 

Reply via email to