summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-12-08 19:44:51 +0000
committerMichael Meeks <michael.meeks@suse.com>2011-12-08 19:46:59 +0000
commit202fca9d1534a500ed84dcd4b1e31355a49c4404 (patch)
tree7c3b6d729dc4531ec27680b5ab226ecc171ca962 /sd
parentb60260eaf8211ab1dbe5af0a57523321d66b0db1 (diff)
Fix misc. bugs in presenter view switch screen feature: make it work.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/slideshow.hxx2
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.cxx20
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.hxx4
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx26
4 files changed, 32 insertions, 20 deletions
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index 4915bf6b9466..486b402756ea 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -63,6 +63,7 @@ class CommandEvent;
class Rectangle;
class Window;
class SfxRequest;
+class WorkWindow;
// TODO: Remove
#define PAGE_NO_END 65535
@@ -205,6 +206,7 @@ private:
void ThrowIfDisposed() throw (::com::sun::star::uno::RuntimeException);
void CreateController( ViewShell* pViewSh, ::sd::View* pView, ::Window* pParentWindow );
+ WorkWindow *GetWorkWindow();
// default: disabled copy/assignment
SlideShow(const SlideShow&);
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index 536b1a672750..b017ce807636 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -58,22 +58,19 @@ SlideShowRestarter::SlideShowRestarter (
{
}
-
-
-
SlideShowRestarter::~SlideShowRestarter (void)
{
}
-
-
-
-void SlideShowRestarter::Restart (void)
+void SlideShowRestarter::Restart (bool bForce)
{
// Prevent multiple and concurrently restarts.
if (mnEventId != 0)
return;
+ if (bForce)
+ mnDisplayCount = 0;
+
// Remember the current slide in order to restore it after the slide
// show has been restarted.
if (mpSlideShow.is())
@@ -90,9 +87,6 @@ void SlideShowRestarter::Restart (void)
LINK(this, SlideShowRestarter, EndPresentation));
}
-
-
-
sal_Int32 SlideShowRestarter::GetDisplayCount (void)
{
const Reference<XComponentContext> xContext (
@@ -111,9 +105,6 @@ sal_Int32 SlideShowRestarter::GetDisplayCount (void)
return xIndexAccess->getCount();
}
-
-
-
IMPL_LINK(SlideShowRestarter, EndPresentation, void*, EMPTYARG)
{
mnEventId = 0;
@@ -158,9 +149,6 @@ IMPL_LINK(SlideShowRestarter, EndPresentation, void*, EMPTYARG)
return 0;
}
-
-
-
void SlideShowRestarter::StartPresentation (void)
{
if (mpDispatcher == NULL && mpViewShellBase!=NULL)
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.hxx b/sd/source/ui/slideshow/SlideShowRestarter.hxx
index 2f5badb442a9..082817653366 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.hxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.hxx
@@ -62,8 +62,10 @@ public:
/** Restarting the slide show is an asynchronous multi step process
which is started by calling this method.
+ @param bForce
+ Used to force a re-start, even if the display count is unchanged.
*/
- void Restart (void);
+ void Restart (bool bForce);
private:
sal_Int32 mnEventId;
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index edb9bb2414b7..ca480f564c47 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -97,13 +97,15 @@ namespace {
mpRestarter(new SlideShowRestarter(rpSlideShow, pViewShellBase))
{}
+ void Restart(bool bForce)
+ {
+ mpRestarter->Restart(bForce);
+ }
virtual void DataChanged (const DataChangedEvent& rEvent)
{
if (rEvent.GetType() == DATACHANGED_DISPLAY)
- {
- mpRestarter->Restart();
- }
+ Restart(false);
}
private:
@@ -555,6 +557,11 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const
SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
pOptions->SetDisplay( nDisplay );
+
+ FullScreenWorkWindow *pWin = dynamic_cast<FullScreenWorkWindow *>(GetWorkWindow());
+ if( !pWin )
+ return;
+ pWin->Restart(true);
}
break;
}
@@ -674,6 +681,19 @@ void SAL_CALL SlideShow::start() throw(RuntimeException)
// --------------------------------------------------------------------
+WorkWindow *SlideShow::GetWorkWindow()
+{
+ if( !mpFullScreenViewShellBase )
+ return NULL;
+
+ PresentationViewShell* pShell = dynamic_cast<PresentationViewShell*>(mpFullScreenViewShellBase->GetMainViewShell().get());
+
+ if( !pShell || !pShell->GetViewFrame() )
+ return NULL;
+
+ return dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent());
+}
+
void SAL_CALL SlideShow::end() throw(RuntimeException)
{
SolarMutexGuard aGuard;