From bf59a45b043b4bcea276bd862f3c6e5c3175e1e9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 30 Sep 2021 12:42:36 +0200 Subject: Extended loplugin:referencecasting/redundantcast (clang-cl): shell Change-Id: Iee72782ca3f9e536b391cc45d910792f66ce01a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122884 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- shell/source/win32/shlxthandler/classfactory.cxx | 2 +- .../source/win32/shlxthandler/columninfo/columninfo.cxx | 2 +- shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx | 16 ++++++++-------- .../win32/shlxthandler/thumbviewer/thumbviewer.cxx | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/classfactory.cxx b/shell/source/win32/shlxthandler/classfactory.cxx index e7384d36b577..95da69252089 100644 --- a/shell/source/win32/shlxthandler/classfactory.cxx +++ b/shell/source/win32/shlxthandler/classfactory.cxx @@ -99,7 +99,7 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( pUnk = static_cast(new CInfoTip()); else if (CLSID_COLUMN_HANDLER == m_Clsid) - pUnk = static_cast(new CColumnInfo()); + pUnk = new CColumnInfo(); else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid) pUnk = static_cast(new CThumbviewer()); diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx index c036a63f8f7d..81393140d51c 100644 --- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx +++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx @@ -77,7 +77,7 @@ COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE CColumnInfo::QueryInterface(REFII if (IID_IUnknown == riid || IID_IColumnProvider == riid) { - IUnknown* pUnk = static_cast(this); + IUnknown* pUnk = this; pUnk->AddRef(); *ppvObject = pUnk; return S_OK; diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index 7088dfbc027b..c45c69930cfb 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -127,15 +127,15 @@ HRESULT STDMETHODCALLTYPE COooFilter::QueryInterface( { IUnknown *pUnkTemp = nullptr; if ( IID_IFilter == riid ) - pUnkTemp = static_cast(static_cast(this)); + pUnkTemp = static_cast(this); else if ( IID_IPersistFile == riid ) - pUnkTemp = static_cast(static_cast(this)); + pUnkTemp = static_cast(this); else if ( IID_IPersist == riid ) - pUnkTemp = static_cast(static_cast(static_cast(this))); + pUnkTemp = static_cast(this); else if (IID_IPersistStream == riid) - pUnkTemp = static_cast(static_cast(this)); + pUnkTemp = static_cast(this); else if ( IID_IUnknown == riid ) - pUnkTemp = static_cast(static_cast(static_cast(this))); + pUnkTemp = static_cast(this); else { *ppvObject = nullptr; @@ -723,9 +723,9 @@ HRESULT STDMETHODCALLTYPE COooFilterCF::QueryInterface(REFIID riid, void ** ppv IUnknown *pUnkTemp; if ( IID_IClassFactory == riid ) - pUnkTemp = static_cast(static_cast(this)); + pUnkTemp = this; else if ( IID_IUnknown == riid ) - pUnkTemp = static_cast(this); + pUnkTemp = this; else { *ppvObject = nullptr; @@ -882,7 +882,7 @@ extern "C" HRESULT STDMETHODCALLTYPE DllGetClassObject( if ( CLSID_COooFilter == cid ) { pImpl = new COooFilterCF; - pResult = static_cast(pImpl); + pResult = pImpl; } else return CLASS_E_CLASSNOTAVAILABLE; diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx index ad5cbe03b0e1..657664ff5866 100644 --- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx +++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx @@ -157,7 +157,7 @@ HRESULT STDMETHODCALLTYPE StreamOnZipBuffer::QueryInterface(REFIID riid, void __ if ((IID_IUnknown == riid) || (IID_IStream == riid)) { - pUnk = static_cast(this); + pUnk = this; pUnk->AddRef(); *ppvObject = pUnk; return S_OK; -- cgit v1.2.3