Kaydet (Commit) 98460e7a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:expandablemethods in framework

Change-Id: I444f31f06d2445392a59879c2d7fb1f8ad1c24c6
Reviewed-on: https://gerrit.libreoffice.org/30684Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1a743fd8
...@@ -119,7 +119,6 @@ class PopupMenuDispatcher : public ::cppu::WeakImplHelper< ...@@ -119,7 +119,6 @@ class PopupMenuDispatcher : public ::cppu::WeakImplHelper<
virtual ~PopupMenuDispatcher() override; virtual ~PopupMenuDispatcher() override;
void impl_RetrievePopupControllerQuery(); void impl_RetrievePopupControllerQuery();
void impl_CreateUriRefFactory();
// variables // variables
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
namespace framework{ namespace framework{
/* /**
@short implement XFrames, XIndexAccess and XElementAccess interfaces as helper for services @short implement XFrames, XIndexAccess and XElementAccess interfaces as helper for services
@descr Use this class as helper for these interfaces. We share mutex and framecontainer with our owner. @descr Use this class as helper for these interfaces. We share mutex and framecontainer with our owner.
The framecontainer is a member of it from type "FrameContainer". That means; The framecontainer is a member of it from type "FrameContainer". That means;
...@@ -42,22 +42,15 @@ namespace framework{ ...@@ -42,22 +42,15 @@ namespace framework{
to prevent against compete access. In future we plan support of semaphore! to prevent against compete access. In future we plan support of semaphore!
@devstatus deprecated @devstatus deprecated
@implements XInterface
XFrames
XIndexAccess
XElementAccess
@base OWeakObject
@ATTENTION Don't use this class as direct member - use it dynamicly. Do not derive from this class. @ATTENTION Don't use this class as direct member - use it dynamically. Do not derive from this class.
We hold a weakreference to our owner not to our superclass. We hold a weakreference to our owner not to our superclass.
@devstatus deprecated
*/ */
class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
{ {
public: public:
/* /**
@short standard ctor @short standard ctor
@descr These initialize a new instance of this class with all needed information for work. @descr These initialize a new instance of this class with all needed information for work.
We share framecontainer with owner implementation! It's a threadsafe container. We share framecontainer with owner implementation! It's a threadsafe container.
...@@ -69,7 +62,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -69,7 +62,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
// XFrames // XFrames
/* /**
@short append frame to container @short append frame to container
@descr We share the container with our owner. We can do this only, if no lock is set on container. @descr We share the container with our owner. We can do this only, if no lock is set on container.
Valid references are accepted only! Valid references are accepted only!
...@@ -81,7 +74,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -81,7 +74,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
*/ */
virtual void SAL_CALL append( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL append( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException, std::exception ) override;
/* /**
@short remove frame from container @short remove frame from container
@descr This is the companion to append(). We only accept valid references and don't work, if @descr This is the companion to append(). We only accept valid references and don't work, if
a lock is set. a lock is set.
...@@ -93,7 +86,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -93,7 +86,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
*/ */
virtual void SAL_CALL remove( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL remove( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException, std::exception ) override;
/* /**
@short return list of all applicable frames for given flags @short return list of all applicable frames for given flags
@descr Call these to get a list of all frames, which are match with given search flags. @descr Call these to get a list of all frames, which are match with given search flags.
@param "nSearchFlag", flags to search right frames. @param "nSearchFlag", flags to search right frames.
...@@ -105,7 +98,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -105,7 +98,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
// XIndexAccess // XIndexAccess
/* /**
@short get count of all current frames in container @short get count of all current frames in container
@descr This is the beginning of full index-access. With a count you can step over all items in container. @descr This is the beginning of full index-access. With a count you can step over all items in container.
Next call should be getByIndex(). But these mechanism works only, if no lock in container is set! Next call should be getByIndex(). But these mechanism works only, if no lock in container is set!
...@@ -118,7 +111,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -118,7 +111,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
*/ */
virtual sal_Int32 SAL_CALL getCount() throw( css::uno::RuntimeException, std::exception ) override; virtual sal_Int32 SAL_CALL getCount() throw( css::uno::RuntimeException, std::exception ) override;
/* /**
@short get specified container item by index @short get specified container item by index
@descr If you called getCount() successful - this method return the specified element as an Any. @descr If you called getCount() successful - this method return the specified element as an Any.
You must observe the range from 0 to count-1! Otherwise an IndexOutOfBoundsException is thrown. You must observe the range from 0 to count-1! Otherwise an IndexOutOfBoundsException is thrown.
...@@ -138,7 +131,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -138,7 +131,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
// XElementAccess // XElementAccess
/* /**
@short get uno-type of all container items @short get uno-type of all container items
@descr In current implementation type is fixed to XFrame! @descr In current implementation type is fixed to XFrame!
(container-lock is ignored) (container-lock is ignored)
...@@ -146,7 +139,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -146,7 +139,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
*/ */
virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException, std::exception ) override; virtual css::uno::Type SAL_CALL getElementType() throw( css::uno::RuntimeException, std::exception ) override;
/* /**
@short get fill state of current container @short get fill state of current container
@descr Call these to get information about, if items exist in container or not. @descr Call these to get information about, if items exist in container or not.
(container-lock is ignored) (container-lock is ignored)
...@@ -159,7 +152,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -159,7 +152,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
protected: protected:
/* /**
@short standard destructor @short standard destructor
@descr This method destruct an instance of this class and clear some member. @descr This method destruct an instance of this class and clear some member.
This method is protected, because it's not allowed to use this class as a member! This method is protected, because it's not allowed to use this class as a member!
...@@ -167,7 +160,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -167,7 +160,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
*/ */
virtual ~OFrames() override; virtual ~OFrames() override;
/* /**
@short reset instance to default values @short reset instance to default values
@descr There are two ways to delete an instance of this class.<BR> @descr There are two ways to delete an instance of this class.<BR>
1) delete with destructor<BR> 1) delete with destructor<BR>
...@@ -181,7 +174,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -181,7 +174,7 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
private: private:
/* /**
@short append one sequence to another @short append one sequence to another
@descr There is no operation to add to sequences! Use this helper-method to do this. @descr There is no operation to add to sequences! Use this helper-method to do this.
...@@ -194,30 +187,9 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames > ...@@ -194,30 +187,9 @@ class OFrames : public ::cppu::WeakImplHelper< css::frame::XFrames >
void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination , void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination ,
const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqSource ); const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqSource );
// 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: private:
static bool impldbg_checkParameter_OFramesCtor ( const css::uno::Reference< css::frame::XFrame >& xOwner ,
FrameContainer* pFrameContainer );
static bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); static bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags );
// variables
// (should be private everyway!)
private:
css::uno::WeakReference< css::frame::XFrame > m_xOwner; /// reference to owner of this instance (Hold no hard reference!) css::uno::WeakReference< css::frame::XFrame > m_xOwner; /// reference to owner of this instance (Hold no hard reference!)
FrameContainer* m_pFrameContainer; /// with owner shared list to hold all direct children of an XFramesSupplier FrameContainer* m_pFrameContainer; /// with owner shared list to hold all direct children of an XFramesSupplier
bool m_bRecursiveSearchProtection; /// flag to protect against recursive searches of frames at parents bool m_bRecursiveSearchProtection; /// flag to protect against recursive searches of frames at parents
......
...@@ -96,7 +96,6 @@ class FWI_DLLPUBLIC ConstItemContainer : public ::cppu::WeakImplHelper< ...@@ -96,7 +96,6 @@ class FWI_DLLPUBLIC ConstItemContainer : public ::cppu::WeakImplHelper<
private: private:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
static css::uno::Reference < css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo( ::cppu::IPropertyArrayHelper & rProperties );
void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector ); void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector );
css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer ); css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer );
......
...@@ -90,7 +90,6 @@ class StatusBarManager : public ::cppu::WeakImplHelper< ...@@ -90,7 +90,6 @@ class StatusBarManager : public ::cppu::WeakImplHelper<
void RemoveControllers(); void RemoveControllers();
void CreateControllers(); void CreateControllers();
void UpdateControllers(); void UpdateControllers();
void AddFrameActionListener();
void MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL css::frame::XStatusbarController::*_pMethod )(const css::awt::MouseEvent&)); void MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL css::frame::XStatusbarController::*_pMethod )(const css::awt::MouseEvent&));
protected: protected:
......
...@@ -99,12 +99,6 @@ public: ...@@ -99,12 +99,6 @@ public:
/** read all data into the cache. */ /** read all data into the cache. */
void fillCache(); void fillCache();
private:
/** forget all currently cached data AND(!)
forget all currently used storages. */
void clearCache();
}; };
DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(
...@@ -147,7 +141,8 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer ...@@ -147,7 +141,8 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer
} }
if (bForgetOldStorages) if (bForgetOldStorages)
clearCache(); /* forget all currently cached data AND(!) forget all currently used storages. */
m_aPresetHandler.forgetCachedStorages();
if (xStorage.is()) if (xStorage.is())
fillCache(); fillCache();
...@@ -200,11 +195,6 @@ void DocumentAcceleratorConfiguration::fillCache() ...@@ -200,11 +195,6 @@ void DocumentAcceleratorConfiguration::fillCache()
{} {}
} }
void DocumentAcceleratorConfiguration::clearCache()
{
m_aPresetHandler.forgetCachedStorages();
}
} // namespace framework } // namespace framework
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
......
...@@ -171,7 +171,8 @@ throw( css::uno::RuntimeException, std::exception ) ...@@ -171,7 +171,8 @@ throw( css::uno::RuntimeException, std::exception )
// --- SAFE --- // --- SAFE ---
SolarMutexClearableGuard aGuard; SolarMutexClearableGuard aGuard;
impl_RetrievePopupControllerQuery(); impl_RetrievePopupControllerQuery();
impl_CreateUriRefFactory(); if ( !m_xUriRefFactory.is() )
m_xUriRefFactory = css::uri::UriReferenceFactory::create( m_xContext );
css::uno::Reference< css::container::XNameAccess > xPopupCtrlQuery( m_xPopupCtrlQuery ); css::uno::Reference< css::container::XNameAccess > xPopupCtrlQuery( m_xPopupCtrlQuery );
css::uno::Reference< css::uri::XUriReferenceFactory > xUriRefFactory( m_xUriRefFactory ); css::uno::Reference< css::uri::XUriReferenceFactory > xUriRefFactory( m_xUriRefFactory );
...@@ -337,14 +338,6 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery() ...@@ -337,14 +338,6 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
} }
} }
void PopupMenuDispatcher::impl_CreateUriRefFactory()
{
if ( !m_xUriRefFactory.is() )
{
m_xUriRefFactory = css::uri::UriReferenceFactory::create( m_xContext );
}
}
} // namespace framework } // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -127,11 +127,6 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, VclWindowEvent&, rEvent, vo ...@@ -127,11 +127,6 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, VclWindowEvent&, rEvent, vo
return; return;
} }
impl_dispatchCommand(sCommand);
}
void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
{
// ignore all errors here. It's clicking a menu entry only ... // ignore all errors here. It's clicking a menu entry only ...
// The user will try it again, in case nothing happens .-) // The user will try it again, in case nothing happens .-)
try try
......
...@@ -287,11 +287,6 @@ namespace framework ...@@ -287,11 +287,6 @@ namespace framework
void notify( OUString const& i_title, void notify( OUString const& i_title,
void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& ) void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& )
); );
void notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& ) )
{
notify( OUString(), i_notificationMethod );
}
void notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const EventObject& ) ); void notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const EventObject& ) );
private: private:
...@@ -825,7 +820,7 @@ namespace framework ...@@ -825,7 +820,7 @@ namespace framework
if ( m_bAPIActionRunning ) if ( m_bAPIActionRunning )
return; return;
notify( &XUndoManagerListener::cancelledContext ); notify( OUString(), &XUndoManagerListener::cancelledContext );
} }
void UndoManagerHelper_Impl::undoManagerDying() void UndoManagerHelper_Impl::undoManagerDying()
......
...@@ -230,7 +230,7 @@ throw (css::uno::RuntimeException, std::exception) ...@@ -230,7 +230,7 @@ throw (css::uno::RuntimeException, std::exception)
{ {
// Create structure of propertysetinfo for baseclass "OPropertySetHelper". // Create structure of propertysetinfo for baseclass "OPropertySetHelper".
// (Use method "getInfoHelper()".) // (Use method "getInfoHelper()".)
static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); static Reference< XPropertySetInfo > xInfo = new ::comphelper::PropertySetInfo(getInfoHelper().getProperties());
pInfo = &xInfo; pInfo = &xInfo;
} }
} }
...@@ -337,13 +337,6 @@ const css::uno::Sequence< css::beans::Property > ConstItemContainer::impl_getSta ...@@ -337,13 +337,6 @@ const css::uno::Sequence< css::beans::Property > ConstItemContainer::impl_getSta
return lPropertyDescriptor; return lPropertyDescriptor;
} }
Reference < XPropertySetInfo > ConstItemContainer::createPropertySetInfo(
IPropertyArrayHelper & rProperties )
{
return static_cast<XPropertySetInfo *>(
new ::comphelper::PropertySetInfo(rProperties.getProperties()));
}
} // namespace framework } // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -42,12 +42,13 @@ OFrames::OFrames( const css::uno::Reference< XFrame >& xOwner ...@@ -42,12 +42,13 @@ OFrames::OFrames( const css::uno::Reference< XFrame >& xOwner
, m_pFrameContainer ( pFrameContainer ) , m_pFrameContainer ( pFrameContainer )
, m_bRecursiveSearchProtection( false ) , m_bRecursiveSearchProtection( false )
{ {
// Safe impossible cases // An instance of this class can only work with valid initialization.
// Method is not defined for ALL incoming parameters! // We share the mutex with our owner class, need a valid factory to instanciate new services and
SAL_WARN_IF( !impldbg_checkParameter_OFramesCtor( xOwner, pFrameContainer ), "fwk", "OFrames::OFrames(): Invalid parameter detected!" ); // use the access to our owner for some operations.
SAL_WARN_IF( !xOwner.is() || !pFrameContainer, "fwk", "OFrames::OFrames(): Invalid parameter detected!" );
} }
// (proteced!) destructor // (protected!) destructor
OFrames::~OFrames() OFrames::~OFrames()
{ {
...@@ -345,16 +346,6 @@ void OFrames::impl_appendSequence( Sequence< css::uno::Reference< XFram ...@@ -345,16 +346,6 @@ void OFrames::impl_appendSequence( Sequence< css::uno::Reference< XFram
But ... look for right testing! See using of this methods! But ... look for right testing! See using of this methods!
-----------------------------------------------------------------------------------------------------------------*/ -----------------------------------------------------------------------------------------------------------------*/
// An instance of this class can only work with valid initialization.
// We share the mutex with our owner class, need a valid factory to instanciate new services and
// use the access to our owner for some operations.
bool OFrames::impldbg_checkParameter_OFramesCtor( const css::uno::Reference< XFrame >& xOwner ,
FrameContainer* pFrameContainer )
{
return xOwner.is() && pFrameContainer != nullptr;
}
// A search for frames must initiate with right flags. // 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! // Some one are superflous and not supported yet. But here we control only the range of incoming parameter!
bool OFrames::impldbg_checkParameter_queryFrames( sal_Int32 nSearchFlags ) bool OFrames::impldbg_checkParameter_queryFrames( sal_Int32 nSearchFlags )
......
...@@ -104,14 +104,7 @@ class WindowCommandDispatch final ...@@ -104,14 +104,7 @@ class WindowCommandDispatch final
*/ */
DECL_LINK( impl_notifyCommand, VclWindowEvent&, void ); DECL_LINK( impl_notifyCommand, VclWindowEvent&, void );
/** @short dispatch right command URLs into our frame context. }; // class WindowCommandDispatch
@param sCommand
the command for dispatch
*/
void impl_dispatchCommand(const OUString& sCommand);
}; // class MACDispatch
} // namespace framework } // namespace framework
......
...@@ -388,11 +388,7 @@ void StatusBarManager::CreateControllers() ...@@ -388,11 +388,7 @@ void StatusBarManager::CreateControllers()
} }
} }
AddFrameActionListener(); // add frame action listeners
}
void StatusBarManager::AddFrameActionListener()
{
if ( !m_bFrameActionRegistered && m_xFrame.is() ) if ( !m_bFrameActionRegistered && m_xFrame.is() )
{ {
m_bFrameActionRegistered = true; m_bFrameActionRegistered = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment