From 8ef4dc07cd4413253b5747dd714fadd548d6bcf6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 21 Mar 2024 19:12:56 +0200 Subject: improve loplugin:staticmethods Some of the exclusions were too aggressive. Restrict them to only the important classes, which exposes some more places this plugin applies. Change-Id: I1b2d1fb24391adc71ed0984f94168f61a149479f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165154 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/uielement/imagebuttontoolbarcontroller.cxx | 1 + framework/source/uielement/menubarmanager.cxx | 3 ++- framework/source/uielement/newmenucontroller.cxx | 1 + framework/source/uielement/spinfieldtoolbarcontroller.cxx | 1 + framework/source/uielement/toolbarmanager.cxx | 1 + framework/source/uielement/toolbarsmenucontroller.cxx | 1 + framework/source/uielement/uicommanddescription.cxx | 3 ++- 7 files changed, 9 insertions(+), 2 deletions(-) (limited to 'framework/source/uielement') diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index a91b0123a597..453a3160566c 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -114,6 +114,7 @@ void ImageButtonToolbarController::executeControlCommand( const css::frame::Cont } } +// static bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUString& aImageURL, Image& aImage ) { std::unique_ptr pStream(utl::UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ )); diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 0eb7705e66fd..8194cfc8e25f 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1544,7 +1544,8 @@ void MenuBarManager::AddMenu(MenuBarManager* pSubMenuManager,const OUString& _sI m_aMenuItemHandlerVector.push_back( std::move(pMenuItemHandler) ); } -sal_uInt16 MenuBarManager::FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex) const +// static +sal_uInt16 MenuBarManager::FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex) { sal_uInt16 nItemId = _pMenu->GetItemId( _nIndex ); diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index fb133540c358..e4f7a661aa9c 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -242,6 +242,7 @@ void NewMenuController::setAccelerators() } } +// static void NewMenuController::retrieveShortcutsFromConfiguration( const Reference< XAcceleratorConfiguration >& rAccelCfg, const Sequence< OUString >& rCommands, diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 729bd717da21..e660eb04b0a1 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -386,6 +386,7 @@ void SpinfieldToolbarController::executeControlCommand( const css::frame::Contro } } +// static bool SpinfieldToolbarController::impl_getValue( const Any& rAny, sal_Int32& nValue, double& fValue, bool& bFloat ) { diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 85f6cc27682a..fb6e02918027 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1228,6 +1228,7 @@ void ToolBarManager::AddFrameActionListener() } } +// static ToolBoxItemBits ToolBarManager::ConvertStyleToToolboxItemBits( sal_Int32 nStyle ) { ToolBoxItemBits nItemBits( ToolBoxItemBits::NONE ); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 3b7e76b25fd9..9bd0d72faa06 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -235,6 +235,7 @@ static void fillHashMap( const Sequence< Sequence< css::beans::PropertyValue > > } // private function +// static Sequence< Sequence< css::beans::PropertyValue > > ToolbarsMenuController::getLayoutManagerToolbars( const Reference< css::frame::XLayoutManager >& rLayoutManager ) { std::vector< ToolBarInfo > aToolBarArray; diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index 9e5e8a403783..0b8bad8ccdfa 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -120,7 +120,7 @@ class ConfigurationAccess_UICommand : // Order is necessary for right initializa Any getSequenceFromCache( const OUString& aCommandURL ); Any getInfoFromCommand( const OUString& rCommandURL ); - void fillInfoFromResult( CmdToInfoMap& rCmdInfo, const OUString& aLabel ); + static void fillInfoFromResult( CmdToInfoMap& rCmdInfo, const OUString& aLabel ); Sequence< OUString > getAllCommands(); void fillCache(); void addGenericInfoToCache(); @@ -249,6 +249,7 @@ sal_Bool SAL_CALL ConfigurationAccess_UICommand::hasElements() return true; } +// static void ConfigurationAccess_UICommand::fillInfoFromResult( CmdToInfoMap& rCmdInfo, const OUString& aLabel ) { OUString aStr(aLabel.replaceAll("%PRODUCTNAME", utl::ConfigManager::getProductName())); -- cgit