From 552ceeb5c6ccf2573adfd092cc4b2ce214a9c2df Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Allotropia)" Date: Thu, 10 Jun 2021 19:24:04 +0200 Subject: tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWN FontworkBar::getState does not need to check for SfxItemState::UNKNOWN at all, actions solely depend on FontWork object being selected. This also greatly simplifies that method. Also, the optimization by passing in a variable to checkForSelectedFontWork and remember if already computed can be removed - also in other places where it had to be given, but was not re-used at all Change-Id: I35b1f36195feb1d645619665d2dd65a84b75b118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117014 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Armin Le Grand --- sd/source/ui/view/ToolBarManager.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sd/source/ui/view') diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 413199c0e7d3..78dc658584df 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -1098,8 +1098,8 @@ void ToolBarRules::SelectionHasChanged ( // be activated. if (svx::checkForSelectedCustomShapes(pView, true /* bOnlyExtruded */ )) mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, ToolbarId::Svx_Extrusion_Bar); - sal_uInt32 nCheckStatus = 0; - if (svx::checkForSelectedFontWork(pView, nCheckStatus)) + + if (svx::checkForSelectedFontWork(pView)) mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, ToolbarId::Svx_Fontwork_Bar); // Switch on additional context-sensitive tool bars. -- cgit