diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-11-18 17:01:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-11-18 17:02:17 +0100 |
commit | 929baba5f08a59aeaf460d7c6b76238aca6c5d67 (patch) | |
tree | aeeebd2ae8f30b6687c388a449d16bf1133172e1 /avmedia | |
parent | Remove bogus comment (diff) | |
download | core-929baba5f08a59aeaf460d7c6b76238aca6c5d67.tar.gz core-929baba5f08a59aeaf460d7c6b76238aca6c5d67.zip |
Simplify MediaWindow::mpImpl
Change-Id: Ia466a08a8135a7f2e43278354c767be3a063550a
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/viewer/mediawindow.cxx | 36 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 13 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.hxx | 2 |
3 files changed, 15 insertions, 36 deletions
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 183a9554e129..45c9901035c7 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -52,19 +52,13 @@ MediaWindow::MediaWindow( Window* parent, bool bInternalMediaControl ) : // ------------------------------------------------------------------------- -MediaWindow::~MediaWindow() -{ - mpImpl->cleanUp(); - delete mpImpl; - mpImpl = NULL; -} +MediaWindow::~MediaWindow() {} // ------------------------------------------------------------------------- void MediaWindow::setURL( const OUString& rURL ) { - if( mpImpl ) - mpImpl->setURL( rURL, OUString() ); + mpImpl->setURL( rURL, OUString() ); } // ------------------------------------------------------------------------- @@ -78,7 +72,7 @@ const OUString& MediaWindow::getURL() const bool MediaWindow::isValid() const { - return( mpImpl != NULL && mpImpl->isValid() ); + return mpImpl->isValid(); } // ------------------------------------------------------------------------- @@ -148,64 +142,56 @@ Size MediaWindow::getPreferredSize() const void MediaWindow::setPosSize( const Rectangle& rNewRect ) { - if( mpImpl ) - { - mpImpl->setPosSize( rNewRect ); - } + mpImpl->setPosSize( rNewRect ); } // ------------------------------------------------------------------------- void MediaWindow::setPointer( const Pointer& rPointer ) { - if( mpImpl ) - mpImpl->setPointer( rPointer ); + mpImpl->setPointer( rPointer ); } // ------------------------------------------------------------------------- bool MediaWindow::start() { - return( mpImpl != NULL && mpImpl->start() ); + return mpImpl->start(); } // ------------------------------------------------------------------------- void MediaWindow::updateMediaItem( MediaItem& rItem ) const { - if( mpImpl ) - mpImpl->updateMediaItem( rItem ); + mpImpl->updateMediaItem( rItem ); } // ------------------------------------------------------------------------- void MediaWindow::executeMediaItem( const MediaItem& rItem ) { - if( mpImpl ) - mpImpl->executeMediaItem( rItem ); + mpImpl->executeMediaItem( rItem ); } // ------------------------------------------------------------------------- void MediaWindow::show() { - if( mpImpl ) - mpImpl->Show(); + mpImpl->Show(); } // ------------------------------------------------------------------------- void MediaWindow::hide() { - if( mpImpl ) - mpImpl->Hide(); + mpImpl->Hide(); } // ------------------------------------------------------------------------- Window* MediaWindow::getWindow() const { - return mpImpl; + return mpImpl.get(); } // ------------------------------------------------------------------------- diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index aa402b3dee86..cb513dca3431 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -176,15 +176,6 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo MediaWindowImpl::~MediaWindowImpl() { - delete mpEmptyBmpEx; - delete mpAudioBmpEx; - delete mpMediaWindowControl; -} - -// --------------------------------------------------------------------- - -void MediaWindowImpl::cleanUp() -{ uno::Reference< media::XPlayerWindow > xPlayerWindow( getPlayerWindow() ); mpEvents->cleanUp(); @@ -209,6 +200,10 @@ void MediaWindowImpl::cleanUp() mxPlayer.clear(); mpMediaWindow = NULL; + + delete mpEmptyBmpEx; + delete mpAudioBmpEx; + delete mpMediaWindowControl; } uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL ) diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index 9c9d8142fcdf..f26cd8744183 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -91,8 +91,6 @@ namespace avmedia MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl ); virtual ~MediaWindowImpl(); - void cleanUp(); - static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL ); void setURL( const OUString& rURL, OUString const& rTempURL ); |