Kaydet (Commit) 929baba5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify MediaWindow::mpImpl

Change-Id: Ia466a08a8135a7f2e43278354c767be3a063550a
üst 110bbaf0
...@@ -52,19 +52,13 @@ MediaWindow::MediaWindow( Window* parent, bool bInternalMediaControl ) : ...@@ -52,19 +52,13 @@ MediaWindow::MediaWindow( Window* parent, bool bInternalMediaControl ) :
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
MediaWindow::~MediaWindow() MediaWindow::~MediaWindow() {}
{
mpImpl->cleanUp();
delete mpImpl;
mpImpl = NULL;
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::setURL( const OUString& rURL ) 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 ...@@ -78,7 +72,7 @@ const OUString& MediaWindow::getURL() const
bool MediaWindow::isValid() const bool MediaWindow::isValid() const
{ {
return( mpImpl != NULL && mpImpl->isValid() ); return mpImpl->isValid();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -148,64 +142,56 @@ Size MediaWindow::getPreferredSize() const ...@@ -148,64 +142,56 @@ Size MediaWindow::getPreferredSize() const
void MediaWindow::setPosSize( const Rectangle& rNewRect ) void MediaWindow::setPosSize( const Rectangle& rNewRect )
{ {
if( mpImpl ) mpImpl->setPosSize( rNewRect );
{
mpImpl->setPosSize( rNewRect );
}
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::setPointer( const Pointer& rPointer ) void MediaWindow::setPointer( const Pointer& rPointer )
{ {
if( mpImpl ) mpImpl->setPointer( rPointer );
mpImpl->setPointer( rPointer );
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
bool MediaWindow::start() bool MediaWindow::start()
{ {
return( mpImpl != NULL && mpImpl->start() ); return mpImpl->start();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::updateMediaItem( MediaItem& rItem ) const void MediaWindow::updateMediaItem( MediaItem& rItem ) const
{ {
if( mpImpl ) mpImpl->updateMediaItem( rItem );
mpImpl->updateMediaItem( rItem );
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::executeMediaItem( const MediaItem& rItem ) void MediaWindow::executeMediaItem( const MediaItem& rItem )
{ {
if( mpImpl ) mpImpl->executeMediaItem( rItem );
mpImpl->executeMediaItem( rItem );
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::show() void MediaWindow::show()
{ {
if( mpImpl ) mpImpl->Show();
mpImpl->Show();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void MediaWindow::hide() void MediaWindow::hide()
{ {
if( mpImpl ) mpImpl->Hide();
mpImpl->Hide();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
Window* MediaWindow::getWindow() const Window* MediaWindow::getWindow() const
{ {
return mpImpl; return mpImpl.get();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
...@@ -175,15 +175,6 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo ...@@ -175,15 +175,6 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
MediaWindowImpl::~MediaWindowImpl() MediaWindowImpl::~MediaWindowImpl()
{
delete mpEmptyBmpEx;
delete mpAudioBmpEx;
delete mpMediaWindowControl;
}
// ---------------------------------------------------------------------
void MediaWindowImpl::cleanUp()
{ {
uno::Reference< media::XPlayerWindow > xPlayerWindow( getPlayerWindow() ); uno::Reference< media::XPlayerWindow > xPlayerWindow( getPlayerWindow() );
...@@ -209,6 +200,10 @@ void MediaWindowImpl::cleanUp() ...@@ -209,6 +200,10 @@ void MediaWindowImpl::cleanUp()
mxPlayer.clear(); mxPlayer.clear();
mpMediaWindow = NULL; mpMediaWindow = NULL;
delete mpEmptyBmpEx;
delete mpAudioBmpEx;
delete mpMediaWindowControl;
} }
uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL ) uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL )
......
...@@ -91,8 +91,6 @@ namespace avmedia ...@@ -91,8 +91,6 @@ namespace avmedia
MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl ); MediaWindowImpl( Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
virtual ~MediaWindowImpl(); virtual ~MediaWindowImpl();
void cleanUp();
static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL ); static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL );
void setURL( const OUString& rURL, OUString const& rTempURL ); void setURL( const OUString& rURL, OUString const& rTempURL );
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <com/sun/star/media/ZoomLevel.hpp> #include <com/sun/star/media/ZoomLevel.hpp>
#include <com/sun/star/media/XPlayer.hpp> #include <com/sun/star/media/XPlayer.hpp>
...@@ -118,7 +119,7 @@ namespace avmedia ...@@ -118,7 +119,7 @@ namespace avmedia
AVMEDIA_DLLPRIVATE MediaWindow& operator =( const MediaWindow& ); AVMEDIA_DLLPRIVATE MediaWindow& operator =( const MediaWindow& );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxIFace; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxIFace;
priv::MediaWindowImpl* mpImpl; boost::scoped_ptr<priv::MediaWindowImpl> mpImpl;
}; };
} }
......
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