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 d6decd534412867fd95940eacc6809a15cb302a5 Author: Miklos Vajna <[email protected]> AuthorDate: Wed Nov 12 09:17:17 2025 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Thu Nov 13 08:58:30 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/+/193870 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index d9db92f27fe3..ef4dd373fcbc 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 ea6b4813c44d..ab16275cecf4 100644 --- a/sd/source/ui/inc/fuolbull.hxx +++ b/sd/source/ui/inc/fuolbull.hxx @@ -43,6 +43,8 @@ public: static rtl::Reference<FuPoor> Create( ViewShell& rViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument& rDoc, SfxRequest& rReq ); virtual void DoExecute( SfxRequest& rReq ) override; + constexpr static sal_uInt16 BULLET_TOGGLE = 0xFFFF; + private: FuBulletAndPosition ( ViewShell& rViewShell, diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 2c41d3b120c9..5e3902ab2471 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> @@ -409,7 +410,7 @@ void TextObjectBar::Execute(SfxRequest& rReq) { // 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); mrViewShell.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 55315e54479e..a15fc19532a4 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2145,8 +2145,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 }); } @@ -2154,8 +2153,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 }); }
