From 307684b2c735947e81aa061b8e16fa197fc15857 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 12 Feb 2014 12:02:17 +0100 Subject: Clean-up svt::ToolboxController inheritance ...and fix its XTypeProvider::getTypes Change-Id: Ic36b17b14da21a29ca5530dd5e2ad03ee3da0782 --- svtools/source/uno/toolboxcontroller.cxx | 39 ++++++++++++++------------------ 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'svtools') diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index e66d7c5a2ae0..7b8f9af6c1c8 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -54,7 +54,6 @@ ToolboxController::ToolboxController( const Reference< XFrame >& xFrame, const OUString& aCommandURL ) : OPropertyContainer(GetBroadcastHelper()) - , OWeakObject() , m_bSupportVisible(sal_False) , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) @@ -81,7 +80,6 @@ ToolboxController::ToolboxController( ToolboxController::ToolboxController() : OPropertyContainer(GetBroadcastHelper()) - , OWeakObject() , m_bSupportVisible(sal_False) , m_bInitialized( sal_False ) , m_bDisposed( sal_False ) @@ -137,34 +135,31 @@ Reference< XLayoutManager > ToolboxController::getLayoutManager() const Any SAL_CALL ToolboxController::queryInterface( const Type& rType ) throw ( RuntimeException ) { - Any a = ::cppu::queryInterface( - rType , - static_cast< XToolbarController* >( this ), - static_cast< XStatusListener* >( this ), - static_cast< XEventListener* >( this ), - static_cast< XInitialization* >( this ), - static_cast< XComponent* >( this ), - static_cast< XUpdatable* >( this )); - if ( !a.hasValue()) - { - a = ::cppu::queryInterface(rType - ,static_cast(this) - ,static_cast(this) - ,static_cast(this)); - if (!a.hasValue()) - return OWeakObject::queryInterface( rType ); - } - return a; + css::uno::Any a(ToolboxController_Base::queryInterface(rType)); + return a.hasValue() ? a : OPropertyContainer::queryInterface(rType); } void SAL_CALL ToolboxController::acquire() throw () { - OWeakObject::acquire(); + ToolboxController_Base::acquire(); } void SAL_CALL ToolboxController::release() throw () { - OWeakObject::release(); + ToolboxController_Base::release(); +} + +css::uno::Sequence ToolboxController::getTypes() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence s1(ToolboxController_Base::getTypes()); + css::uno::Sequence s2(OPropertyContainer::getTypes()); + sal_Int32 n = s1.getLength(); + s1.realloc(n + s2.getLength()); + for (sal_Int32 i = 0; i != s2.getLength(); ++i) { + s1[n + i] = s2[i]; + } + return s1; } void SAL_CALL ToolboxController::initialize( const Sequence< Any >& aArguments ) -- cgit