summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-21 14:46:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-21 16:04:20 +0200
commit01782ecd9fb1e712925cdeb29694faad3c6beed7 (patch)
treee5d6050f3b327cd3db2b2a4a7651cbfaca6625e5
parentbac57f75cd18472167742e804d789ffbc43fa9a9 (diff)
loplugin:referencecasting in various
Change-Id: Id4e3d9d1bbfd47181299568afec45e996eb1eed5 Reviewed-on: https://gerrit.libreoffice.org/76071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--UnoControls/source/base/basecontrol.cxx2
-rw-r--r--UnoControls/source/controls/OConnectionPointContainerHelper.cxx3
-rw-r--r--include/animations/animationnodehelper.hxx3
-rw-r--r--include/vcl/vclstatuslistener.hxx2
-rw-r--r--lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx2
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx2
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx2
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx3
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx2
10 files changed, 10 insertions, 13 deletions
diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx
index 6294376f487f..fc9d0b890d0b 100644
--- a/UnoControls/source/base/basecontrol.cxx
+++ b/UnoControls/source/base/basecontrol.cxx
@@ -353,7 +353,7 @@ Reference< XView > SAL_CALL BaseControl::getView()
{
// Ready for multithreading
MutexGuard aGuard( m_aMutex );
- return Reference< XView >( static_cast<OWeakObject*>(this), UNO_QUERY );
+ return this;
}
// XControl
diff --git a/UnoControls/source/controls/OConnectionPointContainerHelper.cxx b/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
index 9146d66e87d4..6d24cbb1ff87 100644
--- a/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
+++ b/UnoControls/source/controls/OConnectionPointContainerHelper.cxx
@@ -111,8 +111,7 @@ Reference< XConnectionPoint > SAL_CALL OConnectionPointContainerHelper::queryCon
// Ready for multithreading
MutexGuard aGuard( m_aSharedMutex );
// If this container contains elements, build a connectionpoint-instance.
- OConnectionPointHelper* pNewConnectionPoint = new OConnectionPointHelper( m_aSharedMutex, this, aType );
- xConnectionPoint.set( static_cast<OWeakObject*>(pNewConnectionPoint), UNO_QUERY );
+ xConnectionPoint = new OConnectionPointHelper( m_aSharedMutex, this, aType );
}
return xConnectionPoint;
diff --git a/include/animations/animationnodehelper.hxx b/include/animations/animationnodehelper.hxx
index a72233a9d3ba..eee41cd282be 100644
--- a/include/animations/animationnodehelper.hxx
+++ b/include/animations/animationnodehelper.hxx
@@ -52,8 +52,7 @@ namespace anim
if( xEnumerationAccess.is() )
{
css::uno::Reference< css::container::XEnumeration >
- xEnumeration( xEnumerationAccess->createEnumeration(),
- css::uno::UNO_QUERY );
+ xEnumeration = xEnumerationAccess->createEnumeration();
if( xEnumeration.is() )
{
diff --git a/include/vcl/vclstatuslistener.hxx b/include/vcl/vclstatuslistener.hxx
index f733eaad5067..78fc6e353ce5 100644
--- a/include/vcl/vclstatuslistener.hxx
+++ b/include/vcl/vclstatuslistener.hxx
@@ -55,7 +55,7 @@ VclStatusListener<T>::VclStatusListener(T* widget, const OUString& aCommand) {
css::uno::Reference<css::frame::XFrame> xFrame(xDesktop->getActiveFrame());
if (!xFrame.is())
- xFrame = css::uno::Reference<css::frame::XFrame>(xDesktop, css::uno::UNO_QUERY);
+ xFrame = xDesktop;
mxFrame = xFrame;
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 87cb8583f8e6..bd38e3d470d4 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -88,7 +88,7 @@ PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl()
{
if (!pPropHelper)
{
- Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
+ Reference< XLinguProperties > xPropSet = GetLinguProperties();
pPropHelper.reset( new PropertyHelper_Hyphenation (static_cast<XHyphenator *>(this), xPropSet ) );
pPropHelper->AddAsPropListener(); //! after a reference is established
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 64032ad14b2d..43f6bef717a0 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -99,7 +99,7 @@ PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl()
{
if (!m_pPropHelper)
{
- Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
+ Reference< XLinguProperties > xPropSet = GetLinguProperties();
m_pPropHelper.reset( new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ) );
m_pPropHelper->AddAsPropListener(); //! after a reference is established
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index f17e19081294..7852a7985f7b 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -90,7 +90,7 @@ PropertyHelper_Thesaurus& Thesaurus::GetPropHelper_Impl()
{
if (!pPropHelper)
{
- Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY );
+ Reference< XLinguProperties > xPropSet = GetLinguProperties();
pPropHelper = new PropertyHelper_Thesaurus( static_cast<XThesaurus *>(this), xPropSet );
pPropHelper->AddAsPropListener(); //! after a reference is established
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 1ab5f4552500..e3826d01c041 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -930,7 +930,7 @@ LifetimeController::LifetimeController (::sd::ViewShellBase& rBase)
acquire();
mbListeningToViewShellBase = true;
- Reference<XComponent> xComponent (rBase.GetController(), UNO_QUERY);
+ Reference<XComponent> xComponent = rBase.GetController();
if (xComponent.is())
{
xComponent->addEventListener(this);
diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx
index aab550a0a525..80f2d0605c10 100644
--- a/sot/source/unoolestorage/xolesimplestorage.cxx
+++ b/sot/source/unoolestorage/xolesimplestorage.cxx
@@ -375,8 +375,7 @@ uno::Any SAL_CALL OLESimpleStorage::getByName( const OUString& aName )
uno::Any aResult;
- uno::Reference< io::XStream > xTempFile(
- io::TempFile::create(m_xContext), uno::UNO_QUERY );
+ uno::Reference< io::XStream > xTempFile = io::TempFile::create(m_xContext);
uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xOutputStream = xTempFile->getOutputStream();
uno::Reference< io::XInputStream > xInputStream = xTempFile->getInputStream();
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 50b86b5f601e..c8a96c3335b7 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -875,7 +875,7 @@ bool ImportContext::importGraphicOrImageProperty(
}
if (xGraphic.is())
{
- Reference<beans::XPropertySet> xProps( getControlModel(), UNO_QUERY );
+ Reference<beans::XPropertySet> xProps = getControlModel();
if (xProps.is())
{
xProps->setPropertyValue("Graphic", makeAny(xGraphic));