summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-07-25 06:03:21 +0000
committerOliver Bolte <obo@openoffice.org>2008-07-25 06:03:21 +0000
commita06d1660430dc611f9caf817f187f3eb942ccc25 (patch)
treeec579d3dda921a166c77a2a864cd6d09ead13829 /sd
parent998e71c5f23b798f490d8e98fb7ba46803205bb2 (diff)
INTEGRATION: CWS impress148 (1.12.76); FILE MERGED
2008/07/23 15:52:53 cl 1.12.76.2: RESYNC: (1.12-1.13); FILE MERGED 2008/07/10 16:04:07 af 1.12.76.1: #i91501# Added mbIsInStartup flag to prevent multiple slide shows for one document.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx30
1 files changed, 28 insertions, 2 deletions
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 96a6546f3ecb..717de7b5a531 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: slideshow.cxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
* This file is part of OpenOffice.org.
*
@@ -152,6 +152,7 @@ SfxItemPropertyMap map_impl[] = { { 0,0,0,0,0,0 } };
SlideShow::SlideShow( SdDrawDocument* pDoc )
: SlideshowBase( m_aMutex )
, maPropSet(ImplGetPresentationPropertyMap())
+, mbIsInStartup(false)
, mpDoc( pDoc )
, mpCurrentViewShellBase( 0 )
, mpFullScreenViewShellBase( 0 )
@@ -255,7 +256,13 @@ void SlideShow::CreateController( ViewShell* pViewSh, ::sd::View* pView, ::Wind
Reference< XPresentation2 > xThis( this );
- mxController.set( new SlideshowImpl( xThis, pViewSh, pView, mpDoc, pParentWindow ) );
+ rtl::Reference<SlideshowImpl> xController (
+ new SlideshowImpl(xThis, pViewSh, pView, mpDoc, pParentWindow));
+
+ // Reset mbIsInStartup. From here mxController.is() is used to prevent
+ // multiple slide show instances for one document.
+ mxController = xController;
+ mbIsInStartup = false;
}
// --------------------------------------------------------------------
@@ -674,6 +681,12 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
{
OGuard aGuard( Application::GetSolarMutex() );
+ // The mbIsInStartup flag should have been reset during the start of the
+ // slide show. Reset it here just in case that something has horribly
+ // gone wrong.
+ OSL_ASSERT(!mbIsInStartup);
+ mbIsInStartup = false;
+
rtl::Reference< SlideshowImpl > xController( mxController );
if( xController.is() )
{
@@ -786,7 +799,20 @@ void SAL_CALL SlideShow::startWithArguments( const Sequence< PropertyValue >& rA
// Stop a running show before starting a new one.
if( mxController.is() )
+ {
+ OSL_ASSERT(!mbIsInStartup);
end();
+ }
+ else if (mbIsInStartup)
+ {
+ // We are already somewhere in process of starting a slide show but
+ // have not yet got to the point where mxController is set. There
+ // is not yet a slide show to end so return silently.
+ return;
+ }
+
+ // Prevent multiple instance of the SlideShow class for one document.
+ mbIsInStartup = true;
mxCurrentSettings.reset( new PresentationSettingsEx( mpDoc->getPresentationSettings() ) );
mxCurrentSettings->SetArguments( rArguments );