diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-16 21:04:34 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-16 21:04:34 +0100 |
commit | 384e705a9e1e41dd859d22a09293c65a28ef6535 (patch) | |
tree | 51a9f8e40818533d81a7b26166c765f71a2d1936 /avmedia/source | |
parent | 5430eb76db1ca40248717bcbee6b65e56c1a0e9b (diff) |
avmedia: convert new to ::Create to get initial ref-counting right.
Change-Id: If7441005123ba1427d308b999af84b0c55a94a07
Diffstat (limited to 'avmedia/source')
-rw-r--r-- | avmedia/source/framework/mediacontrol.cxx | 14 | ||||
-rw-r--r-- | avmedia/source/framework/mediaplayer.cxx | 2 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.cxx | 2 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index e6c680e45d3d..5168c12e34e3 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -65,13 +65,13 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl Control( pParent ), maImageList( SvtMiscOptions().AreCurrentSymbolsLarge() ? AVMEDIA_RESID( AVMEDIA_IMGLST_L ) : AVMEDIA_RESID( AVMEDIA_IMGLST ) ), maItem( 0, AVMediaSetMask::ALL ), - maPlayToolBox( new ToolBox(this, WB_3DLOOK) ), - maTimeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ), - maMuteToolBox( new ToolBox(this, WB_3DLOOK) ), - maVolumeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ), - maZoomToolBox( new ToolBox(this, WB_3DLOOK) ), - mpZoomListBox( new ListBox( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ), - maTimeEdit( new Edit(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY) ), + maPlayToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ), + maTimeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ), + maMuteToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ), + maVolumeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ), + maZoomToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ), + mpZoomListBox( VclPtr<ListBox>::Create( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ), + maTimeEdit( VclPtr<Edit>::Create(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY) ), meControlStyle( eControlStyle ), mbLocked( false ) { diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index 6f1108aee7cc..7adfb4e83826 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -40,7 +40,7 @@ namespace avmedia MediaPlayer::MediaPlayer( vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* _pBindings, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { - pWindow = new MediaFloater( _pBindings, this, _pParent ); + pWindow = VclPtr<MediaFloater>::Create( _pBindings, this, _pParent ); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast< MediaFloater* >( pWindow.get() )->Initialize( pInfo ); }; diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 402344780a8c..267e39fb7d6a 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -46,7 +46,7 @@ namespace avmedia { MediaWindow::MediaWindow( vcl::Window* parent, bool bInternalMediaControl ) : - mpImpl( new priv::MediaWindowImpl( parent, this, bInternalMediaControl ) ) + mpImpl( VclPtr<priv::MediaWindowImpl>::Create( parent, this, bInternalMediaControl ) ) { mpImpl->Show(); } diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 4d5eaa49b714..c84849b2dec3 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -156,7 +156,7 @@ MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindo mpMediaWindow( pMediaWindow ), mpEvents( NULL ), mbEventTransparent(true), - mpMediaWindowControl( bInternalMediaControl ? new MediaWindowControl( this ) : NULL ), + mpMediaWindowControl( bInternalMediaControl ? VclPtr<MediaWindowControl>::Create( this ) : nullptr ), mpEmptyBmpEx( NULL ), mpAudioBmpEx( NULL ) { @@ -509,14 +509,14 @@ void MediaWindowImpl::onURLChanged() if( m_sMimeType == AVMEDIA_MIMETYPE_COMMON ) { mpChildWindow.disposeAndClear(); - mpChildWindow.reset(new MediaChildWindow(this) ); + mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this) ); } #if HAVE_FEATURE_GLTF else if ( m_sMimeType == AVMEDIA_MIMETYPE_JSON ) { SystemWindowData aWinData = OpenGLContext::generateWinData(this, false); mpChildWindow.disposeAndClear(); - mpChildWindow.reset(new MediaChildWindow(this,&aWinData)); + mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this,&aWinData)); mbEventTransparent = false; } #endif |