diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-18 14:42:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-19 07:57:11 +0000 |
commit | 423936ffacb72f85b37961e4cd585fe2719799b7 (patch) | |
tree | 3c08c99af64762429d97bf8dcfe7cbac9c56c6ab /framework | |
parent | e7782a99a5b5248e3c133a7b085737ceb0ecea57 (diff) |
loplugin:expandablemethodds in formula..framework
Change-Id: I6c8b1bb3b664faa92b2dc05955c30bfd35f6dfaa
Reviewed-on: https://gerrit.libreoffice.org/30015
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/helper/ocomponentaccess.hxx | 24 | ||||
-rw-r--r-- | framework/inc/helper/oframes.hxx | 2 | ||||
-rw-r--r-- | framework/inc/services/desktop.hxx | 11 | ||||
-rw-r--r-- | framework/inc/uielement/toolbarsmenucontroller.hxx | 1 | ||||
-rw-r--r-- | framework/source/helper/ocomponentaccess.cxx | 18 | ||||
-rw-r--r-- | framework/source/helper/oframes.cxx | 17 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 16 | ||||
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 2 |
8 files changed, 6 insertions, 85 deletions
diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx index 1d541b15f8fb..31091927afdf 100644 --- a/framework/inc/helper/ocomponentaccess.hxx +++ b/framework/inc/helper/ocomponentaccess.hxx @@ -160,30 +160,6 @@ class OComponentAccess : public ::cppu::WeakImplHelper< css::container::XEnum css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; - // debug methods - // (should be private everyway!) - - /*-**************************************************************************************************** - @short debug-method to check incoming parameter of some other mehods of this class - @descr The following methods are used to check parameters for other methods - of this class. The return value is used directly for an ASSERT(...). - - @seealso ASSERTs in implementation! - - @param references to checking variables - @return sal_False ,on invalid parameter. - @return sal_True ,otherwise - *//*-*****************************************************************************************************/ - - private: - - static bool impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< css::frame::XDesktop >& xOwner ); - - // variables - // (should be private everyway!) - - private: - css::uno::WeakReference< css::frame::XDesktop > m_xOwner; /// weak reference to the desktop object! }; // class OComponentAccess diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx index 9f82c478a186..af330aa0822e 100644 --- a/framework/inc/helper/oframes.hxx +++ b/framework/inc/helper/oframes.hxx @@ -212,8 +212,6 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > private: static bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::frame::XFrame >& xOwner , FrameContainer* pFrameContainer ); - static bool impldbg_checkParameter_append ( const css::uno::Reference< css::frame::XFrame >& xFrame ); - static bool impldbg_checkParameter_remove ( const css::uno::Reference< css::frame::XFrame >& xFrame ); static bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); // variables diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx index 8e90ba671ebf..8aa56efaf9a8 100644 --- a/framework/inc/services/desktop.hxx +++ b/framework/inc/services/desktop.hxx @@ -386,22 +386,11 @@ class Desktop : private cppu::BaseMutex, */ bool impl_closeFrames(bool bAllowUI); - // debug methods - // (should be private every time!) - private: - static bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); - static bool implcp_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ); - bool m_bIsTerminated; /// check flag to protect us against dispose before terminate! /// see dispose() for further information! - // variables - // (should be private every time!) - - private: - css::uno::Reference< css::uno::XComponentContext > m_xContext; /// reference to factory, which has create this instance FrameContainer m_aChildTaskContainer; /// array of child tasks (children of desktop are tasks; and tasks are also frames - But pure frames are not accepted!) ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index 55733037cb70..370e35bbf9f3 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -87,7 +87,6 @@ namespace framework css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getLayoutManagerToolbars( const css::uno::Reference< css::frame::XLayoutManager >& rLayoutManager ); css::uno::Reference< css::frame::XDispatch > getDispatchFromCommandURL( const OUString& rCommandURL ); void addCommand( css::uno::Reference< css::awt::XPopupMenu >& rPopupMenu, const OUString& rCommandURL, const OUString& aLabel ); - bool isContextSensitiveToolbarNonVisible() { return m_bResetActive;} css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::container::XNameAccess > m_xPersistentWindowState; diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx index 6b13cecfe032..f120a79380f4 100644 --- a/framework/source/helper/ocomponentaccess.cxx +++ b/framework/source/helper/ocomponentaccess.cxx @@ -39,7 +39,7 @@ OComponentAccess::OComponentAccess( const css::uno::Reference< XDesktop >& xOwne : m_xOwner ( xOwner ) { // Safe impossible cases - SAL_WARN_IF( !impldbg_checkParameter_OComponentAccessCtor( xOwner ), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" ); + SAL_WARN_IF( !xOwner.is(), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" ); } // destructor @@ -161,22 +161,6 @@ css::uno::Reference< XComponent > OComponentAccess::impl_getFrameComponent( cons return xComponent; } -// debug methods - -/*----------------------------------------------------------------------------------------------------------------- - The follow methods checks the parameter for other functions. If a parameter or his value is non valid, - we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT! - - ATTENTION - - If you miss a test for one of this parameters, contact the author or add it himself !(?) - But ... look for right testing! See using of this methods! ------------------------------------------------------------------------------------------------------------------*/ - -bool OComponentAccess::impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< XDesktop >& xOwner ) -{ - return xOwner.is(); -} } // namespace framework diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx index 3759a3adcbe7..4f96df15f476 100644 --- a/framework/source/helper/oframes.cxx +++ b/framework/source/helper/oframes.cxx @@ -62,7 +62,7 @@ void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) thr // Safe impossible cases // Method is not defined for ALL incoming parameters! - SAL_WARN_IF( !impldbg_checkParameter_append( xFrame ), "fwk", "OFrames::append(): Invalid parameter detected!" ); + SAL_WARN_IF( !xFrame.is(), "fwk", "OFrames::append(): Invalid parameter detected!" ); // Do the follow only, if owner instance valid! // Lock owner for follow operations - make a "hard reference"! @@ -85,7 +85,7 @@ void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) thr // Safe impossible cases // Method is not defined for ALL incoming parameters! - SAL_WARN_IF( !impldbg_checkParameter_remove( xFrame ), "fwk", "OFrames::remove(): Invalid parameter detected!" ); + SAL_WARN_IF( !xFrame.is(), "fwk", "OFrames::remove(): Invalid parameter detected!" ); // Do the follow only, if owner instance valid! // Lock owner for follow operations - make a "hard reference"! @@ -354,19 +354,6 @@ bool OFrames::impldbg_checkParameter_OFramesCtor( const css::uno::Reference< return xOwner.is() && pFrameContainer != nullptr; } -// Its only allowed to add valid references to container. -// AND - alle frames must support XFrames-interface! -bool OFrames::impldbg_checkParameter_append( const css::uno::Reference< XFrame >& xFrame ) -{ - return xFrame.is(); -} - -// Its only allowed to add valid references to container... -// ... => You can only delete valid references! -bool OFrames::impldbg_checkParameter_remove( const css::uno::Reference< XFrame >& xFrame ) -{ - return xFrame.is(); -} // A search for frames must initiate with right flags. // Some one are superflous and not supported yet. But here we control only the range of incoming parameter! diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index e99bec83b99e..c8bf51fe6a8e 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -1117,7 +1117,7 @@ void SAL_CALL Desktop::addEventListener( const css::uno::Reference< css::lang::X /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ // Safe impossible cases // Method not defined for all incoming parameter. - SAL_WARN_IF( implcp_addEventListener( xListener ), "fwk", "Desktop::addEventListener(): Invalid parameter detected!" ); + SAL_WARN_IF( !xListener.is(), "fwk", "Desktop::addEventListener(): Invalid parameter detected!" ); // Register transaction and reject wrong calls. TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); @@ -1129,7 +1129,7 @@ void SAL_CALL Desktop::removeEventListener( const css::uno::Reference< css::lang /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ // Safe impossible cases // Method not defined for all incoming parameter. - SAL_WARN_IF( implcp_removeEventListener( xListener ), "fwk", "Desktop::removeEventListener(): Invalid parameter detected!" ); + SAL_WARN_IF( !xListener.is(), "fwk", "Desktop::removeEventListener(): Invalid parameter detected!" ); // Register transaction and reject wrong calls. TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); @@ -1738,18 +1738,6 @@ bool Desktop::impl_closeFrames(bool bAllowUI) return (nNonClosedFrames < 1); } -// We work with valid listener only. -bool Desktop::implcp_addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) -{ - return !xListener.is(); -} - -// We work with valid listener only. -bool Desktop::implcp_removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) -{ - return !xListener.is(); -} - } // namespace framework namespace { diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 1b649c8f6326..44ae069fa0a9 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -737,7 +737,7 @@ void SAL_CALL ToolbarsMenuController::itemActivated( const css::awt::MenuEvent& // Special code to determine the enable/disable state of this command FeatureStateEvent aFeatureStateEvent; aFeatureStateEvent.FeatureURL.Complete = aCmdVector[i]; - aFeatureStateEvent.IsEnabled = isContextSensitiveToolbarNonVisible(); + aFeatureStateEvent.IsEnabled = m_bResetActive; // is context sensitive toolbar non visible statusChanged( aFeatureStateEvent ); } } |