[Libreoffice-commits] core.git: include/animations include/vcl lingucomponent/source sd/source sot/source UnoControls/source xmlscript/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 21 14:09:09 UTC 2019


 UnoControls/source/base/basecontrol.cxx                         |    2 +-
 UnoControls/source/controls/OConnectionPointContainerHelper.cxx |    3 +--
 include/animations/animationnodehelper.hxx                      |    3 +--
 include/vcl/vclstatuslistener.hxx                               |    2 +-
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx           |    2 +-
 lingucomponent/source/spellcheck/spell/sspellimp.cxx            |    2 +-
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx             |    2 +-
 sd/source/ui/framework/tools/FrameworkHelper.cxx                |    2 +-
 sot/source/unoolestorage/xolesimplestorage.cxx                  |    3 +--
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx                 |    2 +-
 10 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 01782ecd9fb1e712925cdeb29694faad3c6beed7
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sun Jul 21 14:46:06 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 21 16:04:20 2019 +0200

    loplugin:referencecasting in various
    
    Change-Id: Id4e3d9d1bbfd47181299568afec45e996eb1eed5
    Reviewed-on: https://gerrit.libreoffice.org/76071
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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));


More information about the Libreoffice-commits mailing list