Kaydet (Commit) 3b658759 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

clang-cl loplugin: embedserv

Change-Id: I9901dac882a74453015881ded2355ff0a51b50d5
Reviewed-on: https://gerrit.libreoffice.org/29868Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst d11ac604
...@@ -35,7 +35,7 @@ using namespace ::com::sun::star; ...@@ -35,7 +35,7 @@ using namespace ::com::sun::star;
// EmbedDocument_Impl // EmbedDocument_Impl
sal_uInt64 EmbedDocument_Impl::getMetaFileHandle_Impl( sal_Bool isEnhMeta ) sal_uInt64 EmbedDocument_Impl::getMetaFileHandle_Impl( bool isEnhMeta )
{ {
sal_uInt64 pResult = NULL; sal_uInt64 pResult = NULL;
...@@ -85,13 +85,13 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM ...@@ -85,13 +85,13 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM
if ( !( pFormatetc->tymed & TYMED_ENHMF ) ) if ( !( pFormatetc->tymed & TYMED_ENHMF ) )
return DV_E_TYMED; return DV_E_TYMED;
HENHMETAFILE hMeta = reinterpret_cast<HENHMETAFILE>( getMetaFileHandle_Impl( sal_True ) ); HENHMETAFILE hMeta = reinterpret_cast<HENHMETAFILE>( getMetaFileHandle_Impl( true ) );
if ( hMeta ) if ( hMeta )
{ {
pMedium->tymed = TYMED_ENHMF; pMedium->tymed = TYMED_ENHMF;
pMedium->hEnhMetaFile = hMeta; pMedium->hEnhMetaFile = hMeta;
pMedium->pUnkForRelease = NULL; pMedium->pUnkForRelease = nullptr;
return S_OK; return S_OK;
} }
...@@ -103,13 +103,13 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM ...@@ -103,13 +103,13 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM
if ( !( pFormatetc->tymed & TYMED_MFPICT ) ) if ( !( pFormatetc->tymed & TYMED_MFPICT ) )
return DV_E_TYMED; return DV_E_TYMED;
HGLOBAL hMeta = reinterpret_cast<HGLOBAL>( getMetaFileHandle_Impl( sal_False ) ); HGLOBAL hMeta = reinterpret_cast<HGLOBAL>( getMetaFileHandle_Impl( false ) );
if ( hMeta ) if ( hMeta )
{ {
pMedium->tymed = TYMED_MFPICT; pMedium->tymed = TYMED_MFPICT;
pMedium->hMetaFilePict = hMeta; pMedium->hMetaFilePict = hMeta;
pMedium->pUnkForRelease = NULL; pMedium->pUnkForRelease = nullptr;
return S_OK; return S_OK;
} }
...@@ -126,7 +126,7 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM ...@@ -126,7 +126,7 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM
return DV_E_TYMED; return DV_E_TYMED;
CComPtr< IStorage > pNewStg; CComPtr< IStorage > pNewStg;
HRESULT hr = StgCreateDocfile( NULL, STGM_CREATE | STGM_READWRITE | STGM_DELETEONRELEASE, 0, &pNewStg ); HRESULT hr = StgCreateDocfile( nullptr, STGM_CREATE | STGM_READWRITE | STGM_DELETEONRELEASE, 0, &pNewStg );
if ( FAILED( hr ) || !pNewStg ) return STG_E_MEDIUMFULL; if ( FAILED( hr ) || !pNewStg ) return STG_E_MEDIUMFULL;
hr = SaveTo_Impl( pNewStg ); hr = SaveTo_Impl( pNewStg );
...@@ -135,7 +135,7 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM ...@@ -135,7 +135,7 @@ STDMETHODIMP EmbedDocument_Impl::GetData( FORMATETC * pFormatetc, STGMEDIUM * pM
pMedium->tymed = TYMED_ISTORAGE; pMedium->tymed = TYMED_ISTORAGE;
pMedium->pstg = pNewStg; pMedium->pstg = pNewStg;
pMedium->pstg->AddRef(); pMedium->pstg->AddRef();
pMedium->pUnkForRelease = ( IUnknown* )pNewStg; pMedium->pUnkForRelease = static_cast<IUnknown*>(pNewStg);
return S_OK; return S_OK;
} }
...@@ -171,7 +171,7 @@ STDMETHODIMP EmbedDocument_Impl::GetDataHere( FORMATETC * pFormatetc, STGMEDIUM ...@@ -171,7 +171,7 @@ STDMETHODIMP EmbedDocument_Impl::GetDataHere( FORMATETC * pFormatetc, STGMEDIUM
if ( FAILED( hr ) ) return STG_E_MEDIUMFULL; if ( FAILED( hr ) ) return STG_E_MEDIUMFULL;
pMedium->tymed = TYMED_ISTORAGE; pMedium->tymed = TYMED_ISTORAGE;
pMedium->pUnkForRelease = NULL; pMedium->pUnkForRelease = nullptr;
return S_OK; return S_OK;
} }
...@@ -225,7 +225,7 @@ STDMETHODIMP EmbedDocument_Impl::GetCanonicalFormatEtc( FORMATETC * pFormatetcIn ...@@ -225,7 +225,7 @@ STDMETHODIMP EmbedDocument_Impl::GetCanonicalFormatEtc( FORMATETC * pFormatetcIn
if ( !pFormatetcIn || !pFormatetcOut ) if ( !pFormatetcIn || !pFormatetcOut )
return DV_E_FORMATETC; return DV_E_FORMATETC;
pFormatetcOut->ptd = NULL; pFormatetcOut->ptd = nullptr;
pFormatetcOut->cfFormat = pFormatetcIn->cfFormat; pFormatetcOut->cfFormat = pFormatetcIn->cfFormat;
pFormatetcOut->dwAspect = DVASPECT_CONTENT; pFormatetcOut->dwAspect = DVASPECT_CONTENT;
...@@ -272,7 +272,7 @@ STDMETHODIMP EmbedDocument_Impl::DAdvise( FORMATETC * pFormatetc, DWORD advf, IA ...@@ -272,7 +272,7 @@ STDMETHODIMP EmbedDocument_Impl::DAdvise( FORMATETC * pFormatetc, DWORD advf, IA
if ( !SUCCEEDED( CreateDataAdviseHolder( &m_pDAdviseHolder ) ) || !m_pDAdviseHolder ) if ( !SUCCEEDED( CreateDataAdviseHolder( &m_pDAdviseHolder ) ) || !m_pDAdviseHolder )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
return m_pDAdviseHolder->Advise( (IDataObject*)this, pFormatetc, advf, pAdvSink, pdwConnection ); return m_pDAdviseHolder->Advise( static_cast<IDataObject*>(this), pFormatetc, advf, pAdvSink, pdwConnection );
} }
STDMETHODIMP EmbedDocument_Impl::DUnadvise( DWORD dwConnection ) STDMETHODIMP EmbedDocument_Impl::DUnadvise( DWORD dwConnection )
......
...@@ -26,7 +26,7 @@ STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND *hWnd) ...@@ -26,7 +26,7 @@ STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND *hWnd)
OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
*hWnd = m_pDocHolder->GetTopMostWinHandle(); *hWnd = m_pDocHolder->GetTopMostWinHandle();
if(*hWnd != NULL) if(*hWnd != nullptr)
return NOERROR; return NOERROR;
else else
return ERROR; return ERROR;
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
using namespace ::com::sun::star; using namespace ::com::sun::star;
extern OUString getFilterNameFromGUID_Impl( GUID* );
// IOleObject // IOleObject
...@@ -51,10 +47,10 @@ STDMETHODIMP EmbedDocument_Impl::SetHostNames( LPCOLESTR szContainerApp, LPCOLES ...@@ -51,10 +47,10 @@ STDMETHODIMP EmbedDocument_Impl::SetHostNames( LPCOLESTR szContainerApp, LPCOLES
{ {
m_pDocHolder->setTitle( m_pDocHolder->setTitle(
OUString( OUString(
(sal_Unicode*)szContainerObj)); szContainerObj));
m_pDocHolder->setContainerName( m_pDocHolder->setContainerName(
OUString( OUString(
(sal_Unicode*)szContainerApp)); szContainerApp));
} }
return S_OK; return S_OK;
...@@ -149,7 +145,7 @@ STDMETHODIMP EmbedDocument_Impl::DoVerb( ...@@ -149,7 +145,7 @@ STDMETHODIMP EmbedDocument_Impl::DoVerb(
return OLEOBJ_S_CANNOT_DOVERB_NOW; return OLEOBJ_S_CANNOT_DOVERB_NOW;
// an object can not handle any Verbs in Hands off mode // an object can not handle any Verbs in Hands off mode
if ( m_pMasterStorage == NULL || m_pOwnStream == NULL ) if ( m_pMasterStorage == nullptr || m_pOwnStream == nullptr )
return OLE_E_CANT_BINDTOSOURCE; return OLE_E_CANT_BINDTOSOURCE;
...@@ -427,8 +423,8 @@ HRESULT EmbedDocument_Impl::SaveObject() ...@@ -427,8 +423,8 @@ HRESULT EmbedDocument_Impl::SaveObject()
OUString aPreservFileName = m_aFileName; OUString aPreservFileName = m_aFileName;
// in case of links the containers does not provide client site sometimes // in case of links the containers does not provide client site sometimes
hr = Save( (LPCOLESTR)NULL, FALSE ); // triggers saving to the link location hr = Save( static_cast<LPCOLESTR>(nullptr), FALSE ); // triggers saving to the link location
SaveCompleted( (LPCOLESTR)aPreservFileName.getStr() ); SaveCompleted( aPreservFileName.getStr() );
} }
notify( false ); notify( false );
...@@ -458,7 +454,7 @@ void EmbedDocument_Impl::notify( bool bDataChanged ) ...@@ -458,7 +454,7 @@ void EmbedDocument_Impl::notify( bool bDataChanged )
iAdvise->second->OnViewChange( DVASPECT_CONTENT, -1 ); iAdvise->second->OnViewChange( DVASPECT_CONTENT, -1 );
if ( m_pDAdviseHolder && bDataChanged ) if ( m_pDAdviseHolder && bDataChanged )
m_pDAdviseHolder->SendOnDataChange( (IDataObject*)this, 0, 0 ); m_pDAdviseHolder->SendOnDataChange( static_cast<IDataObject*>(this), 0, 0 );
} }
void EmbedDocument_Impl::Deactivate() void EmbedDocument_Impl::Deactivate()
......
...@@ -67,7 +67,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) ...@@ -67,7 +67,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
if (dwReason == DLL_PROCESS_ATTACH) if (dwReason == DLL_PROCESS_ATTACH)
{ {
_Module.Init(ObjectMap, hInstance, NULL); _Module.Init(ObjectMap, hInstance);
DisableThreadLibraryCalls(hInstance); DisableThreadLibraryCalls(hInstance);
} }
else if (dwReason == DLL_PROCESS_DETACH) else if (dwReason == DLL_PROCESS_DETACH)
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <guid.hxx>
OUString getStorageTypeFromGUID_Impl( GUID* guid ) OUString getStorageTypeFromGUID_Impl( GUID* guid )
{ {
if ( *guid == OID_WriterTextServer ) if ( *guid == OID_WriterTextServer )
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_EMBEDSERV_SOURCE_EMBED_GUID_HXX
#define INCLUDED_EMBEDSERV_SOURCE_EMBED_GUID_HXX
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include <common.h>
OUString getFilterNameFromGUID_Impl( GUID* );
OUString getServiceNameFromGUID_Impl( GUID* );
OUString getStorageTypeFromGUID_Impl( GUID* guid );
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -37,7 +37,7 @@ CIIAObj::~CIIAObj() ...@@ -37,7 +37,7 @@ CIIAObj::~CIIAObj()
STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID FAR *ppv) STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID FAR *ppv)
{ {
*ppv=NULL; *ppv=nullptr;
if(IID_IUnknown==riid || if(IID_IUnknown==riid ||
IID_IOleWindow==riid || IID_IOleWindow==riid ||
...@@ -45,9 +45,9 @@ STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID FAR *ppv) ...@@ -45,9 +45,9 @@ STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID FAR *ppv)
*ppv=this; *ppv=this;
//AddRef any interface we'll return. //AddRef any interface we'll return.
if (NULL!=*ppv) if (nullptr!=*ppv)
{ {
((LPUNKNOWN)*ppv)->AddRef(); static_cast<LPUNKNOWN>(*ppv)->AddRef();
return NOERROR; return NOERROR;
} }
......
...@@ -83,20 +83,20 @@ void SAL_CALL Interceptor::dispose() ...@@ -83,20 +83,20 @@ void SAL_CALL Interceptor::dispose()
if(m_pStatCL) if(m_pStatCL)
m_pStatCL->disposeAndClear( aEvt ); m_pStatCL->disposeAndClear( aEvt );
m_xSlaveDispatchProvider = 0; m_xSlaveDispatchProvider = nullptr;
m_xMasterDispatchProvider = 0; m_xMasterDispatchProvider = nullptr;
} }
Interceptor::Interceptor( Interceptor::Interceptor(
const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess, const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess,
DocumentHolder* pDocH, DocumentHolder* pDocH,
sal_Bool bLink ) bool bLink )
: m_xOleAccess( xOleAccess ), : m_xOleAccess( xOleAccess ),
m_xDocHLocker( static_cast< ::cppu::OWeakObject* >( pDocH ) ), m_xDocHLocker( static_cast< ::cppu::OWeakObject* >( pDocH ) ),
m_pDocH(pDocH), m_pDocH(pDocH),
m_pDisposeEventListeners(0), m_pDisposeEventListeners(nullptr),
m_pStatCL(0), m_pStatCL(nullptr),
m_bLink( bLink ) m_bLink( bLink )
{ {
m_aInterceptedURL[0] = ".uno:Save"; m_aInterceptedURL[0] = ".uno:Save";
...@@ -113,7 +113,7 @@ Interceptor::~Interceptor() ...@@ -113,7 +113,7 @@ Interceptor::~Interceptor()
delete m_pDisposeEventListeners; delete m_pDisposeEventListeners;
delete m_pStatCL; delete m_pStatCL;
DocumentHolder* pTmpDocH = NULL; DocumentHolder* pTmpDocH = nullptr;
uno::Reference< uno::XInterface > xLock; uno::Reference< uno::XInterface > xLock;
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
...@@ -130,8 +130,8 @@ void Interceptor::DisconnectDocHolder() ...@@ -130,8 +130,8 @@ void Interceptor::DisconnectDocHolder()
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
m_xDocHLocker.clear(); m_xDocHLocker.clear();
m_pDocH = NULL; m_pDocH = nullptr;
m_xOleAccess = NULL; m_xOleAccess = nullptr;
} }
//XDispatch //XDispatch
...@@ -169,7 +169,7 @@ Interceptor::dispatch( ...@@ -169,7 +169,7 @@ Interceptor::dispatch(
{ {
if ( aNewArgs[nInd].Name == "SaveTo" ) if ( aNewArgs[nInd].Name == "SaveTo" )
{ {
aNewArgs[nInd].Value <<= sal_True; aNewArgs[nInd].Value <<= true;
break; break;
} }
nInd++; nInd++;
...@@ -179,11 +179,11 @@ Interceptor::dispatch( ...@@ -179,11 +179,11 @@ Interceptor::dispatch(
{ {
aNewArgs.realloc( nInd + 1 ); aNewArgs.realloc( nInd + 1 );
aNewArgs[nInd].Name = "SaveTo"; aNewArgs[nInd].Name = "SaveTo";
aNewArgs[nInd].Value <<= sal_True; aNewArgs[nInd].Value <<= true;
} }
uno::Reference< frame::XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch( uno::Reference< frame::XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch(
URL, OUString( "_self" ), 0 ); URL, "_self", 0 );
if ( xDispatch.is() ) if ( xDispatch.is() )
xDispatch->dispatch( URL, aNewArgs ); xDispatch->dispatch( URL, aNewArgs );
} }
...@@ -196,7 +196,7 @@ void Interceptor::generateFeatureStateEvent() ...@@ -196,7 +196,7 @@ void Interceptor::generateFeatureStateEvent()
{ {
if( m_pStatCL ) if( m_pStatCL )
{ {
DocumentHolder* pTmpDocH = NULL; DocumentHolder* pTmpDocH = nullptr;
uno::Reference< uno::XInterface > xLock; uno::Reference< uno::XInterface > xLock;
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
...@@ -223,14 +223,14 @@ void Interceptor::generateFeatureStateEvent() ...@@ -223,14 +223,14 @@ void Interceptor::generateFeatureStateEvent()
continue; continue;
frame::FeatureStateEvent aStateEvent; frame::FeatureStateEvent aStateEvent;
aStateEvent.IsEnabled = sal_True; aStateEvent.IsEnabled = true;
aStateEvent.Requery = sal_False; aStateEvent.Requery = false;
if(i == 0) if(i == 0)
{ {
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0]; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0];
aStateEvent.FeatureDescriptor = "Update"; aStateEvent.FeatureDescriptor = "Update";
aStateEvent.State <<= (OUString("($1) ") + aTitle); aStateEvent.State <<= ("($1) " + aTitle);
} }
else if ( i == 5 ) else if ( i == 5 )
...@@ -243,7 +243,7 @@ void Interceptor::generateFeatureStateEvent() ...@@ -243,7 +243,7 @@ void Interceptor::generateFeatureStateEvent()
{ {
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[i]; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[i];
aStateEvent.FeatureDescriptor = "Close and Return"; aStateEvent.FeatureDescriptor = "Close and Return";
aStateEvent.State <<= (OUString("($2) ") + aTitle); aStateEvent.State <<= ("($2) " + aTitle);
} }
...@@ -274,7 +274,7 @@ Interceptor::addStatusListener( ...@@ -274,7 +274,7 @@ Interceptor::addStatusListener(
if( !m_bLink && URL.Complete == m_aInterceptedURL[0] ) if( !m_bLink && URL.Complete == m_aInterceptedURL[0] )
{ // Save { // Save
DocumentHolder* pTmpDocH = NULL; DocumentHolder* pTmpDocH = nullptr;
uno::Reference< uno::XInterface > xLock; uno::Reference< uno::XInterface > xLock;
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
...@@ -290,9 +290,9 @@ Interceptor::addStatusListener( ...@@ -290,9 +290,9 @@ Interceptor::addStatusListener(
frame::FeatureStateEvent aStateEvent; frame::FeatureStateEvent aStateEvent;
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0]; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[0];
aStateEvent.FeatureDescriptor = "Update"; aStateEvent.FeatureDescriptor = "Update";
aStateEvent.IsEnabled = sal_True; aStateEvent.IsEnabled = true;
aStateEvent.Requery = sal_False; aStateEvent.Requery = false;
aStateEvent.State <<= (OUString("($1) ") + aTitle ); aStateEvent.State <<= ("($1) " + aTitle );
Control->statusChanged(aStateEvent); Control->statusChanged(aStateEvent);
{ {
...@@ -312,7 +312,7 @@ Interceptor::addStatusListener( ...@@ -312,7 +312,7 @@ Interceptor::addStatusListener(
URL.Complete == m_aInterceptedURL[++i] || URL.Complete == m_aInterceptedURL[++i] ||
URL.Complete == m_aInterceptedURL[++i] ) ) URL.Complete == m_aInterceptedURL[++i] ) )
{ // Close and return { // Close and return
DocumentHolder* pTmpDocH = NULL; DocumentHolder* pTmpDocH = nullptr;
uno::Reference< uno::XInterface > xLock; uno::Reference< uno::XInterface > xLock;
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
...@@ -328,9 +328,9 @@ Interceptor::addStatusListener( ...@@ -328,9 +328,9 @@ Interceptor::addStatusListener(
frame::FeatureStateEvent aStateEvent; frame::FeatureStateEvent aStateEvent;
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[i]; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[i];
aStateEvent.FeatureDescriptor = "Close and Return"; aStateEvent.FeatureDescriptor = "Close and Return";
aStateEvent.IsEnabled = sal_True; aStateEvent.IsEnabled = true;
aStateEvent.Requery = sal_False; aStateEvent.Requery = false;
aStateEvent.State <<= (OUString("($2) ") + aTitle ); aStateEvent.State <<= ("($2) " + aTitle );
Control->statusChanged(aStateEvent); Control->statusChanged(aStateEvent);
...@@ -350,8 +350,8 @@ Interceptor::addStatusListener( ...@@ -350,8 +350,8 @@ Interceptor::addStatusListener(
frame::FeatureStateEvent aStateEvent; frame::FeatureStateEvent aStateEvent;
aStateEvent.FeatureURL.Complete = m_aInterceptedURL[5]; aStateEvent.FeatureURL.Complete = m_aInterceptedURL[5];
aStateEvent.FeatureDescriptor = "SaveCopyTo"; aStateEvent.FeatureDescriptor = "SaveCopyTo";
aStateEvent.IsEnabled = sal_True; aStateEvent.IsEnabled = true;
aStateEvent.Requery = sal_False; aStateEvent.Requery = false;
aStateEvent.State <<= (OUString("($3)")); aStateEvent.State <<= (OUString("($3)"));
Control->statusChanged(aStateEvent); Control->statusChanged(aStateEvent);
...@@ -422,23 +422,23 @@ Interceptor::queryDispatch( ...@@ -422,23 +422,23 @@ Interceptor::queryDispatch(
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
if( !m_bLink && URL.Complete == m_aInterceptedURL[0] ) if( !m_bLink && URL.Complete == m_aInterceptedURL[0] )
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[1]) else if(URL.Complete == m_aInterceptedURL[1])
return (frame::XDispatch*)0 ; return nullptr;
else if( !m_bLink && URL.Complete == m_aInterceptedURL[2] ) else if( !m_bLink && URL.Complete == m_aInterceptedURL[2] )
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if( !m_bLink && URL.Complete == m_aInterceptedURL[3] ) else if( !m_bLink && URL.Complete == m_aInterceptedURL[3] )
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if( !m_bLink && URL.Complete == m_aInterceptedURL[4] ) else if( !m_bLink && URL.Complete == m_aInterceptedURL[4] )
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[5]) else if(URL.Complete == m_aInterceptedURL[5])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else { else {
if(m_xSlaveDispatchProvider.is()) if(m_xSlaveDispatchProvider.is())
return m_xSlaveDispatchProvider->queryDispatch( return m_xSlaveDispatchProvider->queryDispatch(
URL,TargetFrameName,SearchFlags); URL,TargetFrameName,SearchFlags);
else else
return uno::Reference<frame::XDispatch>(0); return uno::Reference<frame::XDispatch>(nullptr);
} }
} }
...@@ -458,17 +458,17 @@ Interceptor::queryDispatches( ...@@ -458,17 +458,17 @@ Interceptor::queryDispatches(
for(sal_Int32 i = 0; i < Requests.getLength(); ++i) for(sal_Int32 i = 0; i < Requests.getLength(); ++i)
if ( !m_bLink && m_aInterceptedURL[0] == Requests[i].FeatureURL.Complete ) if ( !m_bLink && m_aInterceptedURL[0] == Requests[i].FeatureURL.Complete )
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[1] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[1] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) 0; aRet[i] = nullptr;
else if( !m_bLink && m_aInterceptedURL[2] == Requests[i].FeatureURL.Complete ) else if( !m_bLink && m_aInterceptedURL[2] == Requests[i].FeatureURL.Complete )
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if( !m_bLink && m_aInterceptedURL[3] == Requests[i].FeatureURL.Complete ) else if( !m_bLink && m_aInterceptedURL[3] == Requests[i].FeatureURL.Complete )
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if( !m_bLink && m_aInterceptedURL[4] == Requests[i].FeatureURL.Complete ) else if( !m_bLink && m_aInterceptedURL[4] == Requests[i].FeatureURL.Complete )
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[5] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[5] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
return aRet; return aRet;
} }
......
...@@ -59,14 +59,14 @@ extern "C" { ...@@ -59,14 +59,14 @@ extern "C" {
SAL_DLLPUBLIC_EXPORT void * SAL_CALL emser_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) SAL_DLLPUBLIC_EXPORT void * SAL_CALL emser_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{ {
void * pRet = 0; void * pRet = nullptr;
OUString aImplName( OUString::createFromAscii( pImplName ) ); OUString aImplName( OUString::createFromAscii( pImplName ) );
uno::Reference< lang::XSingleServiceFactory > xFactory; uno::Reference< lang::XSingleServiceFactory > xFactory;
if(pServiceManager && aImplName.equals( EmbedServer_getImplementationName() ) ) if(pServiceManager && aImplName.equals( EmbedServer_getImplementationName() ) )
{ {
xFactory= ::cppu::createOneInstanceFactory( reinterpret_cast< lang::XMultiServiceFactory*>(pServiceManager), xFactory= ::cppu::createOneInstanceFactory( static_cast< lang::XMultiServiceFactory*>(pServiceManager),
EmbedServer_getImplementationName(), EmbedServer_getImplementationName(),
EmbedServer_createInstance, EmbedServer_createInstance,
EmbedServer_getSupportedServiceNames() ); EmbedServer_getSupportedServiceNames() );
......
...@@ -50,7 +50,7 @@ class CurThreadData ...@@ -50,7 +50,7 @@ class CurThreadData
CurThreadData(); CurThreadData();
virtual ~CurThreadData(); virtual ~CurThreadData();
sal_Bool SAL_CALL setData(void *pData); bool SAL_CALL setData(void *pData);
void* SAL_CALL getData(); void* SAL_CALL getData();
...@@ -60,7 +60,7 @@ class CurThreadData ...@@ -60,7 +60,7 @@ class CurThreadData
CurThreadData::CurThreadData() CurThreadData::CurThreadData()
{ {
m_hKey = osl_createThreadKey( (oslThreadKeyCallbackFunction)NULL ); m_hKey = osl_createThreadKey( nullptr );
} }
CurThreadData::~CurThreadData() CurThreadData::~CurThreadData()
...@@ -68,7 +68,7 @@ CurThreadData::~CurThreadData() ...@@ -68,7 +68,7 @@ CurThreadData::~CurThreadData()
osl_destroyThreadKey(m_hKey); osl_destroyThreadKey(m_hKey);
} }
sal_Bool CurThreadData::setData(void *pData) bool CurThreadData::setData(void *pData)
{ {
OSL_ENSURE( m_hKey, "No thread key!\n" ); OSL_ENSURE( m_hKey, "No thread key!\n" );
return (osl_setThreadKeyData(m_hKey, pData)); return (osl_setThreadKeyData(m_hKey, pData));
...@@ -84,16 +84,16 @@ void o2u_attachCurrentThread() ...@@ -84,16 +84,16 @@ void o2u_attachCurrentThread()
{ {
static CurThreadData oleThreadData; static CurThreadData oleThreadData;
if ( oleThreadData.getData() != 0 ) if ( oleThreadData.getData() != nullptr )
{ {
HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED); HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (!SUCCEEDED(hr)) if (!SUCCEEDED(hr))
{ // FIXME: is it a problem that this ends up in STA currently? { // FIXME: is it a problem that this ends up in STA currently?
assert(RPC_E_CHANGED_MODE == hr); assert(RPC_E_CHANGED_MODE == hr);
SAL_INFO("embedserv.ole", SAL_INFO("embedserv.ole",
"CoInitializeEx fail: probably thread is in STA already?"); "CoInitializeEx fail: probably thread is in STA already?");
} }
oleThreadData.setData((void*)sal_True); oleThreadData.setData(reinterpret_cast<void*>(true));
} }
} }
...@@ -151,7 +151,7 @@ EmbedProviderFactory_Impl::~EmbedProviderFactory_Impl() ...@@ -151,7 +151,7 @@ EmbedProviderFactory_Impl::~EmbedProviderFactory_Impl()
{ {
} }
sal_Bool EmbedProviderFactory_Impl::registerClass() bool EmbedProviderFactory_Impl::registerClass()
{ {
HRESULT hresult; HRESULT hresult;
...@@ -167,7 +167,7 @@ sal_Bool EmbedProviderFactory_Impl::registerClass() ...@@ -167,7 +167,7 @@ sal_Bool EmbedProviderFactory_Impl::registerClass()
return (hresult == NOERROR); return (hresult == NOERROR);
} }
sal_Bool EmbedProviderFactory_Impl::deregisterClass() bool EmbedProviderFactory_Impl::deregisterClass()
{ {
HRESULT hresult = CoRevokeClassObject( m_factoryHandle ); HRESULT hresult = CoRevokeClassObject( m_factoryHandle );
...@@ -179,17 +179,17 @@ STDMETHODIMP EmbedProviderFactory_Impl::QueryInterface(REFIID riid, void FAR* FA ...@@ -179,17 +179,17 @@ STDMETHODIMP EmbedProviderFactory_Impl::QueryInterface(REFIID riid, void FAR* FA
if(IsEqualIID(riid, IID_IUnknown)) if(IsEqualIID(riid, IID_IUnknown))
{ {
AddRef(); AddRef();
*ppv = (IUnknown*) (IClassFactory*) this; *ppv = static_cast<IUnknown*>(static_cast<IClassFactory*>(this));
return NOERROR; return NOERROR;
} }
else if (IsEqualIID(riid, IID_IClassFactory)) else if (IsEqualIID(riid, IID_IClassFactory))
{ {
AddRef(); AddRef();
*ppv = (IClassFactory*) this; *ppv = static_cast<IClassFactory*>(this);
return NOERROR; return NOERROR;
} }
*ppv = NULL; *ppv = nullptr;
return ResultFromScode(E_NOINTERFACE); return ResultFromScode(E_NOINTERFACE);
} }
...@@ -214,9 +214,9 @@ STDMETHODIMP EmbedProviderFactory_Impl::CreateInstance(IUnknown FAR* punkOuter, ...@@ -214,9 +214,9 @@ STDMETHODIMP EmbedProviderFactory_Impl::CreateInstance(IUnknown FAR* punkOuter,
REFIID riid, REFIID riid,
void FAR* FAR* ppv) void FAR* FAR* ppv)
{ {
punkOuter = NULL; punkOuter = nullptr;
IUnknown* pEmbedDocument = (IUnknown*)(IPersistStorage*)( new EmbedDocument_Impl( m_xFactory, &m_guid ) ); IUnknown* pEmbedDocument = static_cast<IUnknown*>(static_cast<IPersistStorage*>( new EmbedDocument_Impl( m_xFactory, &m_guid ) ));
return pEmbedDocument->QueryInterface( riid, ppv ); return pEmbedDocument->QueryInterface( riid, ppv );
} }
......
...@@ -44,14 +44,10 @@ using namespace winwrap; ...@@ -44,14 +44,10 @@ using namespace winwrap;
typedef CHatchWin *PCHatchWin; typedef CHatchWin *PCHatchWin;
void DrawShading(LPRECT prc, HDC hDC, UINT cWidth);
winwrap::CWindow::CWindow(HINSTANCE hInst) winwrap::CWindow::CWindow(HINSTANCE hInst)
{ {
m_hInst=hInst; m_hInst=hInst;
m_hWnd=NULL; m_hWnd=nullptr;
return; return;
} }
...@@ -118,10 +114,10 @@ BOOL winwrap::HatchWindowRegister(HINSTANCE hInst) ...@@ -118,10 +114,10 @@ BOOL winwrap::HatchWindowRegister(HINSTANCE hInst)
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.lpfnWndProc = HatchWndProc; wc.lpfnWndProc = HatchWndProc;
wc.cbWndExtra = CBHATCHWNDEXTRA; wc.cbWndExtra = CBHATCHWNDEXTRA;
wc.hIcon = NULL; wc.hIcon = nullptr;
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1);
wc.lpszMenuName = NULL; wc.lpszMenuName = nullptr;
wc.lpszClassName = SZCLASSHATCHWIN; wc.lpszClassName = SZCLASSHATCHWIN;
return RegisterClass(&wc); return RegisterClass(&wc);
...@@ -140,9 +136,9 @@ CHatchWin::CHatchWin(HINSTANCE hInst,const DocumentHolder* pDocHolder) ...@@ -140,9 +136,9 @@ CHatchWin::CHatchWin(HINSTANCE hInst,const DocumentHolder* pDocHolder)
: CWindow(hInst), : CWindow(hInst),
m_aTracker() m_aTracker()
{ {
m_hWnd=NULL; m_hWnd=nullptr;
m_hWndKid=NULL; m_hWndKid=nullptr;
m_hWndAssociate=NULL; m_hWndAssociate=nullptr;
m_uID=0; m_uID=0;
m_dBorderOrg=GetProfileInt(TEXT("windows") m_dBorderOrg=GetProfileInt(TEXT("windows")
...@@ -164,7 +160,7 @@ CHatchWin::~CHatchWin() ...@@ -164,7 +160,7 @@ CHatchWin::~CHatchWin()
* Chances are this was already destroyed when a document * Chances are this was already destroyed when a document
* was destroyed. * was destroyed.
*/ */
if (NULL!=m_hWnd && IsWindow(m_hWnd)) if (nullptr!=m_hWnd && IsWindow(m_hWnd))
DestroyWindow(m_hWnd); DestroyWindow(m_hWnd);
return; return;
...@@ -200,7 +196,7 @@ BOOL CHatchWin::Init(HWND hWndParent, WORD uID, HWND hWndAssoc) ...@@ -200,7 +196,7 @@ BOOL CHatchWin::Init(HWND hWndParent, WORD uID, HWND hWndAssoc)
m_uID=uID; m_uID=uID;
m_hWndAssociate=hWndAssoc; m_hWndAssociate=hWndAssoc;
return (NULL!=m_hWnd); return (nullptr!=m_hWnd);
} }
...@@ -274,7 +270,7 @@ void CHatchWin::RectsSet(LPRECT prcPos, LPRECT prcClip) ...@@ -274,7 +270,7 @@ void CHatchWin::RectsSet(LPRECT prcPos, LPRECT prcClip)
InflateRect(&rcPos, m_dBorder, m_dBorder); InflateRect(&rcPos, m_dBorder, m_dBorder);
IntersectRect(&rc, &rcPos, prcClip); IntersectRect(&rc, &rcPos, prcClip);
SetWindowPos(m_hWnd, NULL, rc.left, rc.top, rc.right-rc.left SetWindowPos(m_hWnd, nullptr, rc.left, rc.top, rc.right-rc.left
, rc.bottom-rc.top, SWP_NOZORDER | SWP_NOACTIVATE); , rc.bottom-rc.top, SWP_NOZORDER | SWP_NOACTIVATE);
/* /*
...@@ -316,7 +312,7 @@ void CHatchWin::ChildSet(HWND hWndKid) ...@@ -316,7 +312,7 @@ void CHatchWin::ChildSet(HWND hWndKid)
{ {
m_hWndKid=hWndKid; m_hWndKid=hWndKid;
if (NULL!=hWndKid) if (nullptr!=hWndKid)
{ {
SetParent(hWndKid, m_hWnd); SetParent(hWndKid, m_hWnd);
...@@ -374,14 +370,14 @@ LRESULT APIENTRY winwrap::HatchWndProc( ...@@ -374,14 +370,14 @@ LRESULT APIENTRY winwrap::HatchWndProc(
HDC hDC; HDC hDC;
PAINTSTRUCT ps; PAINTSTRUCT ps;
phw=(PCHatchWin)GetWindowLongPtr(hWnd, HWWL_STRUCTURE); phw=reinterpret_cast<PCHatchWin>(GetWindowLongPtr(hWnd, HWWL_STRUCTURE));
POINT ptMouse; POINT ptMouse;
switch (iMsg) switch (iMsg)
{ {
case WM_CREATE: case WM_CREATE:
phw=(PCHatchWin)((LPCREATESTRUCT)lParam)->lpCreateParams; phw=static_cast<PCHatchWin>(reinterpret_cast<LPCREATESTRUCT>(lParam)->lpCreateParams);
SetWindowLongPtr(hWnd, HWWL_STRUCTURE, (LONG_PTR)phw); SetWindowLongPtr(hWnd, HWWL_STRUCTURE, reinterpret_cast<LONG_PTR>(phw));
break; break;
case WM_PAINT: case WM_PAINT:
hDC=BeginPaint(hWnd,&ps); hDC=BeginPaint(hWnd,&ps);
...@@ -409,7 +405,7 @@ LRESULT APIENTRY winwrap::HatchWndProc( ...@@ -409,7 +405,7 @@ LRESULT APIENTRY winwrap::HatchWndProc(
break; break;
case WM_SETFOCUS: case WM_SETFOCUS:
//We need this since the container will SetFocus to us. //We need this since the container will SetFocus to us.
if (NULL!=phw->m_hWndKid) if (nullptr!=phw->m_hWndKid)
SetFocus(phw->m_hWndKid); SetFocus(phw->m_hWndKid);
break; break;
...@@ -423,12 +419,12 @@ LRESULT APIENTRY winwrap::HatchWndProc( ...@@ -423,12 +419,12 @@ LRESULT APIENTRY winwrap::HatchWndProc(
* message when the mouse is on the border. So we can * message when the mouse is on the border. So we can
* just send the notification. * just send the notification.
*/ */
if (NULL!=phw->m_hWndAssociate) if (nullptr!=phw->m_hWndAssociate)
{ {
SendMessage( SendMessage(
phw->m_hWndAssociate, WM_COMMAND, phw->m_hWndAssociate, WM_COMMAND,
MAKEWPARAM(phw->m_uID, HWN_BORDERDOUBLECLICKED), MAKEWPARAM(phw->m_uID, HWN_BORDERDOUBLECLICKED),
(LPARAM) hWnd); reinterpret_cast<LPARAM>(hWnd));
} }
break; break;
......
...@@ -90,7 +90,7 @@ private: ...@@ -90,7 +90,7 @@ private:
CComPtr< IDispatch > m_pIDispatch; CComPtr< IDispatch > m_pIDispatch;
sal_Bool m_bLink; bool m_bLink;
css::uno::Reference< css::frame::XFrame2 > DocumentFrame(); css::uno::Reference< css::frame::XFrame2 > DocumentFrame();
...@@ -101,7 +101,7 @@ private: ...@@ -101,7 +101,7 @@ private:
void ClearInterceptorInternally(); void ClearInterceptorInternally();
void LoadDocInFrame( sal_Bool bPluginMode ); void LoadDocInFrame( bool bPluginMode );
public: public:
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory, const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory,
const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess ); const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess );
~DocumentHolder(); ~DocumentHolder() override;
// Methods for inplace activation // Methods for inplace activation
...@@ -136,19 +136,19 @@ public: ...@@ -136,19 +136,19 @@ public:
BOOL InPlaceMenuCreate(); BOOL InPlaceMenuCreate();
BOOL InPlaceMenuDestroy(); BOOL InPlaceMenuDestroy();
void OpenIntoWindow(); static void OpenIntoWindow();
BOOL Undo(); static BOOL Undo();
// further methods // further methods
void SetDocument( void SetDocument(
const css::uno::Reference< css::frame::XModel >& xDoc, const css::uno::Reference< css::frame::XModel >& xDoc,
sal_Bool bLink = sal_False bool bLink = false
); );
sal_Bool ExecuteSuspendCloseFrame(); bool ExecuteSuspendCloseFrame();
void DisconnectFrameDocument( sal_Bool bComplete = sal_False ); void DisconnectFrameDocument( bool bComplete = false );
void CloseDocument(); void CloseDocument();
void CloseFrame(); void CloseFrame();
void ClearInterceptor(); void ClearInterceptor();
...@@ -164,8 +164,8 @@ public: ...@@ -164,8 +164,8 @@ public:
void OnPosRectChanged(LPRECT lpRect) const; void OnPosRectChanged(LPRECT lpRect) const;
void show(); void show();
sal_Bool HasFrame() { return m_xFrame.is(); } bool HasFrame() { return m_xFrame.is(); }
sal_Bool IsLink() { return m_bLink; } bool IsLink() { return m_bLink; }
/** hides the document window, even in case of an external container /** hides the document window, even in case of an external container
* side managed window. * side managed window.
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
// XEventListener // XEventListener
virtual void SAL_CALL virtual void SAL_CALL
disposing( const css::lang::EventObject& aSource ) disposing( const css::lang::EventObject& aSource )
throw( css::uno::RuntimeException ); throw( css::uno::RuntimeException ) override;
// XCloseListener // XCloseListener
virtual void SAL_CALL virtual void SAL_CALL
...@@ -208,13 +208,13 @@ public: ...@@ -208,13 +208,13 @@ public:
) )
throw( throw(
css::util::CloseVetoException css::util::CloseVetoException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
notifyClosing( notifyClosing(
const css::lang::EventObject& aSource const css::lang::EventObject& aSource
) )
throw( css::uno::RuntimeException ); throw( css::uno::RuntimeException ) override;
// XTerminateListener // XTerminateListener
virtual void SAL_CALL virtual void SAL_CALL
...@@ -223,13 +223,13 @@ public: ...@@ -223,13 +223,13 @@ public:
) )
throw( throw(
css::frame::TerminationVetoException css::frame::TerminationVetoException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
notifyTermination( notifyTermination(
const css::lang::EventObject& aSource const css::lang::EventObject& aSource
) )
throw( css::uno::RuntimeException ); throw( css::uno::RuntimeException ) override;
// XModifyListener // XModifyListener
...@@ -239,7 +239,7 @@ public: ...@@ -239,7 +239,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
// XDockingAreaAcceptor // XDockingAreaAcceptor
...@@ -249,7 +249,7 @@ public: ...@@ -249,7 +249,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual sal_Bool SAL_CALL virtual sal_Bool SAL_CALL
requestDockingAreaSpace( requestDockingAreaSpace(
...@@ -257,7 +257,7 @@ public: ...@@ -257,7 +257,7 @@ public:
) )
throw( throw(
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setDockingAreaSpace( setDockingAreaSpace(
...@@ -265,7 +265,7 @@ public: ...@@ -265,7 +265,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
}; };
#endif #endif
......
...@@ -41,19 +41,19 @@ public: ...@@ -41,19 +41,19 @@ public:
virtual ~CIIAObj(); virtual ~CIIAObj();
/* IUnknown methods */ /* IUnknown methods */
STDMETHODIMP QueryInterface(REFIID, LPVOID FAR * ppvObj); STDMETHODIMP QueryInterface(REFIID, LPVOID FAR * ppvObj) override;
STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release(); STDMETHODIMP_(ULONG) Release() override;
/* IOleInPlaceActiveObject methods */ /* IOleInPlaceActiveObject methods */
STDMETHODIMP GetWindow(HWND *); STDMETHODIMP GetWindow(HWND *) override;
STDMETHODIMP ContextSensitiveHelp(BOOL); STDMETHODIMP ContextSensitiveHelp(BOOL) override;
STDMETHODIMP TranslateAccelerator(LPMSG); STDMETHODIMP TranslateAccelerator(LPMSG);
STDMETHODIMP OnFrameWindowActivate(BOOL); STDMETHODIMP OnFrameWindowActivate(BOOL) override;
STDMETHODIMP OnDocWindowActivate(BOOL); STDMETHODIMP OnDocWindowActivate(BOOL) override;
STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW
, BOOL); , BOOL) override;
STDMETHODIMP EnableModeless(BOOL); STDMETHODIMP EnableModeless(BOOL) override;
private: private:
......
...@@ -46,9 +46,9 @@ public: ...@@ -46,9 +46,9 @@ public:
Interceptor( Interceptor(
const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess, const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess,
DocumentHolder* pDocH, DocumentHolder* pDocH,
sal_Bool bLink ); bool bLink );
~Interceptor(); ~Interceptor() override;
void DisconnectDocHolder(); void DisconnectDocHolder();
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
dispatch( dispatch(
const css::util::URL& URL, const css::util::URL& URL,
const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) const css::uno::Sequence< css::beans::PropertyValue >& Arguments )
throw (css::uno::RuntimeException); throw (css::uno::RuntimeException) override;
virtual void SAL_CALL virtual void SAL_CALL
addStatusListener( addStatusListener(
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
const css::util::URL& URL ) const css::util::URL& URL )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeStatusListener( removeStatusListener(
...@@ -92,14 +92,14 @@ public: ...@@ -92,14 +92,14 @@ public:
const css::util::URL& URL ) const css::util::URL& URL )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
//XInterceptorInfo //XInterceptorInfo
virtual css::uno::Sequence< OUString > virtual css::uno::Sequence< OUString >
SAL_CALL getInterceptedURLs( ) SAL_CALL getInterceptedURLs( )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
//XDispatchProvider ( inherited by XDispatchProviderInterceptor ) //XDispatchProvider ( inherited by XDispatchProviderInterceptor )
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
sal_Int32 SearchFlags ) sal_Int32 SearchFlags )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL
queryDispatches( queryDispatches(
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
css::frame::DispatchDescriptor >& Requests ) css::frame::DispatchDescriptor >& Requests )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
//XDispatchProviderInterceptor //XDispatchProviderInterceptor
...@@ -127,27 +127,27 @@ public: ...@@ -127,27 +127,27 @@ public:
getSlaveDispatchProvider( ) getSlaveDispatchProvider( )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setSlaveDispatchProvider( setSlaveDispatchProvider(
const css::uno::Reference< css::frame::XDispatchProvider >& NewDispatchProvider ) const css::uno::Reference< css::frame::XDispatchProvider >& NewDispatchProvider )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL
getMasterDispatchProvider( ) getMasterDispatchProvider( )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setMasterDispatchProvider( setMasterDispatchProvider(
const css::uno::Reference< css::frame::XDispatchProvider >& NewSupplier ) const css::uno::Reference< css::frame::XDispatchProvider >& NewSupplier )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
private: private:
...@@ -168,7 +168,7 @@ private: ...@@ -168,7 +168,7 @@ private:
comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners; comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners;
StatusChangeListenerContainer* m_pStatCL; StatusChangeListenerContainer* m_pStatCL;
sal_Bool m_bLink; bool m_bLink;
}; };
#endif #endif
......
...@@ -35,7 +35,7 @@ class EmbedServer_Impl: public cppu::WeakImplHelper<css::lang::XServiceInfo> ...@@ -35,7 +35,7 @@ class EmbedServer_Impl: public cppu::WeakImplHelper<css::lang::XServiceInfo>
{ {
public: public:
EmbedServer_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory ); EmbedServer_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory );
virtual ~EmbedServer_Impl(); virtual ~EmbedServer_Impl() override;
OUString SAL_CALL getImplementationName() OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException, std::exception) override; throw (css::uno::RuntimeException, std::exception) override;
...@@ -59,17 +59,17 @@ public: ...@@ -59,17 +59,17 @@ public:
EmbedProviderFactory_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory, const GUID* pGuid); EmbedProviderFactory_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory, const GUID* pGuid);
virtual ~EmbedProviderFactory_Impl(); virtual ~EmbedProviderFactory_Impl();
sal_Bool registerClass(); bool registerClass();
sal_Bool deregisterClass(); bool deregisterClass();
/* IUnknown methods */ /* IUnknown methods */
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj); STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj) override;
STDMETHOD_(ULONG, AddRef)(); STDMETHOD_(ULONG, AddRef)() override;
STDMETHOD_(ULONG, Release)(); STDMETHOD_(ULONG, Release)() override;
/* IClassFactory methods */ /* IClassFactory methods */
STDMETHOD(CreateInstance)(IUnknown FAR* punkOuter, REFIID riid, void FAR* FAR* ppv); STDMETHOD(CreateInstance)(IUnknown FAR* punkOuter, REFIID riid, void FAR* FAR* ppv) override;
STDMETHOD(LockServer)(int fLock); STDMETHOD(LockServer)(int fLock) override;
protected: protected:
......
...@@ -94,7 +94,7 @@ namespace winwrap { ...@@ -94,7 +94,7 @@ namespace winwrap {
void GetTrueRect(LPRECT lpTrueRect) const; void GetTrueRect(LPRECT lpTrueRect) const;
BOOL SetCursor(HWND hWnd,UINT nHitTest) const; BOOL SetCursor(HWND hWnd,UINT nHitTest) const;
BOOL Track(HWND hWnd,POINT point,BOOL bAllowInvert = FALSE, BOOL Track(HWND hWnd,POINT point,BOOL bAllowInvert = FALSE,
HWND hWndClipTo = NULL); HWND hWndClipTo = nullptr);
// BOOL TrackRubberBand(HWND hWnd,POINT point,BOOL bAllowInvert = TRUE); // BOOL TrackRubberBand(HWND hWnd,POINT point,BOOL bAllowInvert = TRUE);
int HitTest(POINT point) const; int HitTest(POINT point) const;
int NormalizeHit(int nHandle) const; int NormalizeHit(int nHandle) const;
...@@ -123,7 +123,7 @@ protected: ...@@ -123,7 +123,7 @@ protected:
void GetHandleRect(int nHandle,RECT* pHandleRect) const; void GetHandleRect(int nHandle,RECT* pHandleRect) const;
void GetModifyPointers( void GetModifyPointers(
int nHandle,int**ppx, int**ppy, int* px, int*py); int nHandle,int**ppx, int**ppy, int* px, int*py);
virtual int GetHandleSize(LPRECT lpRect = NULL) const; virtual int GetHandleSize(LPRECT lpRect = nullptr) const;
BOOL TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo); BOOL TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo);
void Construct(); void Construct();
}; };
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
ContainerWindowWrapper(HWND aHwnd); ContainerWindowWrapper(HWND aHwnd);
~ ContainerWindowWrapper(); ~ ContainerWindowWrapper() override;
// XComponent // XComponent
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addEventListener( addEventListener(
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeEventListener( removeEventListener(
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
// XSystemDependentWindowPeer // XSystemDependentWindowPeer
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
// XWindow // XWindow
...@@ -89,14 +89,14 @@ public: ...@@ -89,14 +89,14 @@ public:
sal_Int16 Flags sal_Int16 Flags
) )
throw ( throw (
css::uno::RuntimeException); css::uno::RuntimeException) override;
virtual css::awt::Rectangle SAL_CALL virtual css::awt::Rectangle SAL_CALL
getPosSize( getPosSize(
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setVisible( setVisible(
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setEnable( setEnable(
...@@ -112,14 +112,14 @@ public: ...@@ -112,14 +112,14 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
setFocus( setFocus(
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addWindowListener( addWindowListener(
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeWindowListener( removeWindowListener(
...@@ -135,7 +135,7 @@ public: ...@@ -135,7 +135,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addFocusListener( addFocusListener(
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeFocusListener( removeFocusListener(
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addKeyListener( addKeyListener(
...@@ -160,7 +160,7 @@ public: ...@@ -160,7 +160,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeKeyListener( removeKeyListener(
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addMouseListener( addMouseListener(
...@@ -176,7 +176,7 @@ public: ...@@ -176,7 +176,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeMouseListener( removeMouseListener(
...@@ -185,7 +185,7 @@ public: ...@@ -185,7 +185,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addMouseMotionListener( addMouseMotionListener(
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removeMouseMotionListener( removeMouseMotionListener(
...@@ -202,7 +202,7 @@ public: ...@@ -202,7 +202,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
addPaintListener( addPaintListener(
...@@ -210,7 +210,7 @@ public: ...@@ -210,7 +210,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
virtual void SAL_CALL virtual void SAL_CALL
removePaintListener( removePaintListener(
...@@ -218,7 +218,7 @@ public: ...@@ -218,7 +218,7 @@ public:
) )
throw ( throw (
css::uno::RuntimeException css::uno::RuntimeException
); ) override;
private: private:
......
...@@ -28,7 +28,7 @@ namespace inprocserv ...@@ -28,7 +28,7 @@ namespace inprocserv
OleWrapperAdviseSink::OleWrapperAdviseSink() OleWrapperAdviseSink::OleWrapperAdviseSink()
: m_nRefCount( 0 ) : m_nRefCount( 0 )
, m_pFormatEtc( NULL ) , m_pFormatEtc( nullptr )
, m_nAspect( DVASPECT_CONTENT ) , m_nAspect( DVASPECT_CONTENT )
, m_nRegID( 0 ) , m_nRegID( 0 )
, m_bObjectAdvise( TRUE ) , m_bObjectAdvise( TRUE )
...@@ -42,7 +42,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink() ...@@ -42,7 +42,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink()
OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener ) OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener )
: m_nRefCount( 0 ) : m_nRefCount( 0 )
, m_pListener( pListener ) , m_pListener( pListener )
, m_pFormatEtc( NULL ) , m_pFormatEtc( nullptr )
, m_nAspect( DVASPECT_CONTENT ) , m_nAspect( DVASPECT_CONTENT )
, m_nRegID( 0 ) , m_nRegID( 0 )
, m_bObjectAdvise( TRUE ) , m_bObjectAdvise( TRUE )
...@@ -56,7 +56,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList ...@@ -56,7 +56,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList
OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, FORMATETC* pFormatEtc, DWORD nDataRegFlag ) OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, FORMATETC* pFormatEtc, DWORD nDataRegFlag )
: m_nRefCount( 0 ) : m_nRefCount( 0 )
, m_pListener( pListener ) , m_pListener( pListener )
, m_pFormatEtc( NULL ) , m_pFormatEtc( nullptr )
, m_nAspect( DVASPECT_CONTENT ) , m_nAspect( DVASPECT_CONTENT )
, m_nRegID( 0 ) , m_nRegID( 0 )
, m_bObjectAdvise( FALSE ) , m_bObjectAdvise( FALSE )
...@@ -69,7 +69,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList ...@@ -69,7 +69,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList
{ {
m_pFormatEtc = new FORMATETC; m_pFormatEtc = new FORMATETC;
m_pFormatEtc->cfFormat = pFormatEtc->cfFormat; m_pFormatEtc->cfFormat = pFormatEtc->cfFormat;
m_pFormatEtc->ptd = NULL; m_pFormatEtc->ptd = nullptr;
m_pFormatEtc->dwAspect = pFormatEtc->dwAspect; m_pFormatEtc->dwAspect = pFormatEtc->dwAspect;
m_pFormatEtc->lindex = pFormatEtc->lindex; m_pFormatEtc->lindex = pFormatEtc->lindex;
m_pFormatEtc->tymed = pFormatEtc->tymed; m_pFormatEtc->tymed = pFormatEtc->tymed;
...@@ -79,7 +79,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList ...@@ -79,7 +79,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList
OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, DWORD nAspect, DWORD nViewRegFlag ) OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, DWORD nAspect, DWORD nViewRegFlag )
: m_nRefCount( 0 ) : m_nRefCount( 0 )
, m_pListener( pListener ) , m_pListener( pListener )
, m_pFormatEtc( NULL ) , m_pFormatEtc( nullptr )
, m_nAspect( nAspect ) , m_nAspect( nAspect )
, m_nRegID( 0 ) , m_nRegID( 0 )
, m_bObjectAdvise( TRUE ) , m_bObjectAdvise( TRUE )
...@@ -97,17 +97,17 @@ OleWrapperAdviseSink::~OleWrapperAdviseSink() ...@@ -97,17 +97,17 @@ OleWrapperAdviseSink::~OleWrapperAdviseSink()
STDMETHODIMP OleWrapperAdviseSink::QueryInterface( REFIID riid , void** ppv ) STDMETHODIMP OleWrapperAdviseSink::QueryInterface( REFIID riid , void** ppv )
{ {
*ppv=NULL; *ppv=nullptr;
if ( riid == IID_IUnknown ) if ( riid == IID_IUnknown )
*ppv = (IUnknown*)this; *ppv = static_cast<IUnknown*>(this);
if ( riid == IID_IAdviseSink ) if ( riid == IID_IAdviseSink )
*ppv = (IAdviseSink*)this; *ppv = static_cast<IAdviseSink*>(this);
if ( *ppv != NULL ) if ( *ppv != nullptr )
{ {
((IUnknown*)*ppv)->AddRef(); static_cast<IUnknown*>(*ppv)->AddRef();
return S_OK; return S_OK;
} }
......
...@@ -69,21 +69,21 @@ public: ...@@ -69,21 +69,21 @@ public:
FORMATETC* GetFormatEtc() { return m_pFormatEtc; } FORMATETC* GetFormatEtc() { return m_pFormatEtc; }
DWORD GetAspect() { return m_nAspect; } DWORD GetAspect() { return m_nAspect; }
ComSmart< IAdviseSink >& GetOrigAdvise() { return m_pListener; } ComSmart< IAdviseSink >& GetOrigAdvise() { return m_pListener; }
void DisconnectOrigAdvise() { m_pListener = NULL; } void DisconnectOrigAdvise() { m_pListener = nullptr; }
void SetClosed() { m_bClosed = TRUE; } void SetClosed() { m_bClosed = TRUE; }
void UnsetClosed() { m_bClosed = FALSE; } void UnsetClosed() { m_bClosed = FALSE; }
BOOL IsClosed() { return m_bClosed; } BOOL IsClosed() { return m_bClosed; }
STDMETHODIMP QueryInterface(REFIID, void**); STDMETHODIMP QueryInterface(REFIID, void**) override;
STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release(); STDMETHODIMP_(ULONG) Release() override;
STDMETHODIMP_(void) OnDataChange(LPFORMATETC, LPSTGMEDIUM); STDMETHODIMP_(void) OnDataChange(LPFORMATETC, LPSTGMEDIUM) override;
STDMETHODIMP_(void) OnViewChange(DWORD, LONG); STDMETHODIMP_(void) OnViewChange(DWORD, LONG) override;
STDMETHODIMP_(void) OnRename(LPMONIKER); STDMETHODIMP_(void) OnRename(LPMONIKER) override;
STDMETHODIMP_(void) OnSave(); STDMETHODIMP_(void) OnSave() override;
STDMETHODIMP_(void) OnClose(); STDMETHODIMP_(void) OnClose() override;
}; };
}; // namespace advisesink }; // namespace advisesink
......
...@@ -42,7 +42,7 @@ static const GUID* guidList[ SUPPORTED_FACTORIES_NUM ] = { ...@@ -42,7 +42,7 @@ static const GUID* guidList[ SUPPORTED_FACTORIES_NUM ] = {
&OID_MathOASISServer &OID_MathOASISServer
}; };
static HINSTANCE g_hInstance = NULL; static HINSTANCE g_hInstance = nullptr;
static ULONG g_nObj = 0; static ULONG g_nObj = 0;
static ULONG g_nLock = 0; static ULONG g_nLock = 0;
...@@ -93,7 +93,7 @@ namespace { ...@@ -93,7 +93,7 @@ namespace {
HRESULT hRes = E_FAIL; HRESULT hRes = E_FAIL;
if ( pLibrary && nLen ) if ( pLibrary && nLen )
{ {
HKEY hKey = NULL; HKEY hKey = nullptr;
hRes = S_OK; hRes = S_OK;
for ( int nInd = 0; nInd < SUPPORTED_FACTORIES_NUM; nInd++ ) for ( int nInd = 0; nInd < SUPPORTED_FACTORIES_NUM; nInd++ )
...@@ -109,14 +109,14 @@ namespace { ...@@ -109,14 +109,14 @@ namespace {
{ {
if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, pSubKey, &hKey ) ) if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, pSubKey, &hKey ) )
{ {
if ( ERROR_SUCCESS == RegSetValueEx( hKey, "", 0, REG_SZ, (const BYTE*)pLibrary, nLen ) ) if ( ERROR_SUCCESS == RegSetValueEx( hKey, "", 0, REG_SZ, reinterpret_cast<const BYTE*>(pLibrary), nLen ) )
bLocalSuccess = TRUE; bLocalSuccess = TRUE;
} }
if ( hKey ) if ( hKey )
{ {
RegCloseKey( hKey ); RegCloseKey( hKey );
hKey = NULL; hKey = nullptr;
} }
} }
...@@ -144,13 +144,13 @@ public: ...@@ -144,13 +144,13 @@ public:
virtual ~InprocEmbedProvider_Impl(); virtual ~InprocEmbedProvider_Impl();
/* IUnknown methods */ /* IUnknown methods */
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj); STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * ppvObj) override;
STDMETHOD_(ULONG, AddRef)(); STDMETHOD_(ULONG, AddRef)() override;
STDMETHOD_(ULONG, Release)(); STDMETHOD_(ULONG, Release)() override;
/* IClassFactory methods */ /* IClassFactory methods */
STDMETHOD(CreateInstance)(IUnknown FAR* punkOuter, REFIID riid, void FAR* FAR* ppv); STDMETHOD(CreateInstance)(IUnknown FAR* punkOuter, REFIID riid, void FAR* FAR* ppv) override;
STDMETHOD(LockServer)(int fLock); STDMETHOD(LockServer)(int fLock) override;
protected: protected:
...@@ -186,7 +186,7 @@ STDAPI INPROC_DLLPUBLIC DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ...@@ -186,7 +186,7 @@ STDAPI INPROC_DLLPUBLIC DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID*
return E_NOINTERFACE; return E_NOINTERFACE;
*ppv = new inprocserv::InprocEmbedProvider_Impl( rclsid ); *ppv = new inprocserv::InprocEmbedProvider_Impl( rclsid );
((LPUNKNOWN)*ppv)->AddRef(); static_cast<LPUNKNOWN>(*ppv)->AddRef();
return S_OK; return S_OK;
} }
...@@ -270,17 +270,17 @@ STDMETHODIMP InprocEmbedProvider_Impl::QueryInterface( REFIID riid, void FAR* FA ...@@ -270,17 +270,17 @@ STDMETHODIMP InprocEmbedProvider_Impl::QueryInterface( REFIID riid, void FAR* FA
if(IsEqualIID(riid, IID_IUnknown)) if(IsEqualIID(riid, IID_IUnknown))
{ {
AddRef(); AddRef();
*ppv = (IUnknown*) this; *ppv = static_cast<IUnknown*>(this);
return S_OK; return S_OK;
} }
else if (IsEqualIID(riid, IID_IClassFactory)) else if (IsEqualIID(riid, IID_IClassFactory))
{ {
AddRef(); AddRef();
*ppv = (IClassFactory*) this; *ppv = static_cast<IClassFactory*>(this);
return S_OK; return S_OK;
} }
*ppv = NULL; *ppv = nullptr;
return E_NOINTERFACE; return E_NOINTERFACE;
} }
...@@ -307,18 +307,16 @@ STDMETHODIMP InprocEmbedProvider_Impl::CreateInstance(IUnknown FAR* punkOuter, ...@@ -307,18 +307,16 @@ STDMETHODIMP InprocEmbedProvider_Impl::CreateInstance(IUnknown FAR* punkOuter,
// TODO/LATER: should the aggregation be supported? // TODO/LATER: should the aggregation be supported?
// if ( punkOuter != NULL && riid != IID_IUnknown ) // if ( punkOuter != NULL && riid != IID_IUnknown )
// return E_NOINTERFACE; // return E_NOINTERFACE;
if ( punkOuter != NULL ) if ( punkOuter != nullptr )
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
InprocEmbedDocument_Impl* pEmbedDocument = new InprocEmbedDocument_Impl( m_guid ); InprocEmbedDocument_Impl* pEmbedDocument = new InprocEmbedDocument_Impl( m_guid );
pEmbedDocument->AddRef(); pEmbedDocument->AddRef();
HRESULT hr = pEmbedDocument->Init(); HRESULT hr = pEmbedDocument->QueryInterface( riid, ppv );
if ( SUCCEEDED( hr ) )
hr = pEmbedDocument->QueryInterface( riid, ppv );
pEmbedDocument->Release(); pEmbedDocument->Release();
if ( !SUCCEEDED( hr ) ) if ( !SUCCEEDED( hr ) )
*ppv = NULL; *ppv = nullptr;
return hr; return hr;
} }
......
...@@ -33,27 +33,27 @@ template< class T > class ComSmart ...@@ -33,27 +33,27 @@ template< class T > class ComSmart
if ( m_pInterface ) if ( m_pInterface )
{ {
T* pInterface = m_pInterface; T* pInterface = m_pInterface;
m_pInterface = NULL; m_pInterface = nullptr;
pInterface->Release(); pInterface->Release();
} }
} }
public: public:
ComSmart() ComSmart()
: m_pInterface( NULL ) : m_pInterface( nullptr )
{} {}
ComSmart( const ComSmart<T>& rObj ) ComSmart( const ComSmart<T>& rObj )
: m_pInterface( rObj.m_pInterface ) : m_pInterface( rObj.m_pInterface )
{ {
if ( m_pInterface != NULL ) if ( m_pInterface != nullptr )
m_pInterface->AddRef(); m_pInterface->AddRef();
} }
explicit ComSmart( T* pInterface ) explicit ComSmart( T* pInterface )
: m_pInterface( pInterface ) : m_pInterface( pInterface )
{ {
if ( m_pInterface != NULL ) if ( m_pInterface != nullptr )
m_pInterface->AddRef(); m_pInterface->AddRef();
} }
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
m_pInterface = rObj.m_pInterface; m_pInterface = rObj.m_pInterface;
if ( m_pInterface != NULL ) if ( m_pInterface != nullptr )
m_pInterface->AddRef(); m_pInterface->AddRef();
return *this; return *this;
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
m_pInterface = pInterface; m_pInterface = pInterface;
if ( m_pInterface != NULL ) if ( m_pInterface != nullptr )
m_pInterface->AddRef(); m_pInterface->AddRef();
return *this; return *this;
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
{ {
OwnRelease(); OwnRelease();
m_pInterface = NULL; m_pInterface = nullptr;
return &m_pInterface; return &m_pInterface;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment