summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-10-14 16:59:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-16 14:19:34 +0000
commit6d4f7734ad63998b067f50b6564639a527bf34e3 (patch)
treef755ce2fb56f6adb5aa132e8d510c8cef5cfde42 /avmedia
parent233e5d5f85b1b0e3ad6f6c90b0348448b0d54bb1 (diff)
clang-cl loplugin: avmedia
Change-Id: Id9ccbeb100ca9770226d0c8c84dae0a02aa7d2d6 Reviewed-on: https://gerrit.libreoffice.org/29882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/win/framegrabber.cxx26
-rw-r--r--avmedia/source/win/framegrabber.hxx12
-rw-r--r--avmedia/source/win/manager.hxx10
-rw-r--r--avmedia/source/win/player.cxx68
-rw-r--r--avmedia/source/win/player.hxx40
-rw-r--r--avmedia/source/win/window.cxx36
-rw-r--r--avmedia/source/win/window.hxx56
-rw-r--r--avmedia/source/win/winuno.cxx6
8 files changed, 127 insertions, 127 deletions
diff --git a/avmedia/source/win/framegrabber.cxx b/avmedia/source/win/framegrabber.cxx
index 7c4cd56d6584..88408caa8a13 100644
--- a/avmedia/source/win/framegrabber.cxx
+++ b/avmedia/source/win/framegrabber.cxx
@@ -52,7 +52,7 @@ namespace avmedia { namespace win {
FrameGrabber::FrameGrabber( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mxMgr( rxMgr )
{
- ::CoInitialize( NULL );
+ ::CoInitialize( nullptr );
}
@@ -61,12 +61,13 @@ FrameGrabber::~FrameGrabber()
::CoUninitialize();
}
+namespace {
-IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
+IMediaDet* implCreateMediaDet( const OUString& rURL )
{
- IMediaDet* pDet = NULL;
+ IMediaDet* pDet = nullptr;
- if( SUCCEEDED( CoCreateInstance( CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER, IID_IMediaDet, (void**) &pDet ) ) )
+ if( SUCCEEDED( CoCreateInstance( CLSID_MediaDet, nullptr, CLSCTX_INPROC_SERVER, IID_IMediaDet, reinterpret_cast<void**>(&pDet) ) ) )
{
OUString aLocalStr;
@@ -76,7 +77,7 @@ IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
if( !SUCCEEDED( pDet->put_Filename( ::SysAllocString( reinterpret_cast<LPCOLESTR>(aLocalStr.getStr()) ) ) ) )
{
pDet->Release();
- pDet = NULL;
+ pDet = nullptr;
}
}
}
@@ -84,6 +85,7 @@ IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
return pDet;
}
+}
bool FrameGrabber::create( const OUString& rURL )
{
@@ -94,7 +96,7 @@ bool FrameGrabber::create( const OUString& rURL )
{
maURL = rURL;
pDet->Release();
- pDet = NULL;
+ pDet = nullptr;
}
else
maURL.clear();
@@ -153,27 +155,27 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe
if( aMediaType.cbFormat != 0 )
{
- ::CoTaskMemFree( (PVOID) aMediaType.pbFormat );
+ ::CoTaskMemFree( aMediaType.pbFormat );
aMediaType.cbFormat = 0;
- aMediaType.pbFormat = NULL;
+ aMediaType.pbFormat = nullptr;
}
- if( aMediaType.pUnk != NULL )
+ if( aMediaType.pUnk != nullptr )
{
aMediaType.pUnk->Release();
- aMediaType.pUnk = NULL;
+ aMediaType.pUnk = nullptr;
}
}
if( ( nWidth > 0 ) && ( nHeight > 0 ) &&
- SUCCEEDED( pDet->GetBitmapBits( 0, &nSize, NULL, nWidth, nHeight ) ) &&
+ SUCCEEDED( pDet->GetBitmapBits( 0, &nSize, nullptr, nWidth, nHeight ) ) &&
( nSize > 0 ) )
{
char* pBuffer = new char[ nSize ];
try
{
- if( SUCCEEDED( pDet->GetBitmapBits( fMediaTime, NULL, pBuffer, nWidth, nHeight ) ) )
+ if( SUCCEEDED( pDet->GetBitmapBits( fMediaTime, nullptr, pBuffer, nWidth, nHeight ) ) )
{
SvMemoryStream aMemStm( pBuffer, nSize, StreamMode::READ | StreamMode::WRITE );
Bitmap aBmp;
diff --git a/avmedia/source/win/framegrabber.hxx b/avmedia/source/win/framegrabber.hxx
index d9845c08cb18..8b3fd49f03b0 100644
--- a/avmedia/source/win/framegrabber.hxx
+++ b/avmedia/source/win/framegrabber.hxx
@@ -34,24 +34,22 @@ class FrameGrabber : public ::cppu::WeakImplHelper< css::media::XFrameGrabber,
public:
explicit FrameGrabber( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
- ~FrameGrabber();
+ ~FrameGrabber() override;
bool create( const OUString& rURL );
// XFrameGrabber
- virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (css::uno::RuntimeException) override;
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) override;
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
OUString maURL;
-
- IMediaDet* implCreateMediaDet( const OUString& rURL ) const;
};
} // namespace win
diff --git a/avmedia/source/win/manager.hxx b/avmedia/source/win/manager.hxx
index a70861ef22d8..fcd0c69a2c23 100644
--- a/avmedia/source/win/manager.hxx
+++ b/avmedia/source/win/manager.hxx
@@ -33,15 +33,15 @@ class Manager : public ::cppu::WeakImplHelper< css::media::XManager,
public:
explicit Manager( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
- ~Manager();
+ ~Manager() override;
// XManager
- virtual css::uno::Reference< css::media::XPlayer > SAL_CALL createPlayer( const OUString& aURL ) throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::media::XPlayer > SAL_CALL createPlayer( const OUString& aURL ) throw (css::uno::RuntimeException) override;
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) override;
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx
index 76ffc30616b2..a5f9f4e62888 100644
--- a/avmedia/source/win/player.cxx
+++ b/avmedia/source/win/player.cxx
@@ -47,7 +47,7 @@ namespace avmedia { namespace win {
LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
{
- Player* pPlayer = (Player*) ::GetWindowLongPtr( hWnd, 0 );
+ Player* pPlayer = reinterpret_cast<Player*>(::GetWindowLongPtr( hWnd, 0 ));
bool bProcessed = true;
if( pPlayer )
@@ -73,7 +73,7 @@ bool isWindowsVistaOrHigher()
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
- return IsWindowsVistaOrGreater() ? true : false;
+ return IsWindowsVistaOrGreater();
#else
// POST: return true if we are at least on Windows Vista
OSVERSIONINFO osvi;
@@ -88,23 +88,23 @@ bool isWindowsVistaOrHigher()
Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
Player_BASE(m_aMutex),
mxMgr( rxMgr ),
- mpGB( NULL ),
- mpOMF( NULL ),
- mpMC( NULL ),
- mpME( NULL ),
- mpMS( NULL ),
- mpMP( NULL ),
- mpBA( NULL ),
- mpBV( NULL ),
- mpVW( NULL ),
- mpEV( NULL ),
+ mpGB( nullptr ),
+ mpOMF( nullptr ),
+ mpMC( nullptr ),
+ mpME( nullptr ),
+ mpMS( nullptr ),
+ mpMP( nullptr ),
+ mpBA( nullptr ),
+ mpBV( nullptr ),
+ mpVW( nullptr ),
+ mpEV( nullptr ),
mnUnmutedVolume( 0 ),
- mnFrameWnd( 0 ),
+ mnFrameWnd( nullptr ),
mbMuted( false ),
mbLooping( false ),
mbAddWindow( true )
{
- ::CoInitialize( NULL );
+ ::CoInitialize( nullptr );
}
@@ -161,31 +161,31 @@ bool Player::create( const OUString& rURL )
HRESULT hR;
bool bRet = false;
- if( SUCCEEDED( hR = CoCreateInstance( CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**) &mpGB ) ) )
+ if( SUCCEEDED( hR = CoCreateInstance( CLSID_FilterGraph, nullptr, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, reinterpret_cast<void**>(&mpGB) ) ) )
{
// Don't use the overlay mixer on Windows Vista
// It disables the desktop composition as soon as RenderFile is called
// also causes some other problems: video rendering is not reliable
- if( !isWindowsVistaOrHigher() && SUCCEEDED( CoCreateInstance( CLSID_OverlayMixer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &mpOMF ) ) )
+ if( !isWindowsVistaOrHigher() && SUCCEEDED( CoCreateInstance( CLSID_OverlayMixer, nullptr, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&mpOMF) ) ) )
{
mpGB->AddFilter( mpOMF, L"com_sun_star_media_OverlayMixerFilter" );
- if( !SUCCEEDED( mpOMF->QueryInterface( IID_IDDrawExclModeVideo, (void**) &mpEV ) ) )
- mpEV = NULL;
+ if( !SUCCEEDED( mpOMF->QueryInterface( IID_IDDrawExclModeVideo, reinterpret_cast<void**>(&mpEV) ) ) )
+ mpEV = nullptr;
}
- if( SUCCEEDED( hR = mpGB->RenderFile( reinterpret_cast<LPCWSTR>(rURL.getStr()), NULL ) ) &&
- SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaControl, (void**) &mpMC ) ) &&
- SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaEventEx, (void**) &mpME ) ) &&
- SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaSeeking, (void**) &mpMS ) ) &&
- SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaPosition, (void**) &mpMP ) ) )
+ if( SUCCEEDED( hR = mpGB->RenderFile( reinterpret_cast<LPCWSTR>(rURL.getStr()), nullptr ) ) &&
+ SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaControl, reinterpret_cast<void**>(&mpMC) ) ) &&
+ SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaEventEx, reinterpret_cast<void**>(&mpME) ) ) &&
+ SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaSeeking, reinterpret_cast<void**>(&mpMS) ) ) &&
+ SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaPosition, reinterpret_cast<void**>(&mpMP) ) ) )
{
// Video interfaces
- mpGB->QueryInterface( IID_IVideoWindow, (void**) &mpVW );
- mpGB->QueryInterface( IID_IBasicVideo, (void**) &mpBV );
+ mpGB->QueryInterface( IID_IVideoWindow, reinterpret_cast<void**>(&mpVW) );
+ mpGB->QueryInterface( IID_IBasicVideo, reinterpret_cast<void**>(&mpBV) );
// Audio interface
- mpGB->QueryInterface( IID_IBasicAudio, (void**) &mpBA );
+ mpGB->QueryInterface( IID_IBasicAudio, reinterpret_cast<void**>(&mpBA) );
if( mpBA )
mpBA->put_Volume( mnUnmutedVolume );
@@ -213,7 +213,7 @@ void Player::setNotifyWnd( HWND nNotifyWnd )
{
mbAddWindow = false;
if( mpME )
- mpME->SetNotifyWindow( (OAHWND) nNotifyWnd, WM_GRAPHNOTIFY, reinterpret_cast< LONG_PTR>( this ) );
+ mpME->SetNotifyWindow( reinterpret_cast<OAHWND>(nNotifyWnd), WM_GRAPHNOTIFY, reinterpret_cast< LONG_PTR>( this ) );
}
@@ -253,31 +253,31 @@ void SAL_CALL Player::start( )
{
if ( mbAddWindow )
{
- static WNDCLASS* mpWndClass = NULL;
+ static WNDCLASS* mpWndClass = nullptr;
if ( !mpWndClass )
{
mpWndClass = new WNDCLASS;
memset( mpWndClass, 0, sizeof( *mpWndClass ) );
- mpWndClass->hInstance = GetModuleHandle( NULL );
+ mpWndClass->hInstance = GetModuleHandle( nullptr );
mpWndClass->cbWndExtra = sizeof( DWORD );
mpWndClass->lpfnWndProc = MediaPlayerWndProc_2;
mpWndClass->lpszClassName = "com_sun_star_media_Sound_Player";
- mpWndClass->hbrBackground = (HBRUSH) ::GetStockObject( BLACK_BRUSH );
- mpWndClass->hCursor = ::LoadCursor( NULL, IDC_ARROW );
+ mpWndClass->hbrBackground = static_cast<HBRUSH>(::GetStockObject( BLACK_BRUSH ));
+ mpWndClass->hCursor = ::LoadCursor( nullptr, IDC_ARROW );
::RegisterClass( mpWndClass );
}
if ( !mnFrameWnd )
{
- mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL,
+ mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, nullptr,
0,
0, 0, 0, 0,
- (HWND) NULL, NULL, mpWndClass->hInstance, 0 );
+ nullptr, nullptr, mpWndClass->hInstance, nullptr );
if ( mnFrameWnd )
{
::ShowWindow(mnFrameWnd, SW_HIDE);
- ::SetWindowLongPtr( mnFrameWnd, 0, (LONG_PTR) this );
+ ::SetWindowLongPtr( mnFrameWnd, 0, reinterpret_cast<LONG_PTR>(this) );
// mpVW->put_Owner( (OAHWND) mnFrameWnd );
setNotifyWnd( mnFrameWnd );
}
diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx
index 2923d0ded939..425ae00dada3 100644
--- a/avmedia/source/win/player.hxx
+++ b/avmedia/source/win/player.hxx
@@ -56,7 +56,7 @@ class Player : public cppu::BaseMutex,
public:
explicit Player( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
- ~Player();
+ ~Player() override;
bool create( const OUString& rURL );
@@ -66,29 +66,29 @@ public:
const IVideoWindow* getVideoWindow() const;
// XPlayer
- virtual void SAL_CALL start( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL stop( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isPlaying( ) throw (css::uno::RuntimeException);
- virtual double SAL_CALL getDuration( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setMediaTime( double fTime ) throw (css::uno::RuntimeException);
- virtual double SAL_CALL getMediaTime( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isPlaybackLoop( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setMute( sal_Bool bSet ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isMute( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (css::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL getVolumeDB( ) throw (css::uno::RuntimeException);
- virtual css::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) throw (css::uno::RuntimeException);
- virtual css::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::RuntimeException);
- virtual css::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL start( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL stop( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL isPlaying( ) throw (css::uno::RuntimeException) override;
+ virtual double SAL_CALL getDuration( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setMediaTime( double fTime ) throw (css::uno::RuntimeException) override;
+ virtual double SAL_CALL getMediaTime( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL isPlaybackLoop( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setMute( sal_Bool bSet ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL isMute( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) throw (css::uno::RuntimeException) override;
+ virtual sal_Int16 SAL_CALL getVolumeDB( ) throw (css::uno::RuntimeException) override;
+ virtual css::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const css::uno::Sequence< css::uno::Any >& aArguments ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) throw (css::uno::RuntimeException) override;
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) override;
// ::cppu::OComponentHelper
- virtual void SAL_CALL disposing();
+ virtual void SAL_CALL disposing() override;
private:
diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx
index 4819c9fa5be3..ba30b07403c5 100644
--- a/avmedia/source/win/window.cxx
+++ b/avmedia/source/win/window.cxx
@@ -43,13 +43,13 @@ namespace avmedia { namespace win {
static ::osl::Mutex& ImplGetOwnStaticMutex()
{
- static ::osl::Mutex* pMutex = NULL;
+ static ::osl::Mutex* pMutex = nullptr;
- if( pMutex == NULL )
+ if( pMutex == nullptr )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( pMutex == NULL )
+ if( pMutex == nullptr )
{
static ::osl::Mutex aMutex;
pMutex = &aMutex;
@@ -61,7 +61,7 @@ static ::osl::Mutex& ImplGetOwnStaticMutex()
LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
{
- Window* pWindow = (Window*) ::GetWindowLongPtr( hWnd, 0 );
+ Window* pWindow = reinterpret_cast<Window*>(::GetWindowLongPtr( hWnd, 0 ));
bool bProcessed = true;
if( pWindow )
@@ -159,18 +159,18 @@ LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM n
WNDCLASS* lcl_getWndClass()
{
- static WNDCLASS* s_pWndClass = NULL;
+ static WNDCLASS* s_pWndClass = nullptr;
if ( !s_pWndClass )
{
s_pWndClass = new WNDCLASS;
memset( s_pWndClass, 0, sizeof( *s_pWndClass ) );
- s_pWndClass->hInstance = GetModuleHandle( NULL );
+ s_pWndClass->hInstance = GetModuleHandle( nullptr );
s_pWndClass->cbWndExtra = sizeof( DWORD );
s_pWndClass->lpfnWndProc = MediaPlayerWndProc;
s_pWndClass->lpszClassName = "com_sun_star_media_PlayerWnd";
- s_pWndClass->hbrBackground = (HBRUSH) ::GetStockObject( BLACK_BRUSH );
- s_pWndClass->hCursor = ::LoadCursor( NULL, IDC_ARROW );
+ s_pWndClass->hbrBackground = static_cast<HBRUSH>(::GetStockObject( BLACK_BRUSH ));
+ s_pWndClass->hCursor = ::LoadCursor( nullptr, IDC_ARROW );
::RegisterClass( s_pWndClass );
}
@@ -182,8 +182,8 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Playe
maListeners( maMutex ),
meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ),
mrPlayer( rPlayer ),
- mnFrameWnd( 0 ),
- mnParentWnd( 0 ),
+ mnFrameWnd( nullptr ),
+ mnParentWnd( nullptr ),
mnPointerType( awt::SystemPointer::ARROW )
{
::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() );
@@ -297,17 +297,17 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments )
mnParentWnd = reinterpret_cast<HWND>(nWnd);
- mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL,
+ mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, nullptr,
WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
aRect.X, aRect.Y, aRect.Width, aRect.Height,
- mnParentWnd, NULL, mpWndClass->hInstance, 0 );
+ mnParentWnd, nullptr, mpWndClass->hInstance, nullptr );
if( mnFrameWnd )
{
- ::SetWindowLongPtr( mnFrameWnd, 0, (LONG_PTR) this );
+ ::SetWindowLongPtr( mnFrameWnd, 0, reinterpret_cast<LONG_PTR>(this) );
- pVideoWindow->put_Owner( (OAHWND) mnFrameWnd );
- pVideoWindow->put_MessageDrain( (OAHWND) mnFrameWnd );
+ pVideoWindow->put_Owner( reinterpret_cast<OAHWND>(mnFrameWnd) );
+ pVideoWindow->put_MessageDrain( reinterpret_cast<OAHWND>(mnFrameWnd) );
pVideoWindow->put_WindowStyle( WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN );
mrPlayer.setNotifyWnd( mnFrameWnd );
@@ -317,7 +317,7 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments )
}
}
- return( mnFrameWnd != 0 );
+ return( mnFrameWnd != nullptr );
}
void Window::processGraphEvent()
@@ -340,13 +340,13 @@ void Window::updatePointer()
break;
}
- ::SetCursor( ::LoadCursor( NULL, pCursorName ) );
+ ::SetCursor( ::LoadCursor( nullptr, pCursorName ) );
}
void SAL_CALL Window::update( )
throw (uno::RuntimeException)
{
- ::RedrawWindow( (HWND) mnFrameWnd, NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE );
+ ::RedrawWindow( mnFrameWnd, nullptr, nullptr, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE );
}
sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel )
diff --git a/avmedia/source/win/window.hxx b/avmedia/source/win/window.hxx
index ca44d392ca91..c034bd0c9f17 100644
--- a/avmedia/source/win/window.hxx
+++ b/avmedia/source/win/window.hxx
@@ -44,46 +44,46 @@ public:
Window( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr,
Player& rPlayer );
- ~Window();
+ ~Window() override;
bool create( const css::uno::Sequence< css::uno::Any >& aArguments );
void processGraphEvent();
void updatePointer();
// XPlayerWindow
- virtual void SAL_CALL update( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel ) throw (css::uno::RuntimeException);
- virtual css::media::ZoomLevel SAL_CALL getZoomLevel( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL update( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel ) throw (css::uno::RuntimeException) override;
+ virtual css::media::ZoomLevel SAL_CALL getZoomLevel( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) throw (css::uno::RuntimeException) override;
// XWindow
- virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (css::uno::RuntimeException);
- virtual css::awt::Rectangle SAL_CALL getPosSize( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setVisible( sal_Bool Visible ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setEnable( sal_Bool Enable ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setFocus( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (css::uno::RuntimeException) override;
+ virtual css::awt::Rectangle SAL_CALL getPosSize( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setVisible( sal_Bool Visible ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setEnable( sal_Bool Enable ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL setFocus( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) throw (css::uno::RuntimeException) override;
// XComponent
- virtual void SAL_CALL dispose( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL dispose( ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException) override;
+ virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException) override;
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException);
+ virtual OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) override;
public:
diff --git a/avmedia/source/win/winuno.cxx b/avmedia/source/win/winuno.cxx
index a93fb9a5b146..92d7af1a0f9f 100644
--- a/avmedia/source/win/winuno.cxx
+++ b/avmedia/source/win/winuno.cxx
@@ -34,15 +34,15 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno:
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediawin_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* )
{
uno::Reference< lang::XSingleServiceFactory > xFactory;
- void* pRet = 0;
+ void* pRet = nullptr;
if( rtl_str_compare( pImplName, "com.sun.star.comp.avmedia.Manager_DirectX" ) == 0 )
{
const OUString aServiceName( "com.sun.star.media.Manager_DirectX" );
xFactory.set( ::cppu::createSingleFactory(
- reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
- OUString("com.sun.star.comp.avmedia.Manager_DirectX" ),
+ static_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ "com.sun.star.comp.avmedia.Manager_DirectX",
create_MediaPlayer, uno::Sequence< OUString >( &aServiceName, 1 ) ) );
}