From 4d6560f5066d143552cba861aaadc2f49b4357d4 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Tue, 4 Mar 2014 08:41:53 -0300 Subject: fdo#54938: Convert some places to use cppu::supportsService The last cases are non obvious, so it's pratically done Change-Id: Icae1da8e238f516eaed0f7fbdf96fff778eac547 Reviewed-on: https://gerrit.libreoffice.org/8445 Reviewed-by: Marcos Paulo de Souza Tested-by: Marcos Paulo de Souza --- .../source/uielement/popuptoolbarcontroller.cxx | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'framework/source/uielement') diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index e0ce22aba52e..51274af905bc 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -46,7 +47,11 @@ using namespace framework; namespace { -class PopupMenuToolbarController : public svt::ToolboxController +typedef cppu::ImplInheritanceHelper1< svt::ToolboxController, + css::lang::XServiceInfo > + ToolBarBase; + +class PopupMenuToolbarController : public ToolBarBase { public: virtual ~PopupMenuToolbarController(); @@ -80,8 +85,7 @@ private: PopupMenuToolbarController::PopupMenuToolbarController( const css::uno::Reference< css::uno::XComponentContext >& xContext, const OUString &rPopupCommand ) - : svt::ToolboxController() - , m_xContext( xContext ) + : m_xContext( xContext ) , m_bHasController( sal_False ) , m_aPopupCommand( rPopupCommand ) { @@ -249,14 +253,11 @@ public: WizardsToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); // XServiceInfo - OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException); - sal_Bool SAL_CALL supportsService(OUString const & rServiceName) - throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException); - css::uno::Sequence SAL_CALL getSupportedServiceNames() - throw (css::uno::RuntimeException); + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException); private: sal_uInt16 getDropDownStyle() const; @@ -277,7 +278,7 @@ OUString WizardsToolbarController::getImplementationName() sal_Bool WizardsToolbarController::supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException) { - return rServiceName == "com.sun.star.frame.ToolbarController"; + return cppu::supportsService( this, rServiceName ); } css::uno::Sequence WizardsToolbarController::getSupportedServiceNames() @@ -300,14 +301,11 @@ public: OpenToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); // XServiceInfo - OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException); + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException); - sal_Bool SAL_CALL supportsService(OUString const & rServiceName) - throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException); - css::uno::Sequence SAL_CALL getSupportedServiceNames() - throw (css::uno::RuntimeException); + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException); }; OpenToolbarController::OpenToolbarController( @@ -325,7 +323,7 @@ OUString OpenToolbarController::getImplementationName() sal_Bool OpenToolbarController::supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException) { - return rServiceName == "com.sun.star.frame.ToolbarController"; + return cppu::supportsService( this, rServiceName ); } css::uno::Sequence OpenToolbarController::getSupportedServiceNames() @@ -346,8 +344,7 @@ public: OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException); - sal_Bool SAL_CALL supportsService(OUString const & rServiceName) - throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException); css::uno::Sequence SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException); @@ -378,7 +375,7 @@ OUString NewToolbarController::getImplementationName() sal_Bool NewToolbarController::supportsService(OUString const & rServiceName) throw (css::uno::RuntimeException) { - return rServiceName == "com.sun.star.frame.ToolbarController"; + return cppu::supportsService( this, rServiceName ); } css::uno::Sequence NewToolbarController::getSupportedServiceNames() -- cgit