summaryrefslogtreecommitdiff
path: root/svtools/source/uno
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/uno')
-rw-r--r--svtools/source/uno/framestatuslistener.cxx11
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx8
2 files changed, 9 insertions, 10 deletions
diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx
index 1e4cba141faa..ba158c2ddcf3 100644
--- a/svtools/source/uno/framestatuslistener.cxx
+++ b/svtools/source/uno/framestatuslistener.cxx
@@ -79,13 +79,12 @@ void SAL_CALL FrameStatusListener::release() throw ()
// XComponent
void SAL_CALL FrameStatusListener::dispose()
{
- Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
+ Reference< XComponent > xThis = this;
SolarMutexGuard aSolarMutexGuard;
if ( m_bDisposed )
throw DisposedException();
- Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
for (auto const& listener : m_aListenerMap)
{
try
@@ -96,8 +95,8 @@ void SAL_CALL FrameStatusListener::dispose()
aTargetURL.Complete = listener.first;
xURLTransformer->parseStrict( aTargetURL );
- if ( xDispatch.is() && xStatusListener.is() )
- xDispatch->removeStatusListener( xStatusListener, aTargetURL );
+ if ( xDispatch.is() )
+ xDispatch->removeStatusListener( this, aTargetURL );
}
catch (const Exception&)
{
@@ -165,7 +164,7 @@ void FrameStatusListener::addStatusListener( const OUString& aCommandURL )
xURLTransformer->parseStrict( aTargetURL );
xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
- xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ xStatusListener = this;
URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL );
if ( aIter != m_aListenerMap.end() )
{
@@ -210,7 +209,7 @@ void FrameStatusListener::bindListener()
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
if ( m_xContext.is() && xDispatchProvider.is() )
{
- xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ xStatusListener = this;
for (auto & listener : m_aListenerMap)
{
Reference< XURLTransformer > xURLTransformer( css::util::URLTransformer::create( m_xContext ) );
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index 88c07535dd16..d22dc8e69a98 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -184,7 +184,7 @@ void SAL_CALL StatusbarController::update()
// XComponent
void SAL_CALL StatusbarController::dispose()
{
- Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY );
+ Reference< XComponent > xThis = this;
{
SolarMutexGuard aSolarMutexGuard;
@@ -196,7 +196,7 @@ void SAL_CALL StatusbarController::dispose()
m_aListenerContainer.disposeAndClear( aEvent );
SolarMutexGuard aSolarMutexGuard;
- Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ Reference< XStatusListener > xStatusListener = this;
Reference< XURLTransformer > xURLTransformer = getURLTransformer();
css::util::URL aTargetURL;
for (auto const& listener : m_aListenerMap)
@@ -369,7 +369,7 @@ void StatusbarController::addStatusListener( const OUString& aCommandURL )
xURLTransformer->parseStrict( aTargetURL );
xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
- xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ xStatusListener = this;
URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL );
if ( aIter != m_aListenerMap.end() )
{
@@ -417,7 +417,7 @@ void StatusbarController::bindListener()
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
if ( m_xContext.is() && xDispatchProvider.is() )
{
- xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ xStatusListener = this;
for (auto & listener : m_aListenerMap)
{
Reference< XURLTransformer > xURLTransformer = getURLTransformer();