summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-23 20:14:32 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-04-30 20:35:05 +0200
commitd74c010192a3d9605364bfb942f18c9199a75804 (patch)
tree5c41f1e663ce5e5ccdfd33751383b96b5eeedc0f
parent0dcbf8a5a5048b30fce48081090a922d286a62e4 (diff)
Use getXWeak in scripting
Change-Id: I4370c0bfaa75b150bd05f03a5961e7152ac41e7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150864 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx2
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx4
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx2
-rw-r--r--scripting/source/stringresource/stringresource.cxx2
4 files changed, 5 insertions, 5 deletions
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 06a09fc62edac..d697628c4f018 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -377,7 +377,7 @@ namespace dlgprov
void DialogAllListenerImpl::firing_impl( const AllEventObject& Event, Any* pRet )
{
ScriptEvent aScriptEvent;
- aScriptEvent.Source = static_cast<OWeakObject *>(this); // get correct XInterface
+ aScriptEvent.Source = getXWeak(); // get correct XInterface
aScriptEvent.ListenerType = Event.ListenerType;
aScriptEvent.MethodName = Event.MethodName;
aScriptEvent.Arguments = Event.Arguments;
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 5aabb4654b0a2..54ca264b32f6a 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -149,7 +149,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
if ( xListener.is() )
{
css::frame::DispatchResultEvent aEvent(
- static_cast< ::cppu::OWeakObject* >( this ),
+ getXWeak(),
css::frame::DispatchResultState::FAILURE,
invokeResult );
try
@@ -265,7 +265,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
// executed a macro instead!
css::frame::DispatchResultEvent aEvent;
- aEvent.Source = static_cast< ::cppu::OWeakObject* >( this );
+ aEvent.Source = getXWeak();
aEvent.Result = invokeResult;
if ( bSuccess )
{
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 8af44a4570a20..3ea45aeecd7ea 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -374,7 +374,7 @@ public:
before m_refCount is decremented again */
{
m_xAggProxy->setDelegator(
- static_cast< cppu::OWeakObject * >( this ) );
+ getXWeak() );
}
osl_atomic_decrement( &m_refCount );
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index e1fc4729176c5..64988a5aafafe 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -603,7 +603,7 @@ void StringResourceImpl::implModified(std::unique_lock<std::mutex>& rGuard)
void StringResourceImpl::implNotifyListeners(std::unique_lock<std::mutex>& rGuard)
{
EventObject aEvent;
- aEvent.Source = static_cast< XInterface* >( static_cast<OWeakObject*>(this) );
+ aEvent.Source = getXWeak();
m_aListenerContainer.forEach(rGuard,
[&aEvent](const css::uno::Reference<XModifyListener>& xListener)
{