diff options
-rw-r--r-- | UnoControls/inc/basecontainercontrol.hxx | 8 | ||||
-rw-r--r-- | UnoControls/inc/basecontrol.hxx | 19 | ||||
-rw-r--r-- | UnoControls/source/base/basecontainercontrol.cxx | 51 | ||||
-rw-r--r-- | UnoControls/source/base/basecontrol.cxx | 79 | ||||
-rw-r--r-- | UnoControls/source/base/multiplexer.cxx | 2 | ||||
-rw-r--r-- | UnoControls/source/controls/framecontrol.cxx | 55 | ||||
-rw-r--r-- | UnoControls/source/controls/progressbar.cxx | 47 | ||||
-rw-r--r-- | UnoControls/source/controls/progressmonitor.cxx | 48 | ||||
-rw-r--r-- | UnoControls/source/controls/statusindicator.cxx | 47 | ||||
-rw-r--r-- | UnoControls/source/inc/framecontrol.hxx | 6 | ||||
-rw-r--r-- | UnoControls/source/inc/progressbar.hxx | 4 | ||||
-rw-r--r-- | UnoControls/source/inc/progressmonitor.hxx | 4 | ||||
-rw-r--r-- | UnoControls/source/inc/statusindicator.hxx | 4 |
13 files changed, 97 insertions, 277 deletions
diff --git a/UnoControls/inc/basecontainercontrol.hxx b/UnoControls/inc/basecontainercontrol.hxx index 3d5b08f81d7f..18e027cc43d5 100644 --- a/UnoControls/inc/basecontainercontrol.hxx +++ b/UnoControls/inc/basecontainercontrol.hxx @@ -74,12 +74,6 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XAggregation - - virtual css::uno::Any SAL_CALL queryAggregation( - const css::uno::Type& aType - ) override; - // XControl virtual void SAL_CALL createPeer( @@ -127,7 +121,7 @@ public: virtual void SAL_CALL setVisible( sal_Bool bVisible ) override; protected: - using OComponentHelper::disposing; + using WeakComponentImplHelper::disposing; virtual css::awt::WindowDescriptor impl_getWindowDescriptor( const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer diff --git a/UnoControls/inc/basecontrol.hxx b/UnoControls/inc/basecontrol.hxx index 30f2dd4414e0..9f60537bb7cb 100644 --- a/UnoControls/inc/basecontrol.hxx +++ b/UnoControls/inc/basecontrol.hxx @@ -25,7 +25,7 @@ #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XView.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <cppuhelper/component.hxx> +#include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> #include <rtl/ref.hxx> @@ -46,7 +46,7 @@ class BaseControl : public css::lang::XServiceInfo , public css::awt::XWindow , public css::awt::XControl , public cppu::BaseMutex - , public ::cppu::OComponentHelper + , public ::cppu::WeakComponentImplHelper<> { public: BaseControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); @@ -115,16 +115,6 @@ public: virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // XAggregation - - virtual void SAL_CALL setDelegator( - const css::uno::Reference< css::uno::XInterface >& xDelegator - ) override; - - virtual css::uno::Any SAL_CALL queryAggregation( - const css::uno::Type& aType - ) override; - // XServiceInfo virtual sal_Bool SAL_CALL supportsService( @@ -275,7 +265,7 @@ public: virtual void SAL_CALL windowHidden( const css::lang::EventObject& aEvent ) override; protected: - using OComponentHelper::disposing; + using WeakComponentImplHelper::disposing; const css::uno::Reference< css::uno::XComponentContext >& impl_getComponentContext() const { return m_xComponentContext;} @@ -297,13 +287,10 @@ protected: virtual void impl_recalcLayout( const css::awt::WindowEvent& aEvent ); - const css::uno::Reference< css::uno::XInterface >& impl_getDelegator() const { return m_xDelegator;} - private: OMRCListenerMultiplexerHelper* impl_getMultiplexer(); css::uno::Reference< css::uno::XComponentContext > m_xComponentContext; - css::uno::Reference< css::uno::XInterface > m_xDelegator; rtl::Reference<OMRCListenerMultiplexerHelper> m_xMultiplexer; // multiplex events css::uno::Reference< css::uno::XInterface > m_xContext; css::uno::Reference< css::awt::XWindowPeer > m_xPeer; diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx index 20eea9eb315f..7a6bd508e5b8 100644 --- a/UnoControls/source/base/basecontainercontrol.cxx +++ b/UnoControls/source/base/basecontainercontrol.cxx @@ -53,23 +53,25 @@ BaseContainerControl::~BaseContainerControl() Any SAL_CALL BaseContainerControl::queryInterface( const Type& rType ) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn; - Reference< XInterface > xDel = BaseControl::impl_getDelegator(); - if ( xDel.is() ) + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XControlModel* > ( this ) , + static_cast< XControlContainer* > ( this ) + ) + ); + + // If searched interface supported by this class ... + if ( aReturn.hasValue() ) { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = xDel->queryInterface( rType ); + // ... return this information. + return aReturn; } else { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // Else; ... ask baseclass for interfaces! + return BaseControl::queryInterface( rType ); } - - return aReturn; } // XTypeProvider @@ -84,31 +86,6 @@ Sequence< Type > SAL_CALL BaseContainerControl::getTypes() return ourTypeCollection.getTypes(); } -// XAggregation - -Any SAL_CALL BaseContainerControl::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XControlModel* > ( this ) , - static_cast< XControlContainer* > ( this ) - ) - ); - - // If searched interface supported by this class ... - if ( aReturn.hasValue() ) - { - // ... return this information. - return aReturn; - } - else - { - // Else; ... ask baseclass for interfaces! - return BaseControl::queryAggregation( aType ); - } -} - // XControl void SAL_CALL BaseContainerControl::createPeer( const Reference< XToolkit >& xToolkit , diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx index c2e2f23b12b0..d926323bd268 100644 --- a/UnoControls/source/base/basecontrol.cxx +++ b/UnoControls/source/base/basecontrol.cxx @@ -49,7 +49,7 @@ constexpr bool DEFAULT_ENABLE = true; // construct/destruct BaseControl::BaseControl( const Reference< XComponentContext >& rxContext ) - : OComponentHelper ( m_aMutex ) + : WeakComponentImplHelper ( m_aMutex ) , m_xComponentContext ( rxContext ) , m_nX ( DEFAULT_X ) , m_nY ( DEFAULT_Y ) @@ -69,20 +69,29 @@ BaseControl::~BaseControl() Any SAL_CALL BaseControl::queryInterface( const Type& rType ) { - Any aReturn; - if ( m_xDelegator.is() ) + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XPaintListener*> ( this ) , + static_cast< XWindowListener*> ( this ) , + static_cast< XView* > ( this ) , + static_cast< XWindow* > ( this ) , + static_cast< XServiceInfo* > ( this ) , + static_cast< XControl* > ( this ) + ) + ); + + // If searched interface supported by this class ... + if ( aReturn.hasValue() ) { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = m_xDelegator->queryInterface( rType ); + // ... return this information. + return aReturn; } else { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // Else; ... ask baseclass for interfaces! + return WeakComponentImplHelper::queryInterface( rType ); } - - return aReturn; } // XInterface @@ -93,7 +102,7 @@ void SAL_CALL BaseControl::acquire() noexcept // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass - OComponentHelper::acquire(); + WeakComponentImplHelper::acquire(); } // XInterface @@ -104,7 +113,7 @@ void SAL_CALL BaseControl::release() noexcept // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass - OComponentHelper::release(); + WeakComponentImplHelper::release(); } // XTypeProvider @@ -118,7 +127,7 @@ Sequence< Type > SAL_CALL BaseControl::getTypes() cppu::UnoType<XWindow>::get(), cppu::UnoType<XServiceInfo>::get(), cppu::UnoType<XControl>::get(), - OComponentHelper::getTypes() ); + WeakComponentImplHelper::getTypes() ); return ourTypeCollection.getTypes(); } @@ -130,44 +139,6 @@ Sequence< sal_Int8 > SAL_CALL BaseControl::getImplementationId() return css::uno::Sequence<sal_Int8>(); } -// XAggregation - -void SAL_CALL BaseControl::setDelegator( const Reference< XInterface >& xDel ) -{ - // Ready for multithreading - MutexGuard aGuard( m_aMutex ); - m_xDelegator = xDel; -} - -// XAggregation - -Any SAL_CALL BaseControl::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XPaintListener*> ( this ) , - static_cast< XWindowListener*> ( this ) , - static_cast< XView* > ( this ) , - static_cast< XWindow* > ( this ) , - static_cast< XServiceInfo* > ( this ) , - static_cast< XControl* > ( this ) - ) - ); - - // If searched interface supported by this class ... - if ( aReturn.hasValue() ) - { - // ... return this information. - return aReturn; - } - else - { - // Else; ... ask baseclass for interfaces! - return OComponentHelper::queryAggregation( aType ); - } -} - // XServiceInfo OUString SAL_CALL BaseControl::getImplementationName() @@ -203,7 +174,7 @@ void SAL_CALL BaseControl::dispose() } // set the service manager to disposed - OComponentHelper::dispose(); + WeakComponentImplHelper::dispose(); // release context and peer m_xContext.clear(); @@ -240,7 +211,7 @@ void SAL_CALL BaseControl::addEventListener( const Reference< XEventListener >& { // Ready for multithreading MutexGuard aGuard( m_aMutex ); - OComponentHelper::addEventListener( xListener ); + WeakComponentImplHelper::addEventListener( xListener ); } // XComponent @@ -249,7 +220,7 @@ void SAL_CALL BaseControl::removeEventListener( const Reference< XEventListener { // Ready for multithreading MutexGuard aGuard( m_aMutex ); - OComponentHelper::removeEventListener( xListener ); + WeakComponentImplHelper::removeEventListener( xListener ); } // XControl diff --git a/UnoControls/source/base/multiplexer.cxx b/UnoControls/source/base/multiplexer.cxx index c7bf65c170c1..0f0f34b68660 100644 --- a/UnoControls/source/base/multiplexer.cxx +++ b/UnoControls/source/base/multiplexer.cxx @@ -97,7 +97,7 @@ Any SAL_CALL OMRCListenerMultiplexerHelper::queryInterface( const Type& rType ) // Don't use mutex or guard in this method!!! Is a method of XInterface. // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! Any aReturn ( ::cppu::queryInterface( rType , static_cast< XWindowListener* > ( this ) , static_cast< XKeyListener* > ( this ) , diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx index 73decca46274..54a0f36f6d05 100644 --- a/UnoControls/source/controls/framecontrol.cxx +++ b/UnoControls/source/controls/framecontrol.cxx @@ -73,20 +73,23 @@ FrameControl::~FrameControl() Any SAL_CALL FrameControl::queryInterface( const Type& rType ) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn; - Reference< XInterface > xDel = BaseControl::impl_getDelegator(); - if ( xDel.is() ) - { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = xDel->queryInterface( rType ); - } - else + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XControlModel* > ( this ) , + static_cast< XConnectionPointContainer* > ( this ) + ) + ); + + // If searched interface not supported by this class ... + if ( !aReturn.hasValue() ) { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // ... ask baseclasses. + aReturn = OPropertySetHelper::queryInterface( rType ); + if ( !aReturn.hasValue() ) + { + aReturn = BaseControl::queryInterface( rType ); + } } return aReturn; @@ -127,32 +130,6 @@ Sequence< Type > SAL_CALL FrameControl::getTypes() return ourTypeCollection.getTypes(); } -// XAggregation - -Any SAL_CALL FrameControl::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XControlModel* > ( this ) , - static_cast< XConnectionPointContainer* > ( this ) - ) - ); - - // If searched interface not supported by this class ... - if ( !aReturn.hasValue() ) - { - // ... ask baseclasses. - aReturn = OPropertySetHelper::queryInterface( aType ); - if ( !aReturn.hasValue() ) - { - aReturn = BaseControl::queryAggregation( aType ); - } - } - - return aReturn; -} - OUString FrameControl::getImplementationName() { return "stardiv.UnoControls.FrameControl"; diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx index fbb0b13421c1..6ba8874fbb88 100644 --- a/UnoControls/source/controls/progressbar.cxx +++ b/UnoControls/source/controls/progressbar.cxx @@ -55,20 +55,19 @@ ProgressBar::~ProgressBar() Any SAL_CALL ProgressBar::queryInterface( const Type& rType ) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn; - Reference< XInterface > xDel = BaseControl::impl_getDelegator(); - if ( xDel.is() ) - { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = xDel->queryInterface( rType ); - } - else + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XControlModel* > ( this ) , + static_cast< XProgressBar* > ( this ) + ) + ); + + // If searched interface not supported by this class ... + if ( !aReturn.hasValue() ) { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // ... ask baseclasses. + aReturn = BaseControl::queryInterface( rType ); } return aReturn; @@ -108,28 +107,6 @@ Sequence< Type > SAL_CALL ProgressBar::getTypes() return ourTypeCollection.getTypes(); } -// XAggregation - -Any SAL_CALL ProgressBar::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XControlModel* > ( this ) , - static_cast< XProgressBar* > ( this ) - ) - ); - - // If searched interface not supported by this class ... - if ( !aReturn.hasValue() ) - { - // ... ask baseclasses. - aReturn = BaseControl::queryAggregation( aType ); - } - - return aReturn; -} - // XProgressBar void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor ) diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx index cf9160ee4556..a22bbd620060 100644 --- a/UnoControls/source/controls/progressmonitor.cxx +++ b/UnoControls/source/controls/progressmonitor.cxx @@ -112,20 +112,20 @@ ProgressMonitor::~ProgressMonitor() // XInterface Any SAL_CALL ProgressMonitor::queryInterface( const Type& rType ) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn; - css::uno::Reference< XInterface > xDel = BaseContainerControl::impl_getDelegator(); - if ( xDel.is() ) - { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = xDel->queryInterface( rType ); - } - else + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XLayoutConstrains* > ( this ) , + static_cast< XButton* > ( this ) , + static_cast< XProgressMonitor* > ( this ) + ) + ); + + // If searched interface not supported by this class ... + if ( !aReturn.hasValue() ) { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // ... ask baseclasses. + aReturn = BaseControl::queryInterface( rType ); } return aReturn; @@ -163,28 +163,6 @@ Sequence< Type > SAL_CALL ProgressMonitor::getTypes() return ourTypeCollection.getTypes(); } -// XAggregation -Any SAL_CALL ProgressMonitor::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XLayoutConstrains* > ( this ) , - static_cast< XButton* > ( this ) , - static_cast< XProgressMonitor* > ( this ) - ) - ); - - // If searched interface not supported by this class ... - if ( !aReturn.hasValue() ) - { - // ... ask baseclasses. - aReturn = BaseControl::queryAggregation( aType ); - } - - return aReturn; -} - // XProgressMonitor void SAL_CALL ProgressMonitor::addText( const OUString& rTopic, diff --git a/UnoControls/source/controls/statusindicator.cxx b/UnoControls/source/controls/statusindicator.cxx index 6e5f097981df..ac4b1c86b7b2 100644 --- a/UnoControls/source/controls/statusindicator.cxx +++ b/UnoControls/source/controls/statusindicator.cxx @@ -76,20 +76,19 @@ StatusIndicator::~StatusIndicator() {} Any SAL_CALL StatusIndicator::queryInterface( const Type& rType ) { - // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. - Any aReturn; - css::uno::Reference< XInterface > xDel = BaseContainerControl::impl_getDelegator(); - if ( xDel.is() ) - { - // If a delegator exists, forward question to its queryInterface. - // Delegator will ask its own queryAggregation! - aReturn = xDel->queryInterface( rType ); - } - else + // Ask for my own supported interfaces ... + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! + Any aReturn ( ::cppu::queryInterface( rType , + static_cast< XLayoutConstrains* > ( this ) , + static_cast< XStatusIndicator* > ( this ) + ) + ); + + // If searched interface not supported by this class ... + if ( !aReturn.hasValue() ) { - // If a delegator is unknown, forward question to own queryAggregation. - aReturn = queryAggregation( rType ); + // ... ask baseclasses. + aReturn = BaseControl::queryInterface( rType ); } return aReturn; @@ -129,28 +128,6 @@ Sequence< Type > SAL_CALL StatusIndicator::getTypes() return ourTypeCollection.getTypes(); } -// XAggregation - -Any SAL_CALL StatusIndicator::queryAggregation( const Type& aType ) -{ - // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XLayoutConstrains* > ( this ) , - static_cast< XStatusIndicator* > ( this ) - ) - ); - - // If searched interface not supported by this class ... - if ( !aReturn.hasValue() ) - { - // ... ask baseclasses. - aReturn = BaseControl::queryAggregation( aType ); - } - - return aReturn; -} - // XStatusIndicator void SAL_CALL StatusIndicator::start( const OUString& sText, sal_Int32 nRange ) diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx index 790aae1aa8f1..a1a2afc07be4 100644 --- a/UnoControls/source/inc/framecontrol.hxx +++ b/UnoControls/source/inc/framecontrol.hxx @@ -71,12 +71,6 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XAggregation - - css::uno::Any SAL_CALL queryAggregation( - const css::uno::Type& aType - ) override; - OUString SAL_CALL getImplementationName() override; css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx index d31758b1cff9..3c9f5c8bebf1 100644 --- a/UnoControls/source/inc/progressbar.hxx +++ b/UnoControls/source/inc/progressbar.hxx @@ -77,10 +77,6 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XAggregation - - css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; - // XProgressBar virtual void SAL_CALL setForegroundColor( sal_Int32 nColor ) override; diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx index 90d1ffa18873..eaaa1bc80b3f 100644 --- a/UnoControls/source/inc/progressmonitor.hxx +++ b/UnoControls/source/inc/progressmonitor.hxx @@ -107,10 +107,6 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XAggregation - - virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; - // XProgressMonitor /** diff --git a/UnoControls/source/inc/statusindicator.hxx b/UnoControls/source/inc/statusindicator.hxx index 34bce92bee85..5f18f135d2ef 100644 --- a/UnoControls/source/inc/statusindicator.hxx +++ b/UnoControls/source/inc/statusindicator.hxx @@ -98,10 +98,6 @@ public: virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - // XAggregation - - virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; - // XStatusIndicator virtual void SAL_CALL start( |