summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-30 12:42:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-30 15:09:21 +0200
commitbf59a45b043b4bcea276bd862f3c6e5c3175e1e9 (patch)
tree8759790d38958f7bdbf971b83fd0b46ceed914e1 /shell
parent631b3887ab417678cc993ef68c0fd7f86ac56c86 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/shlxthandler/classfactory.cxx2
-rw-r--r--shell/source/win32/shlxthandler/columninfo/columninfo.cxx2
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx16
-rw-r--r--shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx2
4 files changed, 11 insertions, 11 deletions
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<IQueryInfo*>(new CInfoTip());
else if (CLSID_COLUMN_HANDLER == m_Clsid)
- pUnk = static_cast<IColumnProvider*>(new CColumnInfo());
+ pUnk = new CColumnInfo();
else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid)
pUnk = static_cast<IExtractImage*>(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<IColumnProvider*>(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<IUnknown *>(static_cast<IFilter *>(this));
+ pUnkTemp = static_cast<IFilter *>(this);
else if ( IID_IPersistFile == riid )
- pUnkTemp = static_cast<IUnknown *>(static_cast<IPersistFile *>(this));
+ pUnkTemp = static_cast<IPersistFile *>(this);
else if ( IID_IPersist == riid )
- pUnkTemp = static_cast<IUnknown *>(static_cast<IPersist *>(static_cast<IPersistFile *>(this)));
+ pUnkTemp = static_cast<IPersistFile *>(this);
else if (IID_IPersistStream == riid)
- pUnkTemp = static_cast<IUnknown *>(static_cast<IPersistStream *>(this));
+ pUnkTemp = static_cast<IPersistStream *>(this);
else if ( IID_IUnknown == riid )
- pUnkTemp = static_cast<IUnknown *>(static_cast<IPersist *>(static_cast<IPersistFile *>(this)));
+ pUnkTemp = static_cast<IPersistFile *>(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<IUnknown *>(static_cast<IClassFactory *>(this));
+ pUnkTemp = this;
else if ( IID_IUnknown == riid )
- pUnkTemp = static_cast<IUnknown *>(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<IUnknown *>(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<IStream*>(this);
+ pUnk = this;
pUnk->AddRef();
*ppvObject = pUnk;
return S_OK;