diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-23 21:06:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-25 08:37:17 +0100 |
commit | b7a1e92a27bc26f222526eb50ab80c0e6966be7a (patch) | |
tree | 4f3825cc2f483e4576d1e3849a759b73fdc969f9 /sc | |
parent | e6b9bc3f2ecf0fb7fde5b02f9d750ccbe022f4c1 (diff) |
loplugin:referencecasting
getting --enable-pch=normal working with clang
means that the plugins now have a better view on some
stuff, so trigger more warnings
Change-Id: I83ca010c0ef07c8106068362bb50a354e3cf7dae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/chartlock.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xeroot.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index e9deb74010bc..48a0dacbac4a 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/embed/XClassifiedObject.hpp> +#include <com/sun/star/embed/XEmbeddedObject.hpp> #include <scitems.hxx> #include <editeng/eeitem.hxx> @@ -1731,7 +1732,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const if ( pNewObject->GetObjIdentifier() == OBJ_OLE2 ) { uno::Reference< embed::XEmbeddedObject > xIPObj = static_cast<SdrOle2Obj*>(pNewObject)->GetObjRef(); - uno::Reference< embed::XClassifiedObject > xClassified( xIPObj, uno::UNO_QUERY ); + uno::Reference< embed::XClassifiedObject > xClassified = xIPObj; SvGlobalName aObjectClassName; if ( xClassified.is() ) { diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index 7496103e5117..f1ecef38df5e 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -26,6 +26,7 @@ #include <document.hxx> #include <drwlayer.hxx> +#include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/XComponentSupplier.hpp> #include <com/sun/star/frame/XModel.hpp> @@ -61,7 +62,7 @@ std::vector< WeakReference< frame::XModel > > lcl_getAllLivingCharts( ScDocument if( ScDocument::IsChart( pObject ) ) { uno::Reference< embed::XEmbeddedObject > xIPObj = static_cast<SdrOle2Obj*>(pObject)->GetObjRef(); - uno::Reference< embed::XComponentSupplier > xCompSupp( xIPObj, uno::UNO_QUERY ); + uno::Reference< embed::XComponentSupplier > xCompSupp = xIPObj; if( xCompSupp.is()) { Reference< frame::XModel > xModel( xCompSupp->getComponent(), uno::UNO_QUERY ); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 6032c72d1c11..e73ee878cd28 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -46,6 +46,7 @@ #include <formulabase.hxx> #include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> using namespace ::com::sun::star; @@ -233,7 +234,7 @@ void XclExpRoot::InitializeGlobals() SAL_WARN( "sc", "XclExpRoot::InitializeGlobals - no object shell"); break; } - uno::Reference< lang::XComponent > xComponent( pShell->GetModel(), uno::UNO_QUERY); + uno::Reference< lang::XComponent > xComponent = pShell->GetModel(); if (!xComponent.is()) { SAL_WARN( "sc", "XclExpRoot::InitializeGlobals - no component"); diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 700a21576d6c..032a4a5682e4 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/drawing/XControlShape.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/script/ScriptEventDescriptor.hpp> #include <com/sun/star/script/XEventAttacherManager.hpp> @@ -176,7 +177,7 @@ ContextHandlerRef GroupShapeContext::onCreateContext( DrawingFragment::DrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) : WorksheetFragmentBase( rHelper, rFragmentPath ), - mxDrawPage( rHelper.getDrawPage(), UNO_QUERY ) + mxDrawPage( rHelper.getDrawPage() ) { OSL_ENSURE( mxDrawPage.is(), "DrawingFragment::DrawingFragment - missing drawing page" ); } |