diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-12-05 09:55:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-12-05 13:31:39 +0100 |
commit | 55e596956e56b175ab17b682e7c8ac7daeb9289a (patch) | |
tree | 3691e2f43d50019b5e0f0e0145714afb13bcc685 /extensions | |
parent | 6a10149c5fef13721e3f83727a828556f8e1ec9a (diff) |
loplugin:external (clang-cl)
...plus loplugin:consttobool and loplugin:fakebool fallout
Change-Id: Ie3d8121815c080b13bea6d9deca1eb138ca56138
Reviewed-on: https://gerrit.libreoffice.org/84515
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/activex/SOActiveX.cxx | 14 | ||||
-rw-r--r-- | extensions/source/activex/SOActiveX.h | 2 | ||||
-rw-r--r-- | extensions/source/ole/ole2uno.cxx | 3 | ||||
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 16 | ||||
-rw-r--r-- | extensions/source/update/check/download.cxx | 2 |
5 files changed, 31 insertions, 6 deletions
diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx index 2c6c4365a339..489fd6b363b1 100644 --- a/extensions/source/activex/SOActiveX.cxx +++ b/extensions/source/activex/SOActiveX.cxx @@ -151,7 +151,7 @@ CSOActiveX::CSOActiveX() , mpDispatchInterceptor( nullptr ) , mnVersion( SO_NOT_DETECTED ) , mbReadyForActivation( FALSE ) -, mbDrawLocked( FALSE ) +, mbDrawLocked( false ) { CLSID const clsFactory = {0x82154420,0x0FBF,0x11d4,{0x83, 0x13,0x00,0x50,0x04,0x52,0x6A,0xB4}}; HRESULT hr = CoCreateInstance( clsFactory, nullptr, CLSCTX_ALL, __uuidof(IDispatch), reinterpret_cast<void**>(&mpDispFactory)); @@ -948,22 +948,26 @@ SOVersion CSOActiveX::GetVersionConnected() return bResult; } +namespace { + class LockingGuard { - BOOL& mbLocked; + bool& mbLocked; public: - explicit LockingGuard( BOOL& bLocked ) + explicit LockingGuard( bool& bLocked ) : mbLocked( bLocked ) { - mbLocked = TRUE; + mbLocked = true; } ~LockingGuard() { - mbLocked = FALSE; + mbLocked = false; } }; +} + HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di ) { // This method is called only in main thread, no need to lock it diff --git a/extensions/source/activex/SOActiveX.h b/extensions/source/activex/SOActiveX.h index d55820be163b..719bce5d4271 100644 --- a/extensions/source/activex/SOActiveX.h +++ b/extensions/source/activex/SOActiveX.h @@ -95,7 +95,7 @@ protected: BOOL mbReadyForActivation; CComPtr<IDispatch> mpDispTempFile; - BOOL mbDrawLocked; + bool mbDrawLocked; public: CSOActiveX(); diff --git a/extensions/source/ole/ole2uno.cxx b/extensions/source/ole/ole2uno.cxx index 4899a2df11d4..f9eef5125e69 100644 --- a/extensions/source/ole/ole2uno.cxx +++ b/extensions/source/ole/ole2uno.cxx @@ -24,6 +24,8 @@ using namespace osl; +namespace { + struct MutexInit { Mutex * operator () () @@ -33,6 +35,7 @@ struct MutexInit } }; +} Mutex * getBridgeMutex() { diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 436feb3097e9..5a10e03dcbea 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -116,6 +116,8 @@ static bool writeBackOutParameter(VARIANTARG* pDest, VARIANT* pSource); static bool writeBackOutParameter2( VARIANTARG* pDest, VARIANT* pSource); static HRESULT mapCannotConvertException(const CannotConvertException &e, unsigned int * puArgErr); +namespace { + class TerminationVetoer : public WeakImplHelper<css::frame::XTerminateListener> { public: @@ -171,6 +173,8 @@ public: } }; +} + /* Does not throw any exceptions. Param pInfo can be NULL. */ @@ -316,6 +320,8 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::GetTypeInfoCount( UINT *p return S_OK; } +namespace { + class CXTypeInfo : public ITypeInfo, public CComObjectRoot { @@ -592,6 +598,8 @@ private: Reference<XMultiServiceFactory> mxMSF; }; +} + void CXTypeInfo::InitForCoclass(Reference<XInterface> xOrigin, const OUString& sImplementationName, const IID& rIID, @@ -2204,6 +2212,8 @@ HRESULT InterfaceOleWrapper::doSetProperty( DISPPARAMS * /*pdispparams*/, VARIAN return ret; } +namespace { + class CXEnumVariant : public IEnumVARIANT, public CComObjectRoot { @@ -2353,6 +2363,8 @@ private: InterfaceOleWrapper* mpInterfaceOleWrapper; }; +} + Sink::Sink(IUnknown* pUnkSink, Reference<XMultiServiceFactory> xMSF, ooo::vba::TypeAndIID aTypeAndIID, @@ -2535,6 +2547,8 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) SAL_WARN("extensions.olebridge", "Sink::Call: Unknown method '" << Method << "'"); } +namespace { + class CXEnumConnections : public IEnumConnections, public CComObjectRoot { @@ -2794,6 +2808,8 @@ public: ooo::vba::TypeAndIID maTypeAndIID; }; +} + HRESULT InterfaceOleWrapper::InvokeGeneral( DISPID dispidMember, unsigned short wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, unsigned int * /*puArgErr*/, bool& bHandled) diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index 73e79bcf851d..a40b7b1c5367 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -33,6 +33,7 @@ namespace container = com::sun::star::container ; namespace lang = com::sun::star::lang ; namespace uno = com::sun::star::uno ; +namespace { struct OutData { @@ -47,6 +48,7 @@ struct OutData explicit OutData(osl::Condition& rCondition) : FileHandle(nullptr), Offset(0), StopCondition(rCondition), curl(nullptr) {}; }; +} static void openFile( OutData& out ) { |