summaryrefslogtreecommitdiff
path: root/sd/source/ui/slideshow/slideshowimpl.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-07-02 10:52:51 +0000
committerRüdiger Timm <rt@openoffice.org>2008-07-02 10:52:51 +0000
commit81f4197bcb8d9c4a753197f6e559f8ef422518ed (patch)
tree222ac55be15c0402f62c2b8a03cd4498602410d1 /sd/source/ui/slideshow/slideshowimpl.cxx
parent5778a2da67e61a2960a5d04c36aa02100fb77e30 (diff)
INTEGRATION: CWS impress145 (1.54.50); FILE MERGED
2008/06/18 10:04:43 cl 1.54.50.2: #i90697# applied patch to workaround a possible bug detected by valgrind/cmc 2008/06/16 13:37:20 cl 1.54.50.1: #i71026# added support for windows media application commands
Diffstat (limited to 'sd/source/ui/slideshow/slideshowimpl.cxx')
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx70
1 files changed, 65 insertions, 5 deletions
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 7b950f7635ad..668eca46b677 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: slideshowimpl.cxx,v $
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
* This file is part of OpenOffice.org.
*
@@ -559,10 +559,14 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
// no autosave during show
if( aOptions.IsAutoSave() )
mbAutoSaveWasOn = true;
+
+ Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) );
}
SlideshowImpl::~SlideshowImpl()
{
+ Application::RemoveEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) );
+
maDeactivateTimer.Stop();
if( !mbDisposed )
@@ -699,11 +703,7 @@ void SAL_CALL SlideshowImpl::disposing()
}
if( mpShowWindow )
- {
mpShowWindow->Hide();
- delete mpShowWindow;
- mpShowWindow = 0;
- }
if ( mpViewShell )
{
@@ -731,6 +731,12 @@ void SAL_CALL SlideshowImpl::disposing()
mpViewShell->GetViewShellBase().UpdateBorder(true);
}
+ if( mpShowWindow )
+ {
+ delete mpShowWindow;
+ mpShowWindow = 0;
+ }
+
mbDisposed = true;
}
@@ -2002,6 +2008,60 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt)
return bRet;
}
+IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent )
+{
+ if( !mxShow.is() || mbInputFreeze )
+ return 0;
+
+ if( pEvent && (pEvent->GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(pEvent)->GetData() )
+ {
+ const CommandEvent& rEvent = *(const CommandEvent*)static_cast<VclWindowEvent*>(pEvent)->GetData();
+
+ if( rEvent.GetCommand() == COMMAND_MEDIA )
+ {
+ switch( rEvent.GetMediaCommand() )
+ {
+ case MEDIA_COMMAND_NEXTTRACK:
+ gotoNextEffect();
+ break;
+ case MEDIA_COMMAND_PAUSE:
+ if( !mbIsPaused )
+ blankScreen(0);
+ break;
+ case MEDIA_COMMAND_PLAY:
+ if( mbIsPaused )
+ resume();
+ break;
+ case MEDIA_COMMAND_PLAY_PAUSE:
+ if( mbIsPaused )
+ resume();
+ else
+ blankScreen(0);
+ break;
+ case MEDIA_COMMAND_PREVIOUSTRACK:
+ gotoPreviousSlide();
+ break;
+
+ case MEDIA_COMMAND_REWIND:
+ gotoFirstSlide();
+ break;
+ case MEDIA_COMMAND_STOP:
+ // in case the user cancels the presentation, switch to current slide
+ // in edit mode
+ if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
+ {
+ if( mpSlideController->getCurrentSlideNumber() != -1 )
+ mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
+ }
+ endPresentation();
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
// ---------------------------------------------------------
void SlideshowImpl::mouseButtonUp(const MouseEvent& rMEvt)