summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-23 10:15:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-23 15:25:26 +0200
commit8a54339fc83fe9abaaace6f9f374697e6923d684 (patch)
tree516e82bb9eca2d586aa7acebbe369f67ff707a7f /toolkit
parentd34f1df73806e9ca05fa0d07da619e2c0f01b6f7 (diff)
loplugin:referencecasting look through more clang Types
Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx5
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx2
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx4
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx2
-rw-r--r--toolkit/source/controls/unocontrol.cxx2
5 files changed, 7 insertions, 8 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 9dcacd958c5e..62453331474b 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1263,8 +1263,7 @@ ControlContainerBase::ControlContainerBase( const Reference< XComponentContext >
{
maComponentInfos.nWidth = 280;
maComponentInfos.nHeight = 400;
- mxListener = new ResourceListener( Reference< util::XModifyListener >(
- static_cast< OWeakObject* >( this ), UNO_QUERY ));
+ mxListener = new ResourceListener( Reference< util::XModifyListener >(this) );
}
ControlContainerBase::~ControlContainerBase()
@@ -1589,7 +1588,7 @@ void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyC
if ( !mbPosModified && !mbSizeModified )
{
// Don't set new pos/size if we get new values from window listener
- Reference< XControl > xThis( static_cast<XAggregation*>(static_cast<cppu::OWeakAggObject*>(this)), UNO_QUERY );
+ Reference< XControl > xThis(this);
ImplSetPosSize( xThis );
}
}
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index fcfa50b4e4ea..5c5df64850f8 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -364,7 +364,7 @@ void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, cons
if ( !mbWindowListener )
{
- Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
+ Reference< XWindowListener > xWL(this);
addWindowListener( xWL );
mbWindowListener = true;
}
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index 4bf888811ee2..64c1e25dc9d8 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -276,7 +276,7 @@ static void lcl_throwIndexOutOfBoundsException( )
maRoadmapItems.insert( maRoadmapItems.begin() + Index, xRoadmapItem);
ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);
maContainerListeners.elementInserted( aEvent );
- Reference< XPropertySet > xPropertySet( static_cast<XAggregation*>(static_cast<cppu::OWeakAggObject*>(this)), UNO_QUERY );
+ Reference< XPropertySet > xPropertySet( this );
sal_Int16 n_CurrentItemID = GetCurrentItemID( xPropertySet );
if ( Index <= n_CurrentItemID )
{
@@ -294,7 +294,7 @@ static void lcl_throwIndexOutOfBoundsException( )
maRoadmapItems.erase( maRoadmapItems.begin() + Index );
ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);
maContainerListeners.elementRemoved( aEvent );
- Reference< XPropertySet > xPropertySet( static_cast<XAggregation*>(static_cast<cppu::OWeakAggObject*>(this)), UNO_QUERY );
+ Reference< XPropertySet > xPropertySet( this );
sal_Int16 n_CurrentItemID = GetCurrentItemID( xPropertySet );
Any aAny;
if ( Index > n_CurrentItemID )
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index aa0f1badef0c..ccf320dad8aa 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -212,7 +212,7 @@ void UnoControlTabPage::createPeer( const Reference< XToolkit > & rxToolkit, con
{
if ( !m_bWindowListener )
{
- Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
+ Reference< XWindowListener > xWL(this);
addWindowListener( xWL );
m_bWindowListener = true;
}
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index e669e7e9889e..841c9e869773 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -569,7 +569,7 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
}
Reference< XWindow > xParent = getParentPeer();
- Reference< XControl > xThis( static_cast<XAggregation*>(static_cast<cppu::OWeakAggObject*>(this)), UNO_QUERY );
+ Reference< XControl > xThis(this);
// call createPeer via an interface got from queryInterface, so the aggregating class can intercept it
DBG_ASSERT( !bNeedNewPeer || xParent.is(), "Need new peer, but don't have a parent!" );