sd/source/ui/inc/TextObjectBar.hxx | 1 sd/source/ui/view/drtxtob1.cxx | 43 +++++++++++-------------------------- 2 files changed, 13 insertions(+), 31 deletions(-)
New commits: commit 12c974caf145145521a88622a3ee8a5d24cde9dc Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed May 14 10:52:14 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed May 14 18:04:41 2025 +0200 sd: simplify code Since commit 291919476294f62d7af9b8b7060d138728897ee7 Author: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> Date: Thu Apr 4 07:18:38 2024 +0300 tdf#33603: sd: rework notes panel Change-Id: I750a5397f98507168ca862a75e36162b4be4e6ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185300 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sd/source/ui/inc/TextObjectBar.hxx b/sd/source/ui/inc/TextObjectBar.hxx index d180a674499f..c051e4016733 100644 --- a/sd/source/ui/inc/TextObjectBar.hxx +++ b/sd/source/ui/inc/TextObjectBar.hxx @@ -49,7 +49,6 @@ public: void GetCharState( SfxItemSet& rSet ); static void GetCharStateImpl(const ViewShell* mpViewShell, const ::sd::View* mpView, SfxItemSet& rSet); void Execute( SfxRequest &rReq ); - static void ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxRequest& rReq, SfxShell* pTextObjectBar); private: ViewShell* mpViewShell; diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 370fa9dffb06..d80912b8a336 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -74,11 +74,6 @@ namespace sd { * Process SfxRequests */ void TextObjectBar::Execute(SfxRequest& rReq) -{ - ExecuteImpl(mpViewShell, mpView, rReq, this); -} - -void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxRequest& rReq, SfxShell* pTextObjectBar) { const SfxItemSet* pArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -177,8 +172,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR } rReq.Done(); - if(pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); // to refresh preview (in outline mode), slot has to be invalidated: mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); @@ -283,8 +277,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR } rReq.Done(); - if (pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); // to refresh preview (in outline mode), slot has to be invalidated: mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_PARA_ULSPACE, true ); @@ -298,8 +291,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR pOLV->AdjustDepth( -1 ); // Ensure bold/italic etc. icon state updates - if (pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); // trigger preview refresh mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); } @@ -314,8 +306,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR pOLV->AdjustDepth( 1 ); // Ensure bold/italic etc. icon state updates - if (pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); // trigger preview refresh mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); } @@ -334,8 +325,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR aEditAttr.Put( aLRSpace ); mpView->SetAttributes( aEditAttr ); - if (pTextObjectBar) - pTextObjectBar->Invalidate(SID_ATTR_PARA_LRSPACE); + Invalidate(SID_ATTR_PARA_LRSPACE); } break; @@ -360,8 +350,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR aLRSpaceSet.Put( aNewMargin ); mpView->SetAttributes( aLRSpaceSet ); - if (pTextObjectBar) - pTextObjectBar->Invalidate(SID_ATTR_PARA_LRSPACE); + Invalidate(SID_ATTR_PARA_LRSPACE); } break; @@ -405,8 +394,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR SDRATTR_TEXTDIRECTION ) ); rReq.Done( aAttr ); mpView->SetAttributes( aAttr ); - if (pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); } break; @@ -739,8 +727,7 @@ SET_ADJUST: rReq.Done( aNewAttr ); pArgs = rReq.GetArgs(); - if (pTextObjectBar) - pTextObjectBar->Invalidate(SID_RULER_TEXT_RIGHT_TO_LEFT); + Invalidate(SID_RULER_TEXT_RIGHT_TO_LEFT); } else if ( nSlot == SID_ATTR_CHAR_FONT || nSlot == SID_ATTR_CHAR_FONTHEIGHT || @@ -831,8 +818,7 @@ SET_ADJUST: // invalidate entire shell because of performance and // extension reasons - if (pTextObjectBar) - pTextObjectBar->Invalidate(); + Invalidate(); // to refresh preview (in outline mode), slot has to be invalidated: mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); @@ -846,13 +832,10 @@ SET_ADJUST: pOLV->GetWindow()->GrabFocus(); } - if (pTextObjectBar) - { - pTextObjectBar->Invalidate(SID_OUTLINE_LEFT); - pTextObjectBar->Invalidate(SID_OUTLINE_RIGHT); - pTextObjectBar->Invalidate(SID_OUTLINE_UP); - pTextObjectBar->Invalidate(SID_OUTLINE_DOWN); - } + Invalidate(SID_OUTLINE_LEFT); + Invalidate(SID_OUTLINE_RIGHT); + Invalidate(SID_OUTLINE_UP); + Invalidate(SID_OUTLINE_DOWN); } } // end of namespace sd