summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/svtools/toolboxcontroller.hxx20
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx39
2 files changed, 29 insertions, 30 deletions
diff --git a/include/svtools/toolboxcontroller.hxx b/include/svtools/toolboxcontroller.hxx
index 021fe41c2967..17178217c236 100644
--- a/include/svtools/toolboxcontroller.hxx
+++ b/include/svtools/toolboxcontroller.hxx
@@ -30,7 +30,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/proparrhlp.hxx>
@@ -46,15 +46,17 @@ class ToolBox;
namespace svt
{
-class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusListener,
- public ::com::sun::star::frame::XToolbarController,
- public ::com::sun::star::lang::XInitialization,
- public ::com::sun::star::util::XUpdatable,
- public ::com::sun::star::lang::XComponent,
+typedef cppu::WeakImplHelper5<
+ css::frame::XStatusListener, css::frame::XToolbarController,
+ css::lang::XInitialization, css::util::XUpdatable,
+ css::lang::XComponent >
+ ToolboxController_Base;
+
+class SVT_DLLPUBLIC ToolboxController :
+ public ToolboxController_Base,
public ::comphelper::OMutexAndBroadcastHelper,
public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >,
- public ::cppu::OWeakObject
+ public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >
{
private:
sal_Bool m_bSupportVisible;
@@ -76,6 +78,8 @@ class SVT_DLLPUBLIC ToolboxController : public ::com::sun::star::frame::XStatusL
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL acquire() throw ();
virtual void SAL_CALL release() throw ();
+ virtual css::uno::Sequence<css::uno::Type> SAL_CALL getTypes()
+ throw (css::uno::RuntimeException);
// XInitialization
virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
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<XPropertySet*>(this)
- ,static_cast<XMultiPropertySet*>(this)
- ,static_cast<XFastPropertySet*>(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<css::uno::Type> ToolboxController::getTypes()
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence<css::uno::Type> s1(ToolboxController_Base::getTypes());
+ css::uno::Sequence<css::uno::Type> 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 )