summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx4
-rw-r--r--svx/source/form/datanavi.cxx18
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx14
-rw-r--r--svx/source/unodraw/unoshape.cxx2
4 files changed, 15 insertions, 23 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 573427c4714e..c4b75024c9fc 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -165,9 +165,7 @@ uno::Reference<XAccessible>
ShapeTypeHandler::Instance().CreateAccessibleObject (
aShapeInfo,
maShapeTreeInfo));
- rChildDescriptor.mxAccessibleShape.set(
- static_cast<uno::XWeak*>(pShape.get()),
- uno::UNO_QUERY);
+ rChildDescriptor.mxAccessibleShape = pShape;
if ( pShape.is() )
{
pShape->Init();
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 93ecd07b9d60..27cfb9f1ad4a 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1297,8 +1297,7 @@ namespace svxform
m_xFrame = pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface();
DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" );
// add frameaction listener
- Reference< XFrameActionListener > xListener(
- static_cast< XFrameActionListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XFrameActionListener > xListener = m_xDataListener;
m_xFrame->addFrameActionListener( xListener );
// load xforms models of the current document
@@ -1307,8 +1306,7 @@ namespace svxform
DataNavigatorWindow::~DataNavigatorWindow()
{
- Reference< XFrameActionListener > xListener(
- static_cast< XFrameActionListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XFrameActionListener > xListener = m_xDataListener;
m_xFrame->removeFrameActionListener( xListener );
SvtViewOptions aViewOpt( EViewType::TabDialog, CFGNAME_DATANAVIGATOR );
@@ -1951,8 +1949,7 @@ namespace svxform
void DataNavigatorWindow::AddContainerBroadcaster( const css::uno::Reference< css::container::XContainer >& xContainer )
{
- Reference< XContainerListener > xListener(
- static_cast< XContainerListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XContainerListener > xListener = m_xDataListener;
xContainer->addContainerListener( xListener );
m_aContainerList.push_back( xContainer );
}
@@ -1960,8 +1957,7 @@ namespace svxform
void DataNavigatorWindow::AddEventBroadcaster( const css::uno::Reference< css::xml::dom::events::XEventTarget >& xTarget )
{
- Reference< XEventListener > xListener(
- static_cast< XEventListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XEventListener > xListener = m_xDataListener;
xTarget->addEventListener( EVENTTYPE_CHARDATA, xListener, true );
xTarget->addEventListener( EVENTTYPE_CHARDATA, xListener, false );
xTarget->addEventListener( EVENTTYPE_ATTR, xListener, true );
@@ -1971,13 +1967,11 @@ namespace svxform
void DataNavigatorWindow::RemoveBroadcaster()
{
- Reference< XContainerListener > xContainerListener(
- static_cast< XContainerListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XContainerListener > xContainerListener = m_xDataListener;
sal_Int32 i, nCount = m_aContainerList.size();
for ( i = 0; i < nCount; ++i )
m_aContainerList[i]->removeContainerListener( xContainerListener );
- Reference< XEventListener > xEventListener(
- static_cast< XEventListener* >( m_xDataListener.get() ), UNO_QUERY );
+ Reference< XEventListener > xEventListener = m_xDataListener;
nCount = m_aEventTargetList.size();
for ( i = 0; i < nCount; ++i )
{
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index ecaaab2cd5d1..786c95698c05 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -633,7 +633,7 @@ void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< c
m_nFindAllId = pToolBox->GetItemId(COMMAND_FINDALL);
}
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
@@ -787,7 +787,7 @@ void SAL_CALL UpDownSearchToolboxController::dispose()
void SAL_CALL UpDownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
{
svt::ToolboxController::initialize( aArguments );
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
// XToolbarController
@@ -906,7 +906,7 @@ void SAL_CALL MatchCaseToolboxController::initialize( const css::uno::Sequence<
{
svt::ToolboxController::initialize(aArguments);
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
@@ -1022,7 +1022,7 @@ void SAL_CALL SearchFormattedToolboxController::initialize( const css::uno::Sequ
{
svt::ToolboxController::initialize(aArguments);
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
@@ -1132,7 +1132,7 @@ void SAL_CALL FindAllToolboxController::dispose()
void SAL_CALL FindAllToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
{
svt::ToolboxController::initialize( aArguments );
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
// XToolbarController
@@ -1239,7 +1239,7 @@ void SAL_CALL ExitSearchToolboxController::dispose()
void SAL_CALL ExitSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
{
svt::ToolboxController::initialize( aArguments );
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
// XToolbarController
@@ -1361,7 +1361,7 @@ void SAL_CALL SearchLabelToolboxController::dispose()
void SAL_CALL SearchLabelToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
{
svt::ToolboxController::initialize( aArguments );
- SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
}
// XStatusListener
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index c05d7323e43c..a6ba615358ed 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -633,7 +633,7 @@ void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet)
if(HasSdrObject() && rPropSet.AreThereOwnUsrAnys())
{
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>);
- Reference< beans::XPropertySet > xShape( static_cast<OWeakObject*>(this), UNO_QUERY );
+ Reference< beans::XPropertySet > xShape(this);
SvxItemPropertySet_ObtainSettingsFromPropertySet(rPropSet, aSet, xShape, &mpPropSet->getPropertyMap() );
GetSdrObject()->SetMergedItemSetAndBroadcast(aSet);