sd/source/ui/func/fuolbull.cxx |    4 ++--
 sd/source/ui/inc/fuolbull.hxx  |    2 ++
 sd/source/ui/view/drtxtob1.cxx |    3 ++-
 sd/source/ui/view/drviews2.cxx |    6 ++----
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 1dc25f541784b5e50210af1d5ffb619ec55220f1
Author:     Miklos Vajna <[email protected]>
AuthorDate: Wed Nov 12 09:17:17 2025 +0100
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Nov 12 14:07:41 2025 +0100

    sd, FuBulletAndPosition: avoid magic number for bullet toggle
    
    See
    <https://gerrit.libreoffice.org/c/core/+/193741/comment/b3848436_a643f32e>,
    it seems this magic was set at 3 locations, but only read at one place,
    change all that to a named constant instead.
    
    Change-Id: I979dcef54ab638275d793f195ac34533c95f0bf6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193839
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index f9b8f3965c36..4ddc89ffac60 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -164,9 +164,9 @@ void 
FuBulletAndPosition::SetCurrentBulletsNumbering(SfxRequest& rReq)
 
     sal_uInt16 nIdx = pItem->GetValue();
     bool bToggle = false;
-    if( nIdx == sal_uInt16(0xFFFF) )
+    if( nIdx == BULLET_TOGGLE )
     {
-        // If the nIdx is (sal_uInt16)0xFFFF, means set bullet status to on/off
+        // Set bullet status to on/off
         nIdx = 1;
         bToggle = true;
     }
diff --git a/sd/source/ui/inc/fuolbull.hxx b/sd/source/ui/inc/fuolbull.hxx
index e10ab6b237d4..6391a9684388 100644
--- a/sd/source/ui/inc/fuolbull.hxx
+++ b/sd/source/ui/inc/fuolbull.hxx
@@ -44,6 +44,8 @@ public:
     static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* 
pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
     virtual void DoExecute( SfxRequest& rReq ) override;
 
+    constexpr static sal_uInt16 BULLET_TOGGLE = 0xFFFF;
+
 private:
     FuBulletAndPosition (
         ViewShell* pViewShell,
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index fbc3c4b60e1d..3cd8837e5bec 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -64,6 +64,7 @@
 #include <futempl.hxx>
 #include <DrawDocShell.hxx>
 #include <futext.hxx>
+#include <fuolbull.hxx>
 #include <editeng/colritem.hxx>
 
 #include <memory>
@@ -427,7 +428,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, 
::sd::View* mpView, SfxR
                 {
                     // Set all levels of the list, so later increase/decrease 
of the list level
                     // works, too.
-                    SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF));
+                    SfxUInt16Item aItem(FN_SVX_SET_BULLET, 
FuBulletAndPosition::BULLET_TOGGLE);
                     mpViewShell->GetViewFrame()->GetDispatcher()->ExecuteList(
                         FN_SVX_SET_BULLET, SfxCallMode::RECORD, { &aItem });
                 }
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index cade0af618ec..d6827ad97953 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2162,8 +2162,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
         case FN_NUM_BULLET_ON:
         {
-            // The value (sal_uInt16)0xFFFF means set bullet on/off.
-            SfxUInt16Item aItem(FN_SVX_SET_BULLET, sal_uInt16(0xFFFF));
+            SfxUInt16Item aItem(FN_SVX_SET_BULLET, 
FuBulletAndPosition::BULLET_TOGGLE);
             GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_BULLET,
                     SfxCallMode::RECORD, { &aItem });
         }
@@ -2171,8 +2170,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
         case FN_NUM_NUMBERING_ON:
         {
-            // The value (sal_uInt16)0xFFFF means set bullet on/off.
-            SfxUInt16Item aItem(FN_SVX_SET_NUMBER, sal_uInt16(0xFFFF));
+            SfxUInt16Item aItem(FN_SVX_SET_NUMBER, 
FuBulletAndPosition::BULLET_TOGGLE);
             GetViewFrame()->GetDispatcher()->ExecuteList(FN_SVX_SET_NUMBER,
                     SfxCallMode::RECORD, { &aItem });
         }

Reply via email to