diff options
Diffstat (limited to 'avmedia/source/viewer')
-rw-r--r-- | avmedia/source/viewer/mediaevent_impl.cxx | 14 | ||||
-rw-r--r-- | avmedia/source/viewer/mediaevent_impl.hxx | 3 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 3 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.hxx | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx index 86e18175101c..3e42ebb223b4 100644 --- a/avmedia/source/viewer/mediaevent_impl.cxx +++ b/avmedia/source/viewer/mediaevent_impl.cxx @@ -45,7 +45,7 @@ MediaEventListenersImpl::~MediaEventListenersImpl() void MediaEventListenersImpl::cleanUp() { - Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow ) ); + Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ) ); mpNotifyWindow = NULL; } @@ -72,7 +72,7 @@ void SAL_CALL MediaEventListenersImpl::keyPressed( const ::com::sun::star::awt:: ( ( e.Modifiers & 4 ) ? KEY_MOD2 : 0 ) ); KeyEvent aVCLKeyEvt( e.KeyChar, aVCLKeyCode ); - Application::PostKeyEvent( VCLEVENT_WINDOW_KEYINPUT, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLKeyEvt ); + Application::PostKeyEvent( VCLEVENT_WINDOW_KEYINPUT, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLKeyEvt ); } } @@ -91,7 +91,7 @@ void SAL_CALL MediaEventListenersImpl::keyReleased( const ::com::sun::star::awt: ( ( e.Modifiers & 2 ) ? KEY_MOD1 : 0 ) | ( ( e.Modifiers & 4 ) ? KEY_MOD2 : 0 ) ); KeyEvent aVCLKeyEvt( e.KeyChar, aVCLKeyCode ); - Application::PostKeyEvent( VCLEVENT_WINDOW_KEYUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLKeyEvt ); + Application::PostKeyEvent( VCLEVENT_WINDOW_KEYUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLKeyEvt ); } } @@ -112,7 +112,7 @@ void SAL_CALL MediaEventListenersImpl::mousePressed( const ::com::sun::star::awt ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) | ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ), e.Modifiers ); - Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); + Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt ); } } @@ -133,7 +133,7 @@ void SAL_CALL MediaEventListenersImpl::mouseReleased( const ::com::sun::star::aw ( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) | ( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ), e.Modifiers ); - Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); + Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt ); } } @@ -174,7 +174,7 @@ void SAL_CALL MediaEventListenersImpl::mouseDragged( const ::com::sun::star::awt if( mpNotifyWindow ) { MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers ); - Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); + Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt ); } } @@ -189,7 +189,7 @@ void SAL_CALL MediaEventListenersImpl::mouseMoved( const ::com::sun::star::awt:: if( mpNotifyWindow ) { MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers ); - Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt ); + Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt ); } } diff --git a/avmedia/source/viewer/mediaevent_impl.hxx b/avmedia/source/viewer/mediaevent_impl.hxx index 63e1a0d77ba2..27676c749d84 100644 --- a/avmedia/source/viewer/mediaevent_impl.hxx +++ b/avmedia/source/viewer/mediaevent_impl.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/awt/XMouseListener.hpp> #include <com/sun/star/awt/XMouseMotionListener.hpp> #include <com/sun/star/awt/XFocusListener.hpp> +#include <vcl/vclptr.hxx> namespace avmedia { @@ -69,7 +70,7 @@ namespace avmedia private: - vcl::Window* mpNotifyWindow; + VclPtr<vcl::Window> mpNotifyWindow; mutable ::osl::Mutex maMutex; }; } diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index b2716eebf5cc..c43f6829955d 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -204,8 +204,7 @@ void MediaWindowImpl::dispose() mpEmptyBmpEx = NULL; delete mpAudioBmpEx; mpAudioBmpEx = NULL; - delete mpMediaWindowControl; - mpMediaWindowControl = NULL; + mpMediaWindowControl.clear(); Control::dispose(); } diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index 1311a2b4855f..40131c3c6fe2 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -173,7 +173,7 @@ namespace avmedia MediaEventListenersImpl* mpEvents; bool mbEventTransparent; std::unique_ptr<MediaChildWindow> mpChildWindow; - MediaWindowControl* mpMediaWindowControl; + VclPtr<MediaWindowControl> mpMediaWindowControl; BitmapEx* mpEmptyBmpEx; BitmapEx* mpAudioBmpEx; }; |