[Libreoffice-commits] core.git: accessibility/source basic/source chart2/source comphelper/source connectivity/source cppuhelper/source cui/source dbaccess/source desktop/source drawinglayer/source editeng/source embeddedobj/source extensions/source filter/source forms/source fpicker/source framework/source linguistic/source oox/source package/source pyuno/source reportdesign/source scripting/source sc/source sdext/source sd/source sfx2/source slideshow/source sot/source starmath/source stoc/source svl/source svtools/source svx/source sw/source test/source toolkit/source ucb/source unotools/source vcl/source vcl/unx writerfilter/source xmlhelp/source xmloff/source xmlscript/source xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Fri May 12 07:57:00 UTC 2017


 accessibility/source/extended/AccessibleGridControl.cxx           |    1 
 accessibility/source/extended/accessibleiconchoicectrl.cxx        |    1 
 accessibility/source/standard/vclxaccessiblebox.cxx               |    3 -
 basic/source/classes/sbunoobj.cxx                                 |    3 -
 basic/source/runtime/methods.cxx                                  |    1 
 basic/source/uno/namecont.cxx                                     |    6 --
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |    2 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx       |    4 -
 chart2/source/controller/main/ChartController_EditData.cxx        |   20 +++------
 chart2/source/controller/main/ChartController_Properties.cxx      |    1 
 chart2/source/controller/main/ChartController_Tools.cxx           |    2 
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx             |    4 -
 chart2/source/model/main/ChartModel.cxx                           |    1 
 chart2/source/tools/AxisHelper.cxx                                |    1 
 chart2/source/tools/DiagramHelper.cxx                             |    1 
 chart2/source/tools/ExplicitCategoriesProvider.cxx                |    1 
 chart2/source/view/axes/VCartesianAxis.cxx                        |    2 
 chart2/source/view/main/VLegendSymbolFactory.cxx                  |    3 -
 comphelper/source/misc/storagehelper.cxx                          |    2 
 connectivity/source/commontools/DateConversion.cxx                |    1 
 connectivity/source/commontools/dbtools.cxx                       |    3 -
 connectivity/source/commontools/dbtools2.cxx                      |    1 
 connectivity/source/drivers/dbase/DDatabaseMetaData.cxx           |    1 
 connectivity/source/drivers/dbase/DIndex.cxx                      |    1 
 connectivity/source/drivers/file/FStatement.cxx                   |    5 --
 connectivity/source/drivers/firebird/Driver.cxx                   |    2 
 connectivity/source/drivers/firebird/Keys.cxx                     |    2 
 connectivity/source/drivers/postgresql/pq_xcontainer.cxx          |    1 
 cppuhelper/source/factory.cxx                                     |    1 
 cui/source/customize/cfg.cxx                                      |    5 --
 cui/source/dialogs/SpellDialog.cxx                                |    1 
 cui/source/dialogs/scriptdlg.cxx                                  |    1 
 cui/source/options/optlingu.cxx                                   |    1 
 cui/source/tabpages/autocdlg.cxx                                  |    3 -
 dbaccess/source/core/api/CacheSet.cxx                             |    3 -
 dbaccess/source/core/api/RowSet.cxx                               |    1 
 dbaccess/source/core/api/querycontainer.cxx                       |    1 
 dbaccess/source/core/api/viewcontainer.cxx                        |    1 
 dbaccess/source/core/dataaccess/documentdefinition.cxx            |    1 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx                |    1 
 dbaccess/source/ui/app/AppController.cxx                          |   12 +----
 dbaccess/source/ui/browser/brwctrlr.cxx                           |    2 
 dbaccess/source/ui/browser/dsbrowserDnD.cxx                       |    5 --
 dbaccess/source/ui/browser/sbagrid.cxx                            |   14 +-----
 dbaccess/source/ui/control/opendoccontrols.cxx                    |    1 
 dbaccess/source/ui/dlg/CollectionView.cxx                         |    1 
 dbaccess/source/ui/dlg/tablespage.cxx                             |    1 
 dbaccess/source/ui/misc/TokenWriter.cxx                           |    2 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx                |    4 -
 dbaccess/source/ui/querydesign/TableWindowListBox.cxx             |    3 -
 dbaccess/source/ui/tabledesign/TEditControl.cxx                   |    3 -
 desktop/source/app/app.cxx                                        |    1 
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx             |    1 
 desktop/source/deployment/manager/dp_extensionmanager.cxx         |    3 -
 desktop/source/migration/migration.cxx                            |    1 
 drawinglayer/source/dumper/XShapeDumper.cxx                       |    1 
 editeng/source/misc/splwrap.cxx                                   |    3 -
 embeddedobj/source/general/xcreator.cxx                           |    4 -
 extensions/source/bibliography/datman.cxx                         |    2 
 extensions/source/bibliography/framectr.cxx                       |    3 -
 extensions/source/dbpilots/controlwizard.cxx                      |    3 -
 extensions/source/propctrlr/formcomponenthandler.cxx              |    3 -
 filter/source/config/cache/basecontainer.cxx                      |    1 
 filter/source/config/cache/filtercache.cxx                        |    1 
 filter/source/graphicfilter/icgm/actimpr.cxx                      |    2 
 filter/source/svg/svgreader.cxx                                   |    1 
 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx               |    2 
 filter/source/xsltdialog/xmlfilterjar.cxx                         |    2 
 forms/source/component/ComboBox.cxx                               |    1 
 forms/source/component/DatabaseForm.cxx                           |    1 
 forms/source/component/FormattedField.cxx                         |    1 
 forms/source/component/entrylisthelper.cxx                        |    1 
 forms/source/xforms/submission/serialization_urlencoded.cxx       |    1 
 fpicker/source/office/iodlg.cxx                                   |    2 
 framework/source/dispatch/popupmenudispatcher.cxx                 |    1 
 framework/source/fwe/xml/menudocumenthandler.cxx                  |    5 --
 framework/source/fwe/xml/statusbardocumenthandler.cxx             |    5 --
 framework/source/fwe/xml/toolboxdocumenthandler.cxx               |    5 --
 framework/source/helper/statusindicatorfactory.cxx                |    2 
 framework/source/jobs/jobdispatch.cxx                             |   19 +--------
 framework/source/layoutmanager/layoutmanager.cxx                  |    4 -
 framework/source/layoutmanager/toolbarlayoutmanager.cxx           |    3 -
 framework/source/services/desktop.cxx                             |    1 
 framework/source/services/frame.cxx                               |    1 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |    2 
 framework/source/uiconfiguration/uicategorydescription.cxx        |    2 
 framework/source/uielement/notebookbarmenucontroller.cxx          |    1 
 framework/source/uielement/subtoolbarcontroller.cxx               |    2 
 framework/source/uielement/toolbarmodemenucontroller.cxx          |    1 
 framework/source/uielement/uicommanddescription.cxx               |    2 
 framework/source/uifactory/uielementfactorymanager.cxx            |    1 
 framework/source/xml/imagesdocumenthandler.cxx                    |    5 --
 linguistic/source/convdic.cxx                                     |   14 +-----
 oox/source/core/xmlfilterbase.cxx                                 |    1 
 oox/source/drawingml/table/tablecell.cxx                          |    1 
 oox/source/drawingml/textparagraphpropertiescontext.cxx           |    1 
 oox/source/export/chartexport.cxx                                 |    5 --
 package/source/xstor/ohierarchyholder.cxx                         |    2 
 package/source/xstor/switchpersistencestream.cxx                  |    1 
 package/source/xstor/xstorage.cxx                                 |    3 -
 package/source/zippackage/ZipPackage.cxx                          |    1 
 pyuno/source/module/pyuno_runtime.cxx                             |    1 
 reportdesign/source/core/api/ReportEngineJFree.cxx                |    1 
 reportdesign/source/core/sdr/UndoEnv.cxx                          |    1 
 reportdesign/source/filter/xml/xmlExport.cxx                      |    1 
 reportdesign/source/filter/xml/xmlFixedContent.cxx                |    1 
 reportdesign/source/ui/dlg/AddField.cxx                           |    3 -
 reportdesign/source/ui/dlg/GroupsSorting.cxx                      |    3 -
 reportdesign/source/ui/inspection/GeometryHandler.cxx             |    2 
 reportdesign/source/ui/report/SectionWindow.cxx                   |    1 
 reportdesign/source/ui/report/ViewsWindow.cxx                     |    3 -
 sc/source/core/data/globalx.cxx                                   |    4 -
 sc/source/filter/oox/workbookfragment.cxx                         |    2 
 sc/source/ui/app/seltrans.cxx                                     |    6 --
 sc/source/ui/docshell/dbdocimp.cxx                                |    1 
 sc/source/ui/navipi/content.cxx                                   |   13 ++----
 sc/source/ui/undo/undoblk.cxx                                     |    5 --
 sc/source/ui/unoobj/PivotTableDataProvider.cxx                    |    1 
 sc/source/ui/unoobj/shapeuno.cxx                                  |    1 
 sc/source/ui/vba/vbaapplication.cxx                               |    1 
 sc/source/ui/vba/vbarange.cxx                                     |    6 --
 sc/source/ui/view/cellsh1.cxx                                     |    5 --
 sc/source/ui/view/drawvie4.cxx                                    |   10 +---
 sc/source/ui/view/gridwin.cxx                                     |   13 ++----
 sc/source/ui/view/select.cxx                                      |    5 --
 sc/source/ui/view/tabcont.cxx                                     |    5 --
 sc/source/ui/view/tabview3.cxx                                    |    5 --
 sc/source/ui/view/viewfun3.cxx                                    |   21 +++-------
 scripting/source/dlgprov/dlgevtatt.cxx                            |    2 
 sd/source/core/CustomAnimationPreset.cxx                          |    3 -
 sd/source/core/TransitionPreset.cxx                               |    3 -
 sd/source/filter/xml/sdxmlwrp.cxx                                 |    3 -
 sd/source/ui/animations/motionpathtag.cxx                         |    2 
 sd/source/ui/framework/factories/BasicViewFactory.cxx             |    1 
 sd/source/ui/unoidl/unopage.cxx                                   |    1 
 sdext/source/minimizer/graphiccollector.cxx                       |    1 
 sdext/source/pdfimport/wrapper/wrapper.cxx                        |    1 
 sdext/source/presenter/PresenterController.cxx                    |    5 --
 sdext/source/presenter/PresenterWindowManager.cxx                 |   11 -----
 sfx2/source/appl/newhelp.cxx                                      |    4 -
 sfx2/source/appl/shutdownicon.cxx                                 |    1 
 sfx2/source/control/bindings.cxx                                  |    3 -
 sfx2/source/doc/SfxDocumentMetaData.cxx                           |    1 
 sfx2/source/doc/docfile.cxx                                       |    1 
 sfx2/source/doc/doctempl.cxx                                      |    1 
 sfx2/source/doc/objcont.cxx                                       |    1 
 sfx2/source/doc/sfxbasemodel.cxx                                  |    3 -
 slideshow/source/engine/opengl/TransitionerImpl.cxx               |    3 -
 sot/source/sdstor/ucbstorage.cxx                                  |    1 
 starmath/source/view.cxx                                          |    1 
 stoc/source/defaultregistry/defaultregistry.cxx                   |    2 
 svl/source/fsstor/fsstorage.cxx                                   |    2 
 svtools/source/contnr/treelistbox.cxx                             |    3 -
 svtools/source/misc/stringtransfer.cxx                            |    7 +--
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx         |    2 
 svx/source/fmcomp/fmgridif.cxx                                    |    1 
 svx/source/fmcomp/gridctrl.cxx                                    |    3 -
 svx/source/form/datanavi.cxx                                      |    6 --
 svx/source/form/fmshimp.cxx                                       |    1 
 svx/source/form/fmvwimp.cxx                                       |    2 
 svx/source/form/formcontroller.cxx                                |    6 --
 svx/source/form/navigatortreemodel.cxx                            |    2 
 svx/source/form/tabwin.cxx                                        |    4 -
 svx/source/svdraw/svdoole2.cxx                                    |    2 
 svx/source/table/tablelayouter.cxx                                |    1 
 svx/source/unodraw/recoveryui.cxx                                 |   10 +---
 sw/source/core/access/accnotextframe.cxx                          |    2 
 sw/source/core/edit/edlingu.cxx                                   |    1 
 sw/source/core/frmedt/feflyole.cxx                                |    1 
 sw/source/core/swg/SwXMLTextBlocks1.cxx                           |    6 --
 sw/source/core/txtnode/fmtatr2.cxx                                |    3 -
 sw/source/core/unocore/unochart.cxx                               |    2 
 sw/source/core/unocore/unodraw.cxx                                |    3 -
 sw/source/core/unocore/unoframe.cxx                               |    1 
 sw/source/core/unocore/unoobj2.cxx                                |    1 
 sw/source/core/unocore/unoredline.cxx                             |    1 
 sw/source/core/unocore/unotbl.cxx                                 |    2 
 sw/source/core/unocore/unotext.cxx                                |    1 
 sw/source/filter/html/htmlform.cxx                                |    4 -
 sw/source/filter/ww8/docxsdrexport.cxx                            |    8 +--
 sw/source/filter/ww8/docxsdrexport.hxx                            |    3 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx                   |    5 --
 sw/source/filter/xml/swxml.cxx                                    |    3 -
 sw/source/filter/xml/wrtxml.cxx                                   |    1 
 sw/source/filter/xml/xmlfmte.cxx                                  |    2 
 sw/source/ui/dbui/mmaddressblockpage.cxx                          |    4 -
 sw/source/ui/index/cntex.cxx                                      |    3 -
 sw/source/ui/vba/vbadocument.cxx                                  |    1 
 sw/source/uibase/app/docsh2.cxx                                   |    3 -
 sw/source/uibase/app/swmodul1.cxx                                 |    1 
 sw/source/uibase/config/StoredChapterNumbering.cxx                |    3 -
 sw/source/uibase/dbui/dbmgr.cxx                                   |    2 
 sw/source/uibase/dbui/dbtree.cxx                                  |    5 --
 sw/source/uibase/dochdl/gloshdl.cxx                               |    4 -
 sw/source/uibase/dochdl/swdtflvr.cxx                              |    5 --
 sw/source/uibase/docvw/edtdd.cxx                                  |    4 -
 sw/source/uibase/docvw/romenu.cxx                                 |    6 --
 sw/source/uibase/shells/basesh.cxx                                |    3 -
 sw/source/uibase/shells/textsh1.cxx                               |    5 --
 sw/source/uibase/uno/unotxdoc.cxx                                 |    1 
 sw/source/uibase/uno/unotxvw.cxx                                  |    4 -
 sw/source/uibase/utlui/content.cxx                                |    4 -
 test/source/sheet/xspreadsheets2.cxx                              |    2 
 test/source/text/xtextcontent.cxx                                 |    1 
 toolkit/source/controls/unocontrolcontainer.cxx                   |    3 -
 ucb/source/core/FileAccess.cxx                                    |    1 
 ucb/source/ucp/ext/ucpext_content.cxx                             |    2 
 ucb/source/ucp/file/filtask.cxx                                   |    1 
 ucb/source/ucp/package/pkgcontent.cxx                             |    1 
 ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx                  |    1 
 unotools/source/ucbhelper/ucbstreamhelper.cxx                     |    3 -
 vcl/source/helper/canvastools.cxx                                 |    2 
 vcl/source/window/mouse.cxx                                       |    2 
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx                          |    4 -
 vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx                        |    2 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                 |    1 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                    |    1 
 xmlhelp/source/treeview/tvfactory.cxx                             |    2 
 xmloff/source/chart/SchXMLAxisContext.cxx                         |    1 
 xmloff/source/chart/SchXMLChartContext.cxx                        |    1 
 xmloff/source/chart/SchXMLExport.cxx                              |    3 -
 xmloff/source/chart/SchXMLSeries2Context.cxx                      |    1 
 xmloff/source/core/xmlexp.cxx                                     |    3 -
 xmloff/source/draw/animexp.cxx                                    |    1 
 xmloff/source/draw/shapeexport.cxx                                |    3 -
 xmloff/source/forms/layerexport.cxx                               |    1 
 xmloff/source/meta/MetaExportComponent.cxx                        |    3 -
 xmloff/source/style/styleexp.cxx                                  |    3 -
 xmloff/source/style/xmlimppr.cxx                                  |    2 
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx                   |    1 
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx                |    1 
 xmlscript/source/xmllib_imexp/xmllib_export.cxx                   |    4 -
 xmlsecurity/source/helper/xmlsignaturehelper.cxx                  |    1 
 xmlsecurity/source/helper/xsecverify.cxx                          |    1 
 234 files changed, 129 insertions(+), 542 deletions(-)

New commits:
commit 389da66dfc96d06c407bff156c4ea21e940c5e06
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu May 11 15:40:42 2017 +0200

    remove unused uno::Reference vars
    
    found by temporarily marking Reference as SAL_WARN_UNUSED.
    
    Change-Id: I18809b62654467f890016adcc92576980ced393b
    Reviewed-on: https://gerrit.libreoffice.org/37511
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index 999354efaedf..f762981af06b 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -297,7 +297,6 @@ void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNew
         for(sal_Int32 i=0;i<nChildCount;i++)
         {
             css::uno::Reference< css::accessibility::XAccessible > xAccessible = getAccessibleChild(i);
-            css::uno::Reference< css::accessibility::XAccessibleContext > xAccessibleChild = xAccessible->getAccessibleContext();
             if(css::uno::Reference< css::accessibility::XAccessible >(m_xImpl->m_xTable.get()) == xAccessible)
             {
                 std::vector< AccessibleGridControlTableCell* >& rCells =
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 9d958926609e..18a4a344495d 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -321,7 +321,6 @@ namespace accessibility
         if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getAccessibleChildCount() )
             throw IndexOutOfBoundsException();
 
-        Reference< XAccessible > xChild;
         sal_Int32 nSelCount = 0;
         VclPtr<SvtIconChoiceCtrl> pCtrl = getCtrl();
         sal_Int32 nCount = pCtrl->GetEntryCount();
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index f5bc0d5659d4..b5a4a168ed48 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -63,8 +63,7 @@ VCLXAccessibleBox::~VCLXAccessibleBox()
 
 void VCLXAccessibleBox::ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent )
 {
-       uno::Any aOldValue, aNewValue;
-    uno::Reference<XAccessible> xAcc;
+    uno::Any aOldValue, aNewValue;
 
     switch ( rVclWindowEvent.GetId() )
     {
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index c0efa32baa99..43573250de0c 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2285,8 +2285,6 @@ SbUnoObject::SbUnoObject( const OUString& aName_, const Any& aUnoObj_ )
     , bNeedIntrospection( true )
     , bNativeCOMObject( false )
 {
-    static Reference< XIntrospection > xIntrospection;
-
     // beat out again the default properties of Sbx
     Remove( "Name", SbxClassType::DontCare );
     Remove( "Parent", SbxClassType::DontCare );
@@ -3362,7 +3360,6 @@ SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
         {
             // Is it a field(?)
             Reference< XIdlField > xField = m_xClass->getField( rName );
-            Reference< XIdlClass > xClass;
             if( xField.is() )
             {
                 try
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index f0166383c14e..3fd6e025a7c9 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3927,7 +3927,6 @@ OUString getObjectTypeName( SbxVariable* pVar )
                 if ( xServInfo.is() )
                 {
                     // is this a VBA object ?
-                    uno::Reference< ooo::vba::XHelperInterface > xVBA( aObj, uno::UNO_QUERY );
                     Sequence< OUString > sServices = xServInfo->getSupportedServiceNames();
                     if ( sServices.getLength() )
                     {
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 3e5af6eed373..4aab96ec6d95 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1058,8 +1058,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
             }
             if( mxSFI->isFolder( aPrevFolder ) )
             {
-                SfxLibraryContainer* pPrevCont = createInstanceImpl();
-                Reference< XInterface > xRef = static_cast< XInterface* >( static_cast< OWeakObject* >(pPrevCont) );
+                rtl::Reference<SfxLibraryContainer> pPrevCont = createInstanceImpl();
 
                 // Rename previous basic folder to make storage URLs correct during initialisation
                 OUString aFolderUserBasic = aUserBasicInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
@@ -1266,7 +1265,7 @@ void SfxLibraryContainer::implScanExtensions()
 
         // Create link
         const bool bReadOnly = false;
-        Reference< XNameAccess > xLib = createLibraryLink( aLibName, aIndexFileURL, bReadOnly );
+        createLibraryLink( aLibName, aIndexFileURL, bReadOnly );
     }
 #else
     (void) this;
@@ -3261,7 +3260,6 @@ ScriptSubPackageIterator::ScriptSubPackageIterator( Reference< deployment::XPack
     , m_nSubPkgCount( 0 )
     , m_iNextSubPkg( 0 )
 {
-    Reference< deployment::XPackage > xScriptPackage;
     if( !m_xMainPackage.is() )
     {
         return;
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index abc07cf85942..3d4f789169d7 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -687,7 +687,6 @@ Reference< drawing::XShape > SAL_CALL ChartDocumentWrapper::getLegend()
     if( ! m_xLegend.is())
     {
         m_xLegend = new LegendWrapper( m_spChart2ModelContact );
-        Reference< lang::XComponent > xComp( m_xLegend, uno::UNO_QUERY );
     }
 
     return m_xLegend;
@@ -698,7 +697,6 @@ Reference< beans::XPropertySet > SAL_CALL ChartDocumentWrapper::getArea()
     if( ! m_xArea.is())
     {
         m_xArea.set( new AreaWrapper( m_spChart2ModelContact ) );
-        Reference< lang::XComponent > xComp( m_xArea, uno::UNO_QUERY );
     }
 
     return m_xArea;
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index b62f1705acd4..c1614607ef00 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -687,8 +687,6 @@ Reference<
         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
                                               static_cast< ::cppu::OWeakObject * >( this ));
 
-    Reference< chart2::XDataSeries > xSeries;
-
     sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
     if( nNewAPIIndex < 0 )
         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
@@ -706,8 +704,6 @@ Reference<
         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
                                               static_cast< ::cppu::OWeakObject * >( this ));
 
-    Reference< chart2::XDataSeries > xSeries;
-
     sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
     if( nNewAPIIndex < 0 )
         throw lang::IndexOutOfBoundsException("DataSeries index invalid",
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 646a27a35cb1..fdff4e769147 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -45,18 +45,14 @@ void ChartController::executeDispatch_EditData()
     Reference< chart2::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
     if( xChartDoc.is())
     {
-        Reference< css::chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider());
-
-        {
-            SolarMutexGuard aSolarGuard;
-            UndoLiveUpdateGuardWithData aUndoGuard(
-                SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
-                m_xUndoManager );
-            ScopedVclPtrInstance<DataEditor> aDataEditorDialog( nullptr, xChartDoc, m_xCC );
-            if (aDataEditorDialog->Execute() == RET_OK)
-                aDataEditorDialog->ApplyChangesToModel();
-            aUndoGuard.commit();
-        }
+        SolarMutexGuard aSolarGuard;
+        UndoLiveUpdateGuardWithData aUndoGuard(
+            SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
+            m_xUndoManager );
+        ScopedVclPtrInstance<DataEditor> aDataEditorDialog( nullptr, xChartDoc, m_xCC );
+        if (aDataEditorDialog->Execute() == RET_OK)
+            aDataEditorDialog->ApplyChangesToModel();
+        aUndoGuard.commit();
     }
 }
 
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index b5577ff40f57..795b3b38b08c 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -174,7 +174,6 @@ wrapper::ItemConverter* createItemConverter(
                     pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
 
                 uno::Reference<XDataSeries> xSeries = ObjectIdentifier::getDataSeriesForCID(aObjectCID, xChartModel);
-                uno::Reference<XChartType> xChartType = ChartModelHelper::getChartTypeOfSeries(xChartModel, xSeries);
 
                 uno::Reference<XDiagram> xDiagram = ChartModelHelper::findDiagram(xChartModel);
 
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 53b7594e412a..50f0a12b474a 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -859,7 +859,6 @@ void ChartController::executeDispatch_ToggleLegend()
 
 void ChartController::executeDispatch_ToggleGridHorizontal()
 {
-    Reference< frame::XModel > xModel( getModel() );
     UndoGuard aUndoGuard(
         SCH_RESSTR( STR_ACTION_TOGGLE_GRID_HORZ ), m_xUndoManager );
     Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
@@ -893,7 +892,6 @@ void ChartController::executeDispatch_ToggleGridHorizontal()
 
 void ChartController::executeDispatch_ToggleGridVertical()
 {
-    Reference< frame::XModel > xModel( getModel() );
     UndoGuard aUndoGuard(
         SCH_RESSTR( STR_ACTION_TOGGLE_GRID_VERTICAL ), m_xUndoManager );
     Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index ca18efbabe77..6eb04776332b 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -162,9 +162,7 @@ void setTrendlineVisible(const css::uno::Reference<css::frame::XModel>&
 
     if (bVisible)
     {
-        /* code */
-        uno::Reference< chart2::XRegressionCurve > xCurve =
-            RegressionCurveHelper::addRegressionCurve(
+        RegressionCurveHelper::addRegressionCurve(
                     SvxChartRegress::Linear,
                     xRegressionCurveContainer,
                     comphelper::getProcessComponentContext());
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 1b3e233b5218..48d38e832850 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1173,7 +1173,6 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
 // ____ XMultiServiceFactory ____
 Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString& rServiceSpecifier )
 {
-    uno::Reference< uno::XInterface > xResult;
     tServiceNameMap & rMap = lcl_getStaticServiceNameMap();
 
     tServiceNameMap::const_iterator aIt( rMap.find( rServiceSpecifier ));
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 473d1eed8015..26ea1979e991 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -981,7 +981,6 @@ void AxisHelper::getAxisOrGridExcistence( Sequence< sal_Bool >& rExistenceList
     if(bAxis)
     {
         sal_Int32 nN;
-        Reference< XAxis > xAxis;
         for(nN=0;nN<3;nN++)
             rExistenceList[nN] = AxisHelper::isAxisShown( nN, true, xDiagram );
         for(nN=3;nN<6;nN++)
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 3bc8e462a839..d0d29a1c324e 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -769,7 +769,6 @@ std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram(
 {
     std::vector< Reference< XAxis > > aRet;
 
-    Reference< XAxis > xResult;
     // return first x-axis as fall-back
     Reference< XAxis > xFallBack;
     try
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 925c5e56f72a..9f5998297ff0 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -173,7 +173,6 @@ void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< OUStr
     if(!nCount)
         return;
     rOutTexts.realloc(nCount);
-    Reference< util::XNumberFormats > xNumberFormats( rModel.getNumberFormats() );
 
     sal_Int32 nAxisNumberFormat = 0;
     Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( rModel ) );
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 64ada6d2af09..3ff5cd913cfb 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1840,7 +1840,7 @@ void VCartesianAxis::createShapes()
                     {std::initializer_list<awt::Point>{
                         {static_cast<sal_Int32>(aStart.getX()), static_cast<sal_Int32>(aStart.getY())},
                         {static_cast<sal_Int32>(aEnd.getX()), static_cast<sal_Int32>(aEnd.getY())} }}};
-                Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
+                m_pShapeFactory->createLine2D(
                         m_xGroupShape_Shapes, aPoints, &m_aAxisProperties.m_aLineProperties );
             }
         }
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index 0ccc53df3dcb..326da900cf8b 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -181,8 +181,7 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
             getPropNamesAndValues( xLegendEntryProperties, aPropNames, aPropValues,
                     ePropertyType, awt::Size(0,0) );// PropertyType::FilledSeries
 
-            Reference< drawing::XShape > xShape =
-                pShapeFactory->createRectangle( xResultGroup,
+            pShapeFactory->createRectangle( xResultGroup,
                         rEntryKeyAspectRatio, awt::Point( 0, 0 ),
                         aPropNames, aPropValues );
         }
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index d822f51f7de4..4aec70aebb83 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -64,8 +64,6 @@ uno::Reference< lang::XSingleServiceFactory > OStorageHelper::GetStorageFactory(
 uno::Reference< lang::XSingleServiceFactory > OStorageHelper::GetFileSystemStorageFactory(
                             const uno::Reference< uno::XComponentContext >& rxContext )
 {
-    uno::Reference< uno::XComponentContext> xContext = rxContext.is() ? rxContext : ::comphelper::getProcessComponentContext();
-
     return embed::FileSystemStorageFactory::create(rxContext);
 }
 
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 209332ebeb38..435a0cc21d19 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -444,7 +444,6 @@ OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xC
     if (!nKey)
     {
         Reference<XNumberFormats> xFormats( _xFormatter->getNumberFormatsSupplier()->getNumberFormats() );
-        Reference<XNumberFormatTypes> xTypeList(_xFormatter->getNumberFormatsSupplier()->getNumberFormats(), UNO_QUERY);
 
         nKey = ::dbtools::getDefaultNumberFormat(_xColumn,
                                            Reference< XNumberFormatTypes > (xFormats, UNO_QUERY),
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index a63e1cd6ffe7..1b17eb112d49 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -436,8 +436,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R
             {
                 if ( _bAttachAutoDisposer )
                 {
-                    OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( _rxRowSet, xConnection );
-                    Reference< XPropertyChangeListener > xEnsureDelete(pAutoDispose);
+                    rtl::Reference<OAutoConnectionDisposer> pAutoDispose = new OAutoConnectionDisposer( _rxRowSet, xConnection );
                 }
                 else
                     xRowSetProps->setPropertyValue(
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 43c0b424200e..000cd740f513 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -536,7 +536,6 @@ Reference<XPropertySet> createSDBCXColumn(const Reference<XPropertySet>& _xTable
         return xProp;
 
     ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
-    Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
     Any aCatalog;
     aCatalog = _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME));
     OUString sCatalog;
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 758f5a9d097a..1ab8289ffe59 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -313,7 +313,6 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
 
         const OUString* pColBegin = aColNames.getConstArray();
         const OUString* pColEnd = pColBegin + aColNames.getLength();
-        Reference< XPropertySet> xColumn;
         for(sal_Int32 j=1;pColBegin != pColEnd;++pColBegin,++j)
         {
             aRow[8] = new ORowSetValueDecorator(j);
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 283700649dea..f3ec08b0ee44 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -593,7 +593,6 @@ bool ODbaseIndex::CreateImpl()
         Reference< XUnoTunnel> xTunnel(xSet, UNO_QUERY_THROW);
         ODbaseResultSet* pDbaseRes = reinterpret_cast< ODbaseResultSet* >( xTunnel->getSomething(ODbaseResultSet::getUnoTunnelImplementationId()) );
         assert(pDbaseRes); //"No dbase resultset found? What's going on here!
-        Reference<XRowLocate> xRowLocate(xSet,UNO_QUERY);
         nRowsLeft = xSet->getRow();
 
         xSet->beforeFirst();
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 896405c9a745..6fccaeb6d6ad 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -278,9 +278,8 @@ sal_Int32 SAL_CALL OStatement::executeUpdate( const OUString& sql )
 
 
     construct(sql);
-    OResultSet* pResult = createResultSet();
-    Reference< XResultSet > xRS = pResult;
-    initializeResultSet(pResult);
+    rtl::Reference<OResultSet> pResult = createResultSet();
+    initializeResultSet(pResult.get());
     pResult->OpenImpl();
 
     return pResult->getRowCountResult();
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index 9fe66357e010..e3bdc3540cf0 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -175,8 +175,6 @@ Sequence< OUString > SAL_CALL FirebirdDriver::getSupportedServiceNames()
 Reference< XConnection > SAL_CALL FirebirdDriver::connect(
     const OUString& url, const Sequence< PropertyValue >& info )
 {
-    Reference< XConnection > xConnection;
-
     SAL_INFO("connectivity.firebird", "connect(), URL: " << url );
 
     MutexGuard aGuard( m_aMutex );
diff --git a/connectivity/source/drivers/firebird/Keys.cxx b/connectivity/source/drivers/firebird/Keys.cxx
index e67723009dec..f75ced0938c2 100644
--- a/connectivity/source/drivers/firebird/Keys.cxx
+++ b/connectivity/source/drivers/firebird/Keys.cxx
@@ -34,8 +34,6 @@ Keys::Keys(Table* pTable, Mutex& rMutex, const TStringVector& rNames):
 //----- XDrop ----------------------------------------------------------------
 void Keys::dropObject(sal_Int32 nPosition, const OUString& sName)
 {
-    Reference< XConnection> xConnection = m_pTable->getConnection();
-
     if (!m_pTable->isNew())
     {
         uno::Reference<XPropertySet> xKey(getObject(nPosition), UNO_QUERY);
diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
index 122efca9e511..7894ba65d7d2 100644
--- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
@@ -384,7 +384,6 @@ void Container::removeContainerListener(
 
 void Container::fire( const EventBroadcastHelper &helper )
 {
-    Reference< css::util::XRefreshListener > l;
     cppu::OInterfaceContainerHelper *container = rBHelper.getContainer( helper.getType() );
     if( container )
     {
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index 3c521ab02b41..6b81ac0da090 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -740,7 +740,6 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory()
     {
         Reference<XInterface > x = xSMgr->createInstance( aActivatorName );
         Reference<XImplementationLoader > xLoader( x, UNO_QUERY );
-        Reference<XInterface > xMF;
         if (xLoader.is())
         {
             xFactory = xLoader->activate( aImplementationName, aActivatorUrl, aLocation, xImplementationKey );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 92c3422731ce..3228f627e6ab 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -4166,9 +4166,6 @@ void ToolbarSaveInData::CreateToolbar( SvxConfigEntry* pToolbar )
     uno::Reference< container::XIndexAccess >
         xSettings( GetConfigManager()->createSettings(), uno::UNO_QUERY );
 
-    uno::Reference< container::XIndexContainer >
-        xIndexContainer ( xSettings, uno::UNO_QUERY );
-
     uno::Reference< beans::XPropertySet >
         xPropertySet( xSettings, uno::UNO_QUERY );
 
@@ -5321,8 +5318,6 @@ void SvxIconSelectorDialog::ImportGraphics(
     OUString aIconName;
     uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
     aMediaProps[0].Name = "URL";
-    uno::Reference< css::ui::XUIConfigurationPersistence >
-        xConfigPer( m_xImportedImageManager, uno::UNO_QUERY );
 
     if ( rPaths.getLength() == 1 )
     {
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 5fa6aeee1760..237da1ab0079 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1097,7 +1097,6 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck)
                         ++i;
                     }
 
-                    uno::Reference< lang::XServiceInfo > xInfo( aStart->xGrammarChecker, uno::UNO_QUERY );
                     SpellErrorDescription aDesc( true,
                         aStart->sText,
                         LanguageTag::convertToLocale( aStart->eLanguage ),
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index e4106a558944..ca8bd5d5c392 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -524,7 +524,6 @@ short SvxScriptOrgDialog::Execute()
                                         ( pDoc->GetModel(), UNO_QUERY );
         if ( xSPS.is() )
         {
-            Reference< provider::XScriptProvider > ScriptProvider =
             xSPS->getScriptProvider();
         }
 
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 148cbc025b50..37edc4c67692 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1574,7 +1574,6 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
                 xDic = aDics.getConstArray()[ nDicPos ];
                 if (xDic.is())
                 {
-                    uno::Reference< XSpellChecker1 > xSpellChecker1;
                     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                     if(pFact)
                     {
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 5cb57a8a3de8..b731fc6f35f8 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -2387,8 +2387,7 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
     sal_Int32 nSelCnt = m_pLBEntries->GetSelectEntryCount();
     if (m_pAutoCompleteList && nSelCnt)
     {
-        TransferDataContainer* pCntnr = new TransferDataContainer;
-        css::uno::Reference< css::datatransfer::XTransferable > xRef( pCntnr );
+        rtl::Reference<TransferDataContainer> pCntnr = new TransferDataContainer;
 
         OStringBuffer sData;
 
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index a17546833bc0..abc79e6b8aab 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -205,9 +205,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow
     if(xIndexSup.is())
         xIndexes.set(xIndexSup->getIndexes(),UNO_QUERY);
 
-    //  Reference<XColumnsSupplier>
     Reference<XPropertySet> xIndexColsSup;
-    Reference<XNameAccess> xIndexColumns;
     std::vector< Reference<XNameAccess> > aAllIndexColumns;
     if(xIndexes.is())
     {
@@ -334,7 +332,6 @@ void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connecti
 
     //  Reference<XColumnsSupplier>
     Reference<XPropertySet> xIndexColsSup;
-    Reference<XNameAccess> xIndexColumns;
     std::vector< Reference<XNameAccess> > aAllIndexColumns;
     if(xIndexes.is())
     {
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 1e47c56cbdc6..9e6a7b5569f5 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1843,7 +1843,6 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
 
         // get the numberformatTypes
         OSL_ENSURE(m_xActiveConnection.is(),"No ActiveConnection");
-        Reference< XNumberFormatTypes> xNumberFormatTypes;
         Reference< XNumberFormatsSupplier> xNumberFormat = ::dbtools::getNumberFormats(m_xActiveConnection);
         if ( xNumberFormat.is() )
             m_xNumberFormatTypes.set(xNumberFormat->getNumberFormats(),UNO_QUERY);
diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx
index 0d3add13f1a6..246c0fd21cc9 100644
--- a/dbaccess/source/core/api/querycontainer.cxx
+++ b/dbaccess/source/core/api/querycontainer.cxx
@@ -267,7 +267,6 @@ void SAL_CALL OQueryContainer::elementRemoved( const css::container::ContainerEv
 
 void SAL_CALL OQueryContainer::elementReplaced( const css::container::ContainerEvent& _rEvent )
 {
-    Reference< XPropertySet > xReplacedElement;
     Reference< XContent > xNewElement;
     OUString sAccessor;
     _rEvent.Accessor >>= sAccessor;
diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx
index 45b07ead62eb..87aa114e1189 100644
--- a/dbaccess/source/core/api/viewcontainer.cxx
+++ b/dbaccess/source/core/api/viewcontainer.cxx
@@ -107,7 +107,6 @@ Reference< XPropertySet > OViewContainer::createDescriptor()
     Reference< XPropertySet > xRet;
     // first we have to look if the master tables support this
     // and if so then create a table object as well with the master tables
-    Reference<XColumnsSupplier > xMasterColumnsSup;
     Reference<XDataDescriptorFactory> xDataFactory(m_xMasterContainer,UNO_QUERY);
     if(xDataFactory.is())
         xRet = xDataFactory->createDataDescriptor();
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 82a8869b6ad8..c23e95853a7a 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1316,7 +1316,6 @@ void ODocumentDefinition::saveAs()
             ::SolarMutexGuard aSolarGuard;
 
             // the request
-            Reference<XNameAccess> xName(m_xParentContainer,UNO_QUERY);
             DocumentSaveRequest aRequest;
             aRequest.Name = m_pImpl->m_aProps.aTitle;
 
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 97b5c5a6824f..eaa8afec3cd8 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -722,7 +722,6 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
     uno::Reference< sdbc::XResultSet> xRes( m_xRowSet, uno::UNO_QUERY_THROW );
     uno::Reference< sdbc::XRow> xRow( m_xRowSet,uno::UNO_QUERY_THROW );
     uno::Reference< sdbc::XResultSetMetaDataSupplier > xSuppMeta( m_xRowSet,uno::UNO_QUERY_THROW );
-    uno::Reference< sdbc::XResultSetMetaData > xResultSetMetaData( xSuppMeta->getMetaData(), uno::UNO_SET_THROW );
     uno::Reference< sdbc::XColumnLocate > xColumnLocate( m_xRowSet, uno::UNO_QUERY_THROW );
 
     for (   ColumnDescriptions::iterator col = aColumns.begin();
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index a3949f974372..626ff623e74a 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -360,8 +360,6 @@ void SAL_CALL OApplicationController::disposing()
             m_xDataSource->removePropertyChangeListener(PROPERTY_TABLEFILTER, this);
             m_xDataSource->removePropertyChangeListener(PROPERTY_TABLETYPEFILTER, this);
             m_xDataSource->removePropertyChangeListener(PROPERTY_USER, this);
-            // otherwise we may delete our datasource twice
-            Reference<XPropertySet> xProp = m_xDataSource;
             m_xDataSource = nullptr;
         }
 
@@ -989,9 +987,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
                 break;
             case ID_BROWSER_COPY:
                 {
-                    TransferableHelper* pTransfer = copyObject( );
-                    Reference< XTransferable> aEnsureDelete = pTransfer;
-
+                    rtl::Reference<TransferableHelper> pTransfer = copyObject();
                     if ( pTransfer )
                         pTransfer->CopyToClipboard(getView());
                 }
@@ -1584,7 +1580,6 @@ void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rE
         try
         {
             _rEvent.Accessor >>= sName;
-            Reference<XConnection> xConnection;
             Reference<XPropertySet> xProp(_rEvent.Element,UNO_QUERY);
             OUString sNewName;
 
@@ -2305,13 +2300,12 @@ bool OApplicationController::requestQuickHelp( const SvTreeListEntry* /*_pEntry*
 
 bool OApplicationController::requestDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ )
 {
-    TransferableHelper* pTransfer = nullptr;
+    rtl::Reference<TransferableHelper> pTransfer;
     if ( getContainer() && getContainer()->getSelectionCount() )
     {
         try
         {
             pTransfer = copyObject( );
-            Reference< XTransferable> xEnsureDelete = pTransfer;
 
             if ( pTransfer && getContainer()->getDetailView() )
             {
@@ -2325,7 +2319,7 @@ bool OApplicationController::requestDrag( sal_Int8 /*_nAction*/, const Point& /*
         }
     }
 
-    return nullptr != pTransfer;
+    return pTransfer.is();
 }
 
 sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors )
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 361575afdf50..f72f1355f116 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1825,8 +1825,6 @@ void SbaXDataBrowserController::ExecuteSearch()
     xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(true));
     xModelSet->setPropertyValue("CursorColor", makeAny(sal_Int32(COL_LIGHTRED)));
 
-    Reference< css::util::XNumberFormatsSupplier >  xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), true, getORB()));
-
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     VclPtr<AbstractFmSearchDialog> pDialog;
     if ( pFact )
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index a09b4a000744..bcdb8cb216e8 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -186,13 +186,12 @@ namespace dbaui
         if (!isObject(eEntryType))
             return false;
 
-        TransferableHelper* pTransfer = implCopyObject( pHitEntry, ( etTableOrView == eEntryType ) ? CommandType::TABLE : CommandType::QUERY);
-        Reference< XTransferable> xEnsureDelete = pTransfer;
+        rtl::Reference<TransferableHelper> pTransfer = implCopyObject( pHitEntry, ( etTableOrView == eEntryType ) ? CommandType::TABLE : CommandType::QUERY);
 
         if (pTransfer)
             pTransfer->StartDrag( &m_pTreeView->getListBox(), DND_ACTION_COPY );
 
-        return nullptr != pTransfer;
+        return pTransfer.is();
     }
     IMPL_LINK_NOARG(SbaTableQueryBrowser, OnCopyEntry, LinkParamNone*, void)
     {
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 6983e70fbe14..af4e291c878c 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -699,8 +699,7 @@ void SbaGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupM
                 std::vector< std::shared_ptr<OTableRow> > vClipboardList;
                 // send it to the clipboard
                 vClipboardList.push_back(std::make_shared<OTableRow>(xField));
-                OTableRowExchange* pData = new OTableRowExchange(vClipboardList);
-                Reference< css::datatransfer::XTransferable> xRef = pData;
+                rtl::Reference<OTableRowExchange> pData = new OTableRowExchange(vClipboardList);
                 pData->CopyToClipboard(GetParent());
             }
             break;
@@ -1143,8 +1142,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos)
     if (sField.isEmpty())
         return;
 
-    OColumnTransferable* pDataTransfer = new OColumnTransferable(xDataSource, sField, xAffectedField, xActiveConnection, ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR);
-    Reference< XTransferable > xEnsureDelete = pDataTransfer;
+    rtl::Reference<OColumnTransferable> pDataTransfer = new OColumnTransferable(xDataSource, sField, xAffectedField, xActiveConnection, ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR);
     pDataTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK);
 }
 
@@ -1176,12 +1174,10 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC
         bSelectionBookmarks = true;
     }
 
-    Reference< XResultSet> xRowSetClone;
     try
     {
-        ODataClipboard* pTransfer = new ODataClipboard( xForm, aSelectedRows, bSelectionBookmarks, getContext() );
+        rtl::Reference<ODataClipboard> pTransfer = new ODataClipboard( xForm, aSelectedRows, bSelectionBookmarks, getContext() );
 
-        Reference< XTransferable > xEnsureDelete = pTransfer;
         if ( _bTrueIfClipboardFalseIfDrag )
             pTransfer->CopyToClipboard( this );
         else
@@ -1403,7 +1399,6 @@ Reference< XPropertySet >  SbaGridControl::getDataSource() const
     Reference< XPropertySet >  xReturn;
 
     Reference< XChild >  xColumns(GetPeer()->getColumns(), UNO_QUERY);
-    Reference< XPropertySet >  xDataSource;
     if (xColumns.is())
         xReturn.set(xColumns->getParent(), UNO_QUERY);
 
@@ -1422,8 +1417,7 @@ IMPL_LINK_NOARG(SbaGridControl, AsynchDropEvent, void*, void)
         if ( !bCountFinal )
             setDataSource(nullptr); // detach from grid control
         Reference< XResultSetUpdate > xResultSetUpdate(xDataSource,UNO_QUERY);
-        ODatabaseImportExport* pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor, getContext());
-        Reference<XEventListener> xHolder = pImExport;
+        rtl::Reference<ODatabaseImportExport> pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor, getContext());
         Hide();
         try
         {
diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx
index 661f6813f4a3..fa21ecb34fb3 100644
--- a/dbaccess/source/ui/control/opendoccontrols.cxx
+++ b/dbaccess/source/ui/control/opendoccontrols.cxx
@@ -62,7 +62,6 @@ namespace dbaui
             if ( !_pCommandURL || !*_pCommandURL )
                 return aIcon;
 
-            Reference< XNameAccess > xUICommandLabels;
             OUString sCommandURL = OUString::createFromAscii( _pCommandURL );
             try
             {
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index dfc2631f9c1e..7084019c5d5d 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -178,7 +178,6 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, Button*, void)
         Reference<XNameContainer> xNameContainer(m_xContent,UNO_QUERY);
         if ( xNameContainer.is() )
         {
-            Reference< XContent> xContent;
             if ( xNameContainer->hasByName(sName) )
             {
                 ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 8509de26e359..9139bef7c531 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -273,7 +273,6 @@ namespace dbaui
                 m_pTablesList->GetModel()->SetSortMode(SortAscending);
                 m_pTablesList->GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare));
 
-                Reference< XDriver > xDriver;
                 Reference<XPropertySet> xProp = m_pTablesDlg->getCurrentDataSource();
                 OSL_ENSURE(xProp.is(),"No data source set!");
                 if ( xProp.is() )
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index b3c390171ec3..f81c7fa651d0 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -271,7 +271,6 @@ void ODatabaseImportExport::initialize()
     }
     if(xNameAccess.is() && xNameAccess->hasByName(m_sName))
     {
-        Reference<XPropertySet> xSourceObject;
         xNameAccess->getByName(m_sName) >>= m_xObject;
     }
 
@@ -473,7 +472,6 @@ bool ORTFImportExport::Write()
         m_pStream->WriteCharPtr( SAL_NEWLINE_STRING ).WriteChar( '}' );
         m_pStream->WriteCharPtr( SAL_NEWLINE_STRING );
 
-        Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
         sal_Int32 k=1;
         sal_Int32 kk=0;
         if ( m_aSelection.getLength() )
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 85acecdb4700..bc8c16928413 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1354,7 +1354,6 @@ namespace
                 if ( xConnection.is() )
                 {
                     OUString aColumnName;
-                    Reference< XDatabaseMetaData >  xMetaData = xConnection->getMetaData();
                     // the international doesn't matter I have a string
                     pCondition->parseNodeToPredicateStr(aCondition,
                                                         xConnection,
@@ -1430,7 +1429,6 @@ namespace
                 // Parse the function condition
                 OUString sCondition = ParseCondition(rController,pCondition,sDecimal,aLocale,1);
                 Reference< XConnection> xConnection = rController.getConnection();
-                Reference< XDatabaseMetaData >  xMetaData = xConnection->getMetaData();
                     // the international doesn't matter I have a string
                 OUString sName;
                 pCondition->getChild(0)->parseNodeToPredicateStr(sName,
@@ -1488,7 +1486,6 @@ namespace
             OUString aCondition;
             OUString aColumnName;
             OTableFieldDescRef aDragLeft = new OTableFieldDesc();
-            Reference< XDatabaseMetaData >  xMetaData = xConnection->getMetaData();
             pCondition->parseNodeToPredicateStr(aCondition,
                                                 xConnection,
                                                 rController.getNumberFormatter(),
@@ -1656,7 +1653,6 @@ namespace
                 Reference< XConnection> xConnection = rController.getConnection();
                 if(xConnection.is())
                 {
-                    Reference< XDatabaseMetaData >  xMetaData = xConnection->getMetaData();
                     for (; i >= 0; i--)
                         pCondition->getChild(i)->parseNodeToPredicateStr(aCondition,
                                                 xConnection,
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index 82aefa64fa4f..fae19f31f19f 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -206,8 +206,7 @@ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPi
         // create a description of the source
         OJoinExchangeData jxdSource(this);
         // put it into a exchange object
-        OJoinExchObj* pJoin = new OJoinExchObj(jxdSource,bFirstNotAllowed);
-        Reference< XTransferable > xEnsureDelete(pJoin);
+        rtl::Reference<OJoinExchObj> pJoin = new OJoinExchObj(jxdSource,bFirstNotAllowed);
         pJoin->StartDrag(this, DND_ACTION_LINK, this);
     }
 }
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 7bca5f87db98..a066fa62b088 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -733,8 +733,7 @@ void OTableEditorCtrl::CopyRows()
     }
     if(!vClipboardList.empty())
     {
-        OTableRowExchange* pData = new OTableRowExchange(vClipboardList);
-        Reference< css::datatransfer::XTransferable> xRef = pData;
+        rtl::Reference<OTableRowExchange> pData = new OTableRowExchange(vClipboardList);
         pData->CopyToClipboard(GetParent());
     }
 }
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 714299e9061b..4a86547a56d9 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2021,7 +2021,6 @@ void Desktop::OpenClients()
 
     // check if a document has been recovered - if there is one of if a document was loaded by cmdline, no default document
     // should be created
-    Reference < XComponent > xFirst;
     bool bRecovery = false;
 
     const CommandLineArgs& rArgs = GetCommandLineArgs();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 9769a8b3b452..9f9760607725 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -335,7 +335,6 @@ void UpdateDialog::Thread::execute()
         dp_misc::UPDATE_SOURCE sourceShared = dp_misc::isUpdateSharedExtension(
             bSharedReadOnly, sVersionShared, sVersionBundled, sOnlineVersion);
 
-        uno::Reference<deployment::XPackage> updateSource;
         if (sourceUser != dp_misc::UPDATE_SOURCE_NONE)
         {
             if (sourceUser == dp_misc::UPDATE_SOURCE_SHARED)
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index e5d31af7c1a3..a53f7e3e5baa 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -762,8 +762,7 @@ Reference<css::deployment::XPackage> ExtensionManager::addExtension(
             {
                 if (xExtensionBackup.is())
                 {
-                    Reference<css::deployment::XPackage> xRestored =
-                        xPackageManager->importExtension(
+                    xPackageManager->importExtension(
                             xExtensionBackup, Reference<task::XAbortChannel>(),
                             Reference<ucb::XCommandEnvironment>());
                 }
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 7a1b917ab363..be141b68210c 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -398,7 +398,6 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName)
     uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(aMigrationSteps), uno::UNO_QUERY_THROW);
     uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames();
     uno::Reference< XNameAccess > tmpAccess;
-    uno::Reference< XNameAccess > tmpAccess2;
     uno::Sequence< OUString > tmpSeq;
     migrations_vr vrMigrations(new migrations_v);
     for (sal_Int32 i = 0; i < seqMigrations.getLength(); i++) {
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx
index 58551484c162..f39ea1b46d84 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -1809,7 +1809,6 @@ void dumpXShape(const uno::Reference< drawing::XShape >& xShape, xmlTextWriterPt
 {
     xmlTextWriterStartElement( xmlWriter, BAD_CAST( "XShape" ) );
     uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY_THROW);
-    uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
     OUString aName;
     m_bNameDumped = false;
 
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 5e227a6bfd06..197cfcdf13b5 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -277,7 +277,6 @@ void SvxSpellWrapper::SpellDocument( )
 
     if ( FindSpellError() )
     {
-        Reference< XSpellAlternatives >     xAlt( GetLast(), UNO_QUERY );
         Reference< XHyphenatedWord >        xHyphWord( GetLast(), UNO_QUERY );
 
         vcl::Window *pOld = pWin;
@@ -437,8 +436,6 @@ bool SvxSpellWrapper::FindSpellError()
 {
     ShowLanguageErrors();
 
-     Reference< XInterface >    xRef;
-
     WAIT_ON();
     bool bSpell = true;
 
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index 06227f00a834..492e02b4a7b4 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -69,8 +69,6 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
                                             const OUString& sEntName,
                                             const uno::Sequence< beans::PropertyValue >& lObjArgs )
 {
-    uno::Reference< uno::XInterface > xResult;
-
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
                                             static_cast< ::cppu::OWeakObject* >(this),
@@ -277,8 +275,6 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
         const uno::Sequence< beans::PropertyValue >& aArgs,
         const uno::Sequence< beans::PropertyValue >& aObjectArgs )
 {
-    uno::Reference< uno::XInterface > xResult;
-
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
                                             static_cast< ::cppu::OWeakObject* >(this),
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index aaaf92980e76..a6c5deba6924 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -110,7 +110,6 @@ Reference< XConnection > getConnection(const OUString& _rURL)
     if (xDataSource.is())
     {
         // need user/pwd for this
-        Reference< XPropertySet >  xDataSourceProps(xDataSource, UNO_QUERY);
         Reference< XCompletedConnection > xComplConn(xDataSource, UNO_QUERY);
         try
         {
@@ -1294,7 +1293,6 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
         {
             aElement = xFields->getByName(rName);
             aElement >>= xField;
-            Reference< XPropertySetInfo >  xInfo = xField.is() ? xField->getPropertySetInfo() : Reference< XPropertySetInfo > ();
 
             const OUString sType("Type");
             sal_Int32 nFormatKey = 0;
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index 61bbcb7794eb..51d661e37731 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -720,13 +720,10 @@ void BibFrameController_Impl::addStatusListener(
                     }
                 }
             }
-            uno::Reference< datatransfer::XTransferable > xContents = xClip->getContents(  );
         }
     }
     else if(aURL.Path == "Bib/DeleteRecord")
     {
-        Reference< css::sdbc::XResultSet >  xCursor(m_xDatMan->getForm(), UNO_QUERY);
-        Reference< XResultSetUpdate >       xUpdateCursor(xCursor, UNO_QUERY);
         Reference< beans::XPropertySet >    xSet(m_xDatMan->getForm(), UNO_QUERY);
         bool  bIsNew  = ::comphelper::getBOOL(xSet->getPropertyValue("IsNew"));
         if(!bIsNew)
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index eb42d78be697..68bc88dae26a 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -438,8 +438,7 @@ namespace dbp
             {
                 // for this, use a AutoDisposer (so the conn is cleaned up when the form dies or get's another connection)
                 Reference< XRowSet > xFormRowSet( m_aContext.xForm, UNO_QUERY );
-                OAutoConnectionDisposer* pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn );
-                Reference< XPropertyChangeListener > xEnsureDelete( pAutoDispose );
+                rtl::Reference<OAutoConnectionDisposer> pAutoDispose = new OAutoConnectionDisposer( xFormRowSet, _rxConn );
             }
             else
             {
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 1918dcd0f8ed..71fb21a05f43 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2057,7 +2057,6 @@ namespace pcr
         }
         else if ( eDialogControl == m_eComponentClass )
         {
-            Reference< XControlModel > xControlModel( m_xComponent, UNO_QUERY );
             Reference< XServiceInfo > xServiceInfo( m_xComponent, UNO_QUERY );
             if ( xServiceInfo.is() )
             {
@@ -2313,8 +2312,6 @@ namespace pcr
         {
             WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() );
 
-            Reference< XPreparedStatement >  xStatement;
-
             // get the form of the control we're inspecting
             Reference< XPropertySet > xFormSet( impl_getRowSet_throw(), UNO_QUERY );
             if ( !xFormSet.is() )
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index ec73aaaf1a35..ebf046128039 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -368,7 +368,6 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea
 
 css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::createSubSetEnumerationByProperties(const css::uno::Sequence< css::beans::NamedValue >& lProperties)
 {
-    css::uno::Reference< css::container::XEnumeration > xEnum;
     OUStringList                                        lKeys;
 
     impl_loadOnDemand();
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 28751feac55e..3d836d9fdb2b 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -610,7 +610,6 @@ void FilterCache::impl_flushByList(const css::uno::Reference< css::container::XN
                                    const OUStringList&                                       lItems)
 {
     css::uno::Reference< css::container::XNameContainer >   xAddRemoveSet(xSet, css::uno::UNO_QUERY);
-    css::uno::Reference< css::container::XNameReplace >     xReplaceeSet(xSet, css::uno::UNO_QUERY);
     css::uno::Reference< css::lang::XSingleServiceFactory > xFactory(xSet, css::uno::UNO_QUERY);
 
     for (OUStringList::const_iterator pIt  = lItems.begin();
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index 0eb3dfce6551..a2d844fb3723 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -420,7 +420,7 @@ void CGMImpressOutAct::EndGroup()
                         aXShapes->add( aXShape );
                     }
                 }
-                uno::Reference< drawing::XShapeGroup >  aXShapeGroup = aXShapeGrouper->group( aXShapes );
+                aXShapeGrouper->group( aXShapes );
             }
         }
     }
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 0546eea3132e..dad573e20adb 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -337,7 +337,6 @@ struct AnnotatingVisitor
                             maElementVector[aFound->second]->cloneNode(true), uno::UNO_QUERY);
 
                         xRefElem->removeAttribute("id");
-                        uno::Reference<xml::dom::XNode> xAttrNode;
 
                         const sal_Int32 nNumAttrs( xAttributes->getLength() );
                         OUString sAttributeValue;
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 99cccf45f3dc..1c9ef265b501 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -77,8 +77,6 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
         xStatusIndicator->start( "Loading :",nProgressRange);
     }
 
-    Reference < XParser > xSaxParser = Parser::create( mxContext );
-
     Sequence< Any > aAnys(1);
     OUString aBaseURI;
     if (aMediaMap.find(OUString( "URL" ))->second >>= aBaseURI)
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index da4357b32fe3..d44d00ac3d5c 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -259,8 +259,6 @@ void XMLFilterJarHelper::openPackage( const OUString& rPackageURL, XMLFilterVect
 
         if( xIfc.is() )
         {
-            Reference< XSingleServiceFactory > xFactory( xIfc, UNO_QUERY );
-
             // get root zip folder
             Reference< XInterface > xRootFolder;
             OUString szRootFolder("/");
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index dd419a171ff4..cc64d8bba73a 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -504,7 +504,6 @@ void OComboBoxModel::loadData( bool _bForce )
                 // in that case we use the first field of the table
 
                 Reference<XNameAccess> xFieldsByName = getTableFields(xConnection, m_aListSource);
-                Reference<XIndexAccess> xFieldsByIndex(xFieldsByName, UNO_QUERY);
 
                 OUString aFieldName;
                 if ( xFieldsByName.is() && xFieldsByName->hasByName( getControlSource() ) )
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 0ce27865f7ce..0261fe1b1404 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -651,7 +651,6 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
 
                 Sequence<Reference<XControl> > aControlSeq = xControlContainer->getControls();
                 Reference<XControl>  xControl;
-                Reference<XFormComponent>  xControlComponent;
 
                 // Find the right control
                 sal_Int32 i;
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 2f4c42cbd272..2a9ed5a896b4 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -416,7 +416,6 @@ void OFormattedModel::_propertyChanged( const css::beans::PropertyChangeEvent& e
     OSL_ENSURE( evt.Source == m_xAggregateSet, "OFormattedModel::_propertyChanged: where did this come from?" );
     if ( evt.Source == m_xAggregateSet )
     {
-        Reference< XPropertySet > xSourceSet( evt.Source, UNO_QUERY );
         if ( evt.PropertyName == PROPERTY_FORMATKEY )
         {
             if ( evt.NewValue.getValueType().getTypeClass() == TypeClass_LONG )
diff --git a/forms/source/component/entrylisthelper.cxx b/forms/source/component/entrylisthelper.cxx
index 4e9202be73da..508ccfd833e9 100644
--- a/forms/source/component/entrylisthelper.cxx
+++ b/forms/source/component/entrylisthelper.cxx
@@ -170,7 +170,6 @@ namespace frm
         OSL_ENSURE( _rEvent.Source == m_xListSource,
             "OEntryListHelper::allEntriesChanged: where did this come from?" );
 
-        Reference< XListEntrySource > xSource( _rEvent.Source, UNO_QUERY );
         if ( _rEvent.Source == m_xListSource )
         {
             impl_lock_refreshList( aLock );
diff --git a/forms/source/xforms/submission/serialization_urlencoded.cxx b/forms/source/xforms/submission/serialization_urlencoded.cxx
index a3dddb11c9fb..0e96edfb643c 100644
--- a/forms/source/xforms/submission/serialization_urlencoded.cxx
+++ b/forms/source/xforms/submission/serialization_urlencoded.cxx
@@ -161,7 +161,6 @@ void CSerializationURLEncoded::serialize()
 {
 
     // output stream to the pipe buffer
-    Reference< XOutputStream > out(m_aPipe, UNO_QUERY);
 
     css::uno::Reference< css::xml::dom::XNode > cur = m_aFragment->getFirstChild();
     while (cur.is())
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index ea78e08be205..6655f232f5ec 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1812,8 +1812,6 @@ short SvtFileDialog::PrepareExecute()
                 = aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY );
             if ( xResultSet.is() )
             {
-                Reference< XRow > xRow( xResultSet, UNO_QUERY );
-
                 bool bEmpty = true;
                 if ( !xResultSet->next() )
                 {
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index c20043eb871b..7f86dbd6de18 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -170,7 +170,6 @@ SAL_CALL PopupMenuDispatcher::queryDispatch(
             m_xUriRefFactory = css::uri::UriReferenceFactory::create( m_xContext );
 
         css::uno::Reference< css::container::XNameAccess > xPopupCtrlQuery( m_xPopupCtrlQuery );
-        css::uno::Reference< css::uri::XUriReferenceFactory > xUriRefFactory( m_xUriRefFactory );
         aGuard.clear();
         // --- SAFE ---
 
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index f2ce6c9fded0..ea6473771d77 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -731,8 +731,7 @@ OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler()
 
 void OWriteMenuDocumentHandler::WriteMenuDocument()
 {
-    ::comphelper::AttributeList* pList = new ::comphelper::AttributeList;
-    Reference< XAttributeList > rList( static_cast<XAttributeList *>(pList) , UNO_QUERY );
+    rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
 
     m_xWriteDocumentHandler->startDocument();
 
@@ -758,7 +757,7 @@ void OWriteMenuDocumentHandler::WriteMenuDocument()
         aRootElement = ELEMENT_NS_MENUBAR;
     else
         aRootElement = ELEMENT_NS_MENUPOPUP;
-    m_xWriteDocumentHandler->startElement( aRootElement, pList );
+    m_xWriteDocumentHandler->startElement( aRootElement, pList.get() );
     m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
 
     WriteMenu( m_xMenuBarContainer );
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index 9bc38a5d82ec..033103d25a80 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -503,8 +503,7 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarDocument()
         m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
     }
 
-    ::comphelper::AttributeList* pList = new ::comphelper::AttributeList;
-    Reference< XAttributeList > xList( static_cast<XAttributeList *>(pList) , UNO_QUERY );
+    rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
 
     pList->AddAttribute( ATTRIBUTE_XMLNS_STATUSBAR,
                          m_aAttributeType,
@@ -514,7 +513,7 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarDocument()
                          m_aAttributeType,
                          XMLNS_XLINK );
 
-    m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList );
+    m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList.get() );
     m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
 
     sal_Int32  nItemCount = m_aStatusBarItems->getCount();
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 52926ca2b917..d73445dd847f 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -630,8 +630,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument()
         }
     }
 
-    ::comphelper::AttributeList* pList = new ::comphelper::AttributeList;
-    Reference< XAttributeList > xList( static_cast<XAttributeList *>(pList) , UNO_QUERY );
+    rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
 
     pList->AddAttribute( ATTRIBUTE_XMLNS_TOOLBAR,
                          m_aAttributeType,
@@ -646,7 +645,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument()
                              m_aAttributeType,
                              aUIName );
 
-    m_xWriteDocumentHandler->startElement( ELEMENT_NS_TOOLBAR, pList );
+    m_xWriteDocumentHandler->startElement( ELEMENT_NS_TOOLBAR, pList.get() );
     m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
 
     sal_Int32  nItemCount = m_rItemAccess->getCount();
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index bb385f0b70ed..577cabf82ac3 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -430,7 +430,6 @@ void StatusIndicatorFactory::impl_showProgress()
     osl::ClearableMutexGuard aReadLock(m_mutex);
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
-    css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
 
     aReadLock.clear();
     // <- SAFE ----------------------------------
@@ -471,7 +470,6 @@ void StatusIndicatorFactory::impl_hideProgress()
     osl::ClearableMutexGuard aReadLock(m_mutex);
 
     css::uno::Reference< css::frame::XFrame >              xFrame (m_xFrame.get()      , css::uno::UNO_QUERY);
-    css::uno::Reference< css::awt::XWindow >               xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY);
 
     aReadLock.clear();
     // <- SAFE ----------------------------------
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index bb67e08af31a..85bf876140a3 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -328,13 +328,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
         aCfg.setEnvironment(JobData::E_DISPATCH);
         const bool bIsEnabled=aCfg.hasCorrectContext(m_sModuleIdentifier);
 
-        /*Attention!
-            Jobs implements interfaces and dies by ref count!
-            And freeing of such uno object is done by uno itself.
-            So we have to use dynamic memory everytimes.
-         */
-        Job* pJob = new Job(m_xContext, m_xFrame);
-        css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
+        rtl::Reference<Job> pJob = new Job(m_xContext, m_xFrame);
         pJob->setJobData(aCfg);
 
         aReadLock.clear();
@@ -395,8 +389,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString&
         And freeing of such uno object is done by uno itself.
         So we have to use dynamic memory everytimes.
      */
-    Job* pJob = new Job(m_xContext, m_xFrame);
-    css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
+    rtl::Reference<Job> pJob = new Job(m_xContext, m_xFrame);
     pJob->setJobData(aCfg);
 
     aReadLock.clear();
@@ -440,13 +433,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString&
     aCfg.setAlias(sAlias);
     aCfg.setEnvironment(JobData::E_DISPATCH);
 
-    /*Attention!
-        Jobs implements interfaces and dies by ref count!
-        And freeing of such uno object is done by uno itself.
-        So we have to use dynamic memory everytimes.
-     */
-    Job* pJob = new Job(m_xContext, m_xFrame);
-    css::uno::Reference< css::uno::XInterface > xJob(static_cast< ::cppu::OWeakObject* >(pJob), css::uno::UNO_QUERY);
+    rtl::Reference<Job> pJob = new Job(m_xContext, m_xFrame);
     pJob->setJobData(aCfg);
 
     aReadLock.clear();
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 01f3a1cb9841..f55ac969e568 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -1303,8 +1303,6 @@ void SAL_CALL LayoutManager::setDockingAreaAcceptor( const Reference< ui::XDocki
             if( pContainerWindow )
                 m_bParentWindowVisible = pContainerWindow->IsVisible();
         }
-
-        uno::Reference< awt::XWindowPeer > xParent( m_xContainerWindow, UNO_QUERY );
     }
 
     aWriteLock.clear();
@@ -1411,7 +1409,6 @@ void SAL_CALL LayoutManager::createElement( const OUString& aName )
 
     SolarMutexClearableGuard aReadLock;
     Reference< XFrame > xFrame = m_xFrame;
-    Reference< XURLTransformer > xURLTransformer = m_xURLTransformer;
     bool    bInPlaceMenu = m_bInplaceMenuSet;
     aReadLock.clear();
 
@@ -1550,7 +1547,6 @@ void SAL_CALL LayoutManager::destroyElement( const OUString& aName )
     OUString aElementType;
     OUString aElementName;
 
-    Reference< XComponent > xComponent;
     parseResourceURL( aName, aElementType, aElementName );
 
     if ( aElementType.equalsIgnoreAsciiCase("menubar") &&
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index e8df5f8282ba..f50db759964c 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1194,7 +1194,6 @@ void ToolbarLayoutManager::implts_createCustomToolBars()
     if ( !m_bComponentAttached )
         return;
 
-    uno::Reference< ui::XUIElementFactory > xUIElementFactory( m_xUIElementFactoryManager );
     uno::Reference< frame::XFrame > xFrame( m_xFrame );
     uno::Reference< ui::XUIConfigurationManager > xModuleCfgMgr( m_xModuleCfgMgr, uno::UNO_QUERY );
     uno::Reference< ui::XUIConfigurationManager > xDocCfgMgr( m_xDocCfgMgr, uno::UNO_QUERY );
@@ -1226,7 +1225,6 @@ void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars()
     if ( !m_xPersistentWindowState.is() || !m_xFrame.is() || !m_bComponentAttached )
         return;
 
-    uno::Reference< ui::XUIElementFactory >  xUIElementFactory( m_xUIElementFactoryManager );
     uno::Reference< container::XNameAccess > xPersistentWindowState( m_xPersistentWindowState );
     aReadLock.clear();
 
@@ -1245,7 +1243,6 @@ void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars()
             OUString aElementName;
             OUString aName;
 
-            uno::Reference< ui::XUIElement > xUIElement;
             aMakeVisibleToolbars.reserve(aToolbarNames.getLength());
 
             SolarMutexGuard g;
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index ea0d610361ae..ab5bb5b42c8c 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1192,7 +1192,6 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent&
         m_eLoadState = E_FAILED;
         if( aEvent.State == css::frame::DispatchResultState::SUCCESS )
         {
-            css::uno::Reference < css::frame::XFrame > xFrame;
             if ( aEvent.Result >>= m_xLastFrame )
                 m_eLoadState = E_SUCCESSFUL;
         }
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 954eb9c38c29..a4e21ae052b8 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -1224,7 +1224,6 @@ void SAL_CALL Frame::activate()
     css::uno::Reference< css::frame::XFrame >           xActiveChild    = m_aChildFrameContainer.getActive();
     css::uno::Reference< css::frame::XFramesSupplier >  xParent         ( m_xParent, css::uno::UNO_QUERY );
     css::uno::Reference< css::frame::XFrame >           xThis           ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
-    css::uno::Reference< css::awt::XWindow >            xComponentWindow( m_xComponentWindow, css::uno::UNO_QUERY );
     EActiveState                                        eState          = m_eActiveState;
 
     aWriteLock.clear();
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 6d8c08516efc..a26eca969db6 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -702,8 +702,6 @@ void ModuleUIConfigurationManager::impl_reloadElementTypeData(
 {
     UIElementDataHashMap& rHashMap          = rUserElementType.aElementsHashMap;
     UIElementDataHashMap::iterator pIter    = rHashMap.begin();
-    Reference< XStorage > xUserStorage( rUserElementType.xStorage );
-    Reference< XStorage > xDefaultStorage( rDefaultElementType.xStorage );
     Reference< XNameAccess > xUserNameAccess( rUserElementType.xStorage, UNO_QUERY );
     Reference< XNameAccess > xDefaultNameAccess( rDefaultElementType.xStorage, UNO_QUERY );
 
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index c121d1ab3e57..d00238d6c9b5 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -262,8 +262,6 @@ Sequence< OUString > ConfigurationAccess_UICategory::getAllIds()
 
     if ( m_xConfigAccess.is() )
     {
-        Reference< XNameAccess > xNameAccess;
-
         try
         {
             Sequence< OUString > aNameSeq = m_xConfigAccess->getElementNames();
diff --git a/framework/source/uielement/notebookbarmenucontroller.cxx b/framework/source/uielement/notebookbarmenucontroller.cxx
index af87f3132f4e..f5f9401d6227 100644
--- a/framework/source/uielement/notebookbarmenucontroller.cxx
+++ b/framework/source/uielement/notebookbarmenucontroller.cxx
@@ -199,7 +199,6 @@ void SAL_CALL NotebookbarMenuController::itemSelected( const css::awt::MenuEvent
     Reference< css::awt::XPopupMenu >   xPopupMenu;
     Reference< XURLTransformer >        xURLTransformer;
     Reference< XFrame >                 xFrame;
-    Reference< XNameAccess >            xPersistentWindowState;
 
     osl::ClearableMutexGuard aLock( m_aMutex );
     xPopupMenu             = m_xPopupMenu;
diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx
index c5b08f190c80..71e498666f36 100644
--- a/framework/source/uielement/subtoolbarcontroller.cxx
+++ b/framework/source/uielement/subtoolbarcontroller.cxx
@@ -224,7 +224,6 @@ css::uno::Reference< css::awt::XWindow > SubToolBarController::createPopupWindow
 
         if ( xUIElement.is() )
         {
-            css::uno::Reference< css::awt::XWindow > xParent = xFrame->getContainerWindow();
             css::uno::Reference< css::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), css::uno::UNO_QUERY );
             if ( xSubToolBar.is() )
             {
@@ -354,7 +353,6 @@ void SubToolBarController::endPopupMode( const css::awt::EndPopupModeEvent& e )
         xUIElement = xLayoutManager->getElement( aSubToolBarResName );
         if ( xUIElement.is() )
         {
-            css::uno::Reference< css::awt::XWindow > xParent = getFrameInterface()->getContainerWindow();
             css::uno::Reference< css::awt::XWindow > xSubToolBar( xUIElement->getRealInterface(), css::uno::UNO_QUERY );
             css::uno::Reference< css::beans::XPropertySet > xProp( xUIElement, css::uno::UNO_QUERY );
             if ( xSubToolBar.is() && xProp.is() )
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx
index 018253bdfb94..f08f69a2a1bb 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -211,7 +211,6 @@ void SAL_CALL ToolbarModeMenuController::itemSelected( const css::awt::MenuEvent
     Reference< css::awt::XPopupMenu >   xPopupMenu;
     Reference< XURLTransformer >        xURLTransformer;
     Reference< XFrame >                 xFrame;
-    Reference< XNameAccess >            xPersistentWindowState;
 
     osl::ClearableMutexGuard aLock( m_aMutex );
     xPopupMenu             = m_xPopupMenu;
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index b900f2c40176..eed5f5c7230e 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -467,8 +467,6 @@ Sequence< OUString > ConfigurationAccess_UICommand::getAllCommands()
 
     if ( m_xConfigAccess.is() )
     {
-        Reference< XNameAccess > xNameAccess;
-
         try
         {
             Sequence< OUString > aNameSeq = m_xConfigAccess->getElementNames();
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 6542f9dcfa74..0cedaf95dba3 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -292,7 +292,6 @@ void ConfigurationAccess_FactoryManager::readConfigurationData()
         OUString             aModule;
         OUString             aService;
         OUString             aHashKey;
-        Reference< XPropertySet > xPropertySet;
         for ( sal_Int32 i = 0; i < aUIElementFactories.getLength(); i++ )
         {
             if ( impl_getElementProps( m_xConfigAccess->getByName( aUIElementFactories[i] ), aType, aName, aModule, aService ))
diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx
index 658242e9249f..45315b773952 100644
--- a/framework/source/xml/imagesdocumenthandler.cxx
+++ b/framework/source/xml/imagesdocumenthandler.cxx
@@ -609,8 +609,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
         m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
     }
 
-    ::comphelper::AttributeList* pList = new ::comphelper::AttributeList;
-    Reference< XAttributeList > xList( static_cast<XAttributeList *>(pList) , UNO_QUERY );
+    rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
 
     pList->AddAttribute( ATTRIBUTE_XMLNS_IMAGE,
                          m_aAttributeType,
@@ -620,7 +619,7 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
                          m_aAttributeType,
                          XMLNS_XLINK );
 
-    m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGESCONTAINER, pList );
+    m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGESCONTAINER, pList.get() );
     m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
 
     if ( m_aImageListsItems.pImageList )
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 6ce6d04ce0c4..e92ed0275f8d 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -142,10 +142,7 @@ bool IsConvDic( const OUString &rFileURL, LanguageType &nLang, sal_Int16 &nConvT
     // first argument being 0 should stop the file from being parsed
     // up to the end (reading all entries) when the required
     // data (language, conversion type) is found.
-    ConvDicXMLImport *pImport = new ConvDicXMLImport( nullptr );
-
-    //!! keep a first reference to ensure the lifetime of the object !!
-    uno::Reference< XInterface > xRef( static_cast<document::XFilter *>(pImport), UNO_QUERY );
+    rtl::Reference<ConvDicXMLImport> pImport = new ConvDicXMLImport( nullptr );
 
     ReadThroughDic( rFileURL, *pImport );    // will implicitly add the entries
     bRes =  !LinguIsUnspecified( pImport->GetLanguage()) &&
@@ -220,9 +217,7 @@ void ConvDic::Load()
 
     //!! prevent function from being called recursively via HasEntry, AddEntry
     bNeedEntries = false;
-    ConvDicXMLImport *pImport = new ConvDicXMLImport( this );
-    //!! keep a first reference to ensure the lifetime of the object !!
-    uno::Reference< XInterface > xRef( static_cast<document::XFilter *>(pImport), UNO_QUERY );
+    rtl::Reference<ConvDicXMLImport> pImport = new ConvDicXMLImport( this );
     ReadThroughDic( aMainURL, *pImport );    // will implicitly add the entries
     bIsModified = false;
 }
@@ -263,10 +258,7 @@ void ConvDic::Save()
 
         // prepare arguments (prepend doc handler to given arguments)
         uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY );
-        ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler );
-        //!! keep a first(!) reference until everything is done to
-        //!! ensure the proper lifetime of the object
-        uno::Reference< document::XFilter > aRef( static_cast<document::XFilter *>(pExport) );
+        rtl::Reference<ConvDicXMLExport> pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler );
         bool bRet = pExport->Export();     // write entries to file
         DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" );
         if (bRet)
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 8401dd7ce59d..04e58ab6f0af 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -242,7 +242,6 @@ void XmlFilterBase::checkDocumentProperties(const Reference<XDocumentProperties>
 
 void XmlFilterBase::importDocumentProperties()
 {
-    Reference< XMultiServiceFactory > xFactory( getComponentContext()->getServiceManager(), UNO_QUERY );
     MediaDescriptor aMediaDesc( getMediaDescriptor() );
     Reference< XInputStream > xInputStream;
     Reference< XComponentContext > xContext = getComponentContext();
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index ebc2ed731d5b..847633537b86 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -236,7 +236,6 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
     applyTableCellProperties( rxCell, *this );
     TextCharacterProperties aTextStyleProps;
     xAt->gotoStart( true );
-    Reference< text::XTextRange > xStart( xAt, UNO_QUERY );
     xAt->gotoEnd( true );
 
     Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW );
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 9eb690191e28..d8071652da73 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -163,7 +163,6 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
 
 ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
     switch( aElementToken )
     {
         case A_TOKEN( lnSpc ):          // CT_TextSpacing
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 5d0ccdcca268..500a80143878 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2211,7 +2211,6 @@ void ChartExport::exportCandleStickSeries(
             Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(
                 xSource->getDataSequences());
 
-            Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
             const char* sSeries[] = {"values-first","values-max","values-min","values-last",nullptr};
 
             for( sal_Int32 idx = 0; sSeries[idx] != nullptr ; idx++ )
@@ -2260,7 +2259,6 @@ void ChartExport::exportCandleStickSeries(
 void ChartExport::exportSeriesText( const Reference< chart2::data::XDataSequence > & xValueSeq )
 {
     FSHelperPtr pFS = GetFS();
-    Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
     pFS->startElement( FSNS( XML_c, XML_tx ),
             FSEND );
 
@@ -2296,7 +2294,6 @@ void ChartExport::exportSeriesText( const Reference< chart2::data::XDataSequence
 void ChartExport::exportSeriesCategory( const Reference< chart2::data::XDataSequence > & xValueSeq )
 {
     FSHelperPtr pFS = GetFS();
-    Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
     pFS->startElement( FSNS( XML_c, XML_cat ),
             FSEND );
 
@@ -2339,7 +2336,6 @@ void ChartExport::exportSeriesCategory( const Reference< chart2::data::XDataSequ
 void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequence > & xValueSeq, sal_Int32 nValueType )
 {
     FSHelperPtr pFS = GetFS();
-    Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
     pFS->startElement( FSNS( XML_c, nValueType ),
             FSEND );
 
@@ -2449,7 +2445,6 @@ void ChartExport::InitPlotArea( )
 
     xDiagramProperties->getPropertyValue("Dim3D") >>=  mbIs3DChart;
 
-    Reference< chart2::XChartDocument > xNewDoc( getModel(), uno::UNO_QUERY );
     if( mbHasCategoryLabels && mxNewDiagram.is())
     {
         Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( mxNewDiagram ) );
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 2837d9d2c777..96a079e5ccd5 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -170,8 +170,6 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList
     OUString aNextName = *(aListPath.begin());
     aListPath.erase( aListPath.begin() );
 
-    uno::Reference< embed::XExtendedStorageStream > xResult;
-
     uno::Reference< embed::XStorage > xOwnStor;
 
     xOwnStor = m_xOwnStorage.is() ? m_xOwnStorage
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx
index 664f455e5cbb..017d3a4cb635 100644
--- a/package/source/xstor/switchpersistencestream.cxx
+++ b/package/source/xstor/switchpersistencestream.cxx
@@ -120,7 +120,6 @@ void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io:
 
 void SwitchablePersistenceStream::SwitchPersistenceTo( const uno::Reference< io::XInputStream >& xInputStream )
 {
-    uno::Reference< io::XStream > xNewStream;
     uno::Reference< io::XTruncate > xNewTruncate;
     uno::Reference< io::XSeekable > xNewSeekable( xInputStream, uno::UNO_QUERY_THROW );
     uno::Reference< io::XOutputStream > xNewOutStream;
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 1de098f426a0..db5ddcd8ba5a 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -1102,7 +1102,6 @@ void OStorage_Impl::Commit()
             {
                 // this is the case when xNewPackageFolder refers to m_xPackageFolder
                 // in case the name was changed and it is not a changed storage - rename the element
-                uno::Reference< container::XNamed > xNamed;
                 uno::Any aPackageElement = xNewPackageFolder->getByName( (*pElementIter)->m_aOriginalName );
                 xNewPackageFolder->removeByName( (*pElementIter)->m_aOriginalName );
                 xNewPackageFolder->insertByName( (*pElementIter)->m_aName, aPackageElement );
@@ -1130,7 +1129,6 @@ void OStorage_Impl::Commit()
         if ( (*pElementIter)->m_bIsInserted )
         {
             (*pElementIter)->m_aOriginalName = (*pElementIter)->m_aName;
-            uno::Reference< lang::XUnoTunnel > xNewElement;
 
             if ( (*pElementIter)->m_bIsStorage )
             {
@@ -2644,7 +2642,6 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo(
         if (!pElement->m_xStorage)
             m_pImpl->OpenSubStorage( pElement, nStorageMode );
 
-        uno::Reference< embed::XStorage > xResult;
         if (pElement->m_xStorage)
         {
             // the existence of m_pAntiImpl of the child is not interesting,
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 17d5adf52d81..90272bbee62b 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -550,7 +550,6 @@ void ZipPackage::getZipFileContents()
 
 void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
 {
-    uno::Reference< XProgressHandler > xProgressHandler;
     beans::NamedValue aNamedValue;
 
     if ( aArguments.getLength() )
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 7610ee6f7a70..1a47db8999bd 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -507,7 +507,6 @@ PyRef Runtime::any2PyObject (const Any &a ) const
         else
         {
             Reference< XTypeConverter > tc = getImpl()->cargo->xTypeConverter;
-            Reference< XSingleServiceFactory > ssf = getImpl()->cargo->xInvocation;
             tc->convertTo (a, cppu::UnoType<decltype(s)>::get()) >>= s;
             PyRef tuple( PyTuple_New (s.getLength()), SAL_NO_ACQUIRE, NOT_NULL);
             int i=0;
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index 34ed8c793740..37d20bd89c15 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -307,7 +307,6 @@ uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive
                 aArgs[nLen++].Value <<= true;
             }
 
-            uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY);
             xModel.set( xFrameLoad->loadComponentFromURL(
                 sOutputName,
                 OUString(), // empty frame name
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 3042c04c55a2..5f31cf8105ed 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -486,7 +486,6 @@ void OXUndoEnvironment::AddSection(const Reference< report::XSection > & _xSecti
     try
     {
         uno::Reference<container::XChild> xChild = _xSection.get();
-        uno::Reference<report::XGroup> xGroup(xChild->getParent(),uno::UNO_QUERY);
         m_pImpl->m_aSections.push_back(xChild);
         Reference< XInterface >  xInt(_xSection);
         AddElement(xInt);
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 08a80288d186..7aa1e7dc8974 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -849,7 +849,6 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection)
                         // start <text:p>
                         SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, true, false);
                         Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
-                        Reference<XReportComponent> xReportComponent = aColIter->xElement;
 
                         if ( !bShapeHandled )
                         {
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx
index 628e9a32f188..2adedeb10de6 100644
--- a/reportdesign/source/filter/xml/xmlFixedContent.cxx
+++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx
@@ -136,7 +136,6 @@ SvXMLImportContext* OXMLFixedContent::CreateChildContext_(
 
     static const char s_sStringConcat[] = " & ";
     const SvXMLTokenMap&    rTokenMap   = m_rImport.GetCellElemTokenMap();
-    Reference<XComponentContext> xContext = m_rImport.GetComponentContext();
 
     m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
     const sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index 09e3726eed90..1693963389b5 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -139,8 +139,7 @@ void OAddFieldWindowListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_r
         // no drag without a field
         return;
 
-    OMultiColumnTransferable* pDataContainer = new OMultiColumnTransferable(getSelectedFieldDescriptors());
-    Reference< XTransferable> xEnsureDelete = pDataContainer;
+    rtl::Reference<OMultiColumnTransferable> pDataContainer = new OMultiColumnTransferable(getSelectedFieldDescriptors());
 
     EndSelection();
     pDataContainer->StartDrag( this, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index ade452fefb21..d4e69f676686 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -267,8 +267,7 @@ void OFieldExpressionControl::StartDrag( sal_Int8 /*_nAction*/ , const Point& /*
 
         if( aClipboardList.getLength() )
         {
-            OGroupExchange* pData = new OGroupExchange(aClipboardList);
-            uno::Reference< css::datatransfer::XTransferable> xRef = pData;
+            rtl::Reference<OGroupExchange> pData = new OGroupExchange(aClipboardList);
             pData->StartDrag(this, DND_ACTION_MOVE );
         }
     }
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 0e2f21884dbd..a50e3e01a40b 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -2074,8 +2074,6 @@ void GeometryHandler::impl_initFieldList_nothrow( uno::Sequence< OUString >& _rF
         VclPtr<vcl::Window> pInspectorWindow = VCLUnoHelper::GetWindow( xInspectorWindow );
         WaitObject aWaitCursor( pInspectorWindow );
 
-        uno::Reference< sdbc::XPreparedStatement >  xStatement;
-
         // get the form of the control we're inspecting
         uno::Reference< beans::XPropertySet > xFormSet( m_xRowSet, uno::UNO_QUERY );
         if ( !xFormSet.is() )
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index fe7f59b7930f..502609531ec0 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -128,7 +128,6 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
     const uno::Reference< report::XSection > xSection(_rEvent.Source,uno::UNO_QUERY);
     if ( xSection.is() )
     {
-        const uno::Reference< report::XSection> xCurrentSection = m_aReportSection->getSection();
         if ( _rEvent.PropertyName == PROPERTY_HEIGHT )
         {
             m_pParent->getView()->SetUpdateMode(false);
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 1ea4502a5e44..67be39d52790 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -387,8 +387,7 @@ void OViewsWindow::Copy()
             sectionPtr->getReportSection().Copy(aAllreadyCopiedObjects);
         });
 
-    OReportExchange* pCopy = new OReportExchange(aAllreadyCopiedObjects);
-    uno::Reference< datatransfer::XTransferable> aEnsureDelete = pCopy;
+    rtl::Reference<OReportExchange> pCopy = new OReportExchange(aAllreadyCopiedObjects);
     pCopy->CopyToClipboard(this);
 }
 
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index 9a558ae458c0..5b60bf912094 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -86,9 +86,7 @@ void ScGlobal::InitAddIns()
 
             if ( xResultSet.is() )
             {
-                Reference< sdbc::XRow > xRow( xResultSet, UNO_QUERY );
-                Reference< XContentAccess >
-                    xContentAccess( xResultSet, UNO_QUERY );
+                Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
                 try
                 {
                     if ( xResultSet->first() )
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 92c83e06aaa3..72d2985e536f 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -310,8 +310,6 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
 {
     rWorkbookHandler.getDocImport().initForSheets();
 
-    Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
-
     // test sequential read in this mode
     comphelper::ThreadPool &rSharedPool = comphelper::ThreadPool::getSharedOptimalPool();
     std::shared_ptr<comphelper::ThreadTaskTag> pTag = comphelper::ThreadPool::createThreadTaskTag();
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index ed181469bd70..9fcbf4aaec8a 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -285,8 +285,7 @@ void ScSelectionTransferObj::CreateCellData()
                 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
                 // maSize is set in ScTransferObj ctor
 
-                ScTransferObj* pTransferObj = new ScTransferObj( pClipDoc, aObjDesc );
-                uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+                rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( pClipDoc, aObjDesc );
 
                 // SetDragHandlePos is not used - there is no mouse position
                 //? pTransferObj->SetVisibleTab( nTab );
@@ -338,8 +337,7 @@ void ScSelectionTransferObj::CreateDrawData()
             aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
             // maSize is set in ScDrawTransferObj ctor
 
-            ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc );
-            uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj );
+            rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( pModel, pDocSh, aObjDesc );
 
             SfxObjectShellRef aPersistRef( aDragShellRef.get() );
             pTransferObj->SetDrawPersist( aPersistRef );    // keep persist for ole objects alive
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 69ffd28bc62e..b261e56b60c1 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -73,7 +73,6 @@ void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFram
         return;
 
     uno::Reference<frame::XFrame> xFrame = pFrame->GetFrame().GetFrameInterface();
-    uno::Reference<frame::XDispatchProvider> xDP(xFrame, uno::UNO_QUERY);
 
     uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame(

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list