From 7c704c78d3c652504c064b4ac7af55a2c1ee49bb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 21 Jan 2012 15:21:16 +0100 Subject: Removed some unused parameters; added SAL_UNUSED_PARAMETER. SAL_UNUSED_PARAMETER (expanding to __attribute__ ((unused)) for GCC) is used to annotate legitimately unused parameters, so that static analysis tools can tell legitimately unused parameters from truly unnecessary ones. To that end, some patches for external modules are also added, that are only applied when compiling with GCC and add necessary __attribute__ ((unused)) in headers. --- embeddedobj/source/commonembedding/embedobj.cxx | 6 ++---- embeddedobj/source/commonembedding/miscobj.cxx | 3 +-- embeddedobj/source/commonembedding/register.cxx | 4 +++- embeddedobj/source/general/docholder.cxx | 4 ++-- embeddedobj/source/general/dummyobject.cxx | 9 +++------ embeddedobj/source/inc/commonembobj.hxx | 4 +--- embeddedobj/source/inc/dummyobject.hxx | 3 +-- embeddedobj/source/inc/oleembobj.hxx | 1 - embeddedobj/source/msole/olepersist.cxx | 5 ++--- embeddedobj/source/msole/oleregister.cxx | 4 +++- 10 files changed, 18 insertions(+), 25 deletions(-) (limited to 'embeddedobj') diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 4303a18f8221..337b01beb12d 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -496,8 +496,7 @@ void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState ) // let the object window be shown if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE ) - PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ), - uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); + PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ) ); } } @@ -635,8 +634,7 @@ void SAL_CALL OCommonEmbeddedObject::update() throw embed::WrongStateException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object has no persistence!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); - PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ), - uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); + PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ) ); } //---------------------------------------------- diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index 1a34b4c615bd..475fd87c94ee 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -326,8 +326,7 @@ void OCommonEmbeddedObject::requestPositioning( const awt::Rectangle& aRect ) } //------------------------------------------------------ -void OCommonEmbeddedObject::PostEvent_Impl( const ::rtl::OUString& aEventName, - const uno::Reference< uno::XInterface >& /*xSource*/ ) +void OCommonEmbeddedObject::PostEvent_Impl( const ::rtl::OUString& aEventName ) { if ( m_pInterfaceContainer ) { diff --git a/embeddedobj/source/commonembedding/register.cxx b/embeddedobj/source/commonembedding/register.cxx index 632871dfa962..ce7d28be5bbb 100644 --- a/embeddedobj/source/commonembedding/register.cxx +++ b/embeddedobj/source/commonembedding/register.cxx @@ -38,7 +38,9 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, + SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index c0b4990d3576..0d4a43ee636b 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -1222,7 +1222,7 @@ void SAL_CALL DocumentHolder::modified( const lang::EventObject& aEvent ) // if the component does not support document::XEventBroadcaster // the modify notifications are used as workaround, but only for running state if( aEvent.Source == m_xComponent && m_pEmbedObj && m_pEmbedObj->getCurrentState() == embed::EmbedStates::RUNNING ) - m_pEmbedObj->PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ), aEvent.Source ); + m_pEmbedObj->PostEvent_Impl( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnVisAreaChanged" ) ) ); } //--------------------------------------------------------------------------- @@ -1237,7 +1237,7 @@ void SAL_CALL DocumentHolder::notifyEvent( const document::EventObject& Event ) && !Event.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnSaveAs" ) ) && !Event.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnSaveAsDone" ) ) && !( Event.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnVisAreaChanged" ) ) && m_nNoResizeReact ) ) - m_pEmbedObj->PostEvent_Impl( Event.EventName, Event.Source ); + m_pEmbedObj->PostEvent_Impl( Event.EventName ); } } diff --git a/embeddedobj/source/general/dummyobject.cxx b/embeddedobj/source/general/dummyobject.cxx index d5a7fc54f7ba..eac8a8aa94af 100644 --- a/embeddedobj/source/general/dummyobject.cxx +++ b/embeddedobj/source/general/dummyobject.cxx @@ -59,8 +59,7 @@ void ODummyEmbeddedObject::CheckInit() } //---------------------------------------------- -void ODummyEmbeddedObject::PostEvent_Impl( const ::rtl::OUString& aEventName, - const uno::Reference< uno::XInterface >& /*xSource*/ ) +void ODummyEmbeddedObject::PostEvent_Impl( const ::rtl::OUString& aEventName ) { if ( m_pInterfaceContainer ) { @@ -411,8 +410,7 @@ void SAL_CALL ODummyEmbeddedObject::storeAsEntry( const uno::Reference< embed::X ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The object waits for saveCompleted() call!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); - PostEvent_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveAs" )), - uno::Reference< uno::XInterface >( static_cast< cppu::OWeakObject* >( this ) ) ); + PostEvent_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveAs" )) ); m_xParentStorage->copyElementTo( m_aEntryName, xStorage, sEntName ); @@ -447,8 +445,7 @@ void SAL_CALL ODummyEmbeddedObject::saveCompleted( sal_Bool bUseNew ) m_xParentStorage = m_xNewParentStorage; m_aEntryName = m_aNewEntryName; - PostEvent_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveAsDone" )), - uno::Reference< uno::XInterface >( static_cast< cppu::OWeakObject* >( this ) ) ); + PostEvent_Impl( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OnSaveAsDone" )) ); } m_xNewParentStorage = uno::Reference< embed::XStorage >(); diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index cd5ff0341f9b..14c992fc0d09 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -258,9 +258,7 @@ public: void requestPositioning( const ::com::sun::star::awt::Rectangle& aRect ); // not a real listener and should not be - void PostEvent_Impl( const ::rtl::OUString& aEventName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource = - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); + void PostEvent_Impl( const ::rtl::OUString& aEventName ); // XInterface diff --git a/embeddedobj/source/inc/dummyobject.hxx b/embeddedobj/source/inc/dummyobject.hxx index 4655bbc3d81b..2bcb9baac0e1 100644 --- a/embeddedobj/source/inc/dummyobject.hxx +++ b/embeddedobj/source/inc/dummyobject.hxx @@ -85,8 +85,7 @@ class ODummyEmbeddedObject : public ::cppu::WeakImplHelper2 protected: void CheckInit(); - void PostEvent_Impl( const ::rtl::OUString& aEventName, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xSource ); + void PostEvent_Impl( const ::rtl::OUString& aEventName ); public: diff --git a/embeddedobj/source/inc/oleembobj.hxx b/embeddedobj/source/inc/oleembobj.hxx index 8d34e8fbce5b..a772b8b2d48a 100644 --- a/embeddedobj/source/inc/oleembobj.hxx +++ b/embeddedobj/source/inc/oleembobj.hxx @@ -240,7 +240,6 @@ protected: void StoreToLocation_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs, sal_Bool bSaveAs ) throw ( ::com::sun::star::uno::Exception ); diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index 9d2c23a18990..196dba92a883 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -1102,7 +1102,6 @@ void OleEmbeddedObject::StoreObjectToStream( uno::Reference< io::XOutputStream > void OleEmbeddedObject::StoreToLocation_Impl( const uno::Reference< embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, - const uno::Sequence< beans::PropertyValue >& /*lArguments*/, const uno::Sequence< beans::PropertyValue >& lObjArgs, sal_Bool bSaveAs ) throw ( uno::Exception ) @@ -1551,7 +1550,7 @@ void SAL_CALL OleEmbeddedObject::storeToEntry( const uno::Reference< embed::XSto VerbExecutionControllerGuard aVerbGuard( m_aVerbExecutionController ); - StoreToLocation_Impl( xStorage, sEntName, lArguments, lObjArgs, sal_False ); + StoreToLocation_Impl( xStorage, sEntName, lObjArgs, sal_False ); // TODO: should the listener notification be done? } @@ -1585,7 +1584,7 @@ void SAL_CALL OleEmbeddedObject::storeAsEntry( const uno::Reference< embed::XSto VerbExecutionControllerGuard aVerbGuard( m_aVerbExecutionController ); - StoreToLocation_Impl( xStorage, sEntName, lArguments, lObjArgs, sal_True ); + StoreToLocation_Impl( xStorage, sEntName, lObjArgs, sal_True ); // TODO: should the listener notification be done here or in saveCompleted? } diff --git a/embeddedobj/source/msole/oleregister.cxx b/embeddedobj/source/msole/oleregister.cxx index cf1849774abc..608e69ffa395 100644 --- a/embeddedobj/source/msole/oleregister.cxx +++ b/embeddedobj/source/msole/oleregister.cxx @@ -38,7 +38,9 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, + SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) { void * pRet = 0; -- cgit v1.2.3