summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2013-07-17 17:42:15 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-08-13 14:18:59 +0000
commit38f11fdb08249a6cf7140ee74016cd69f28e289a (patch)
tree69c7ba2343501bf99e5520643159fd523fea58c0
parent125be9e41c2a6d40bf4646d4a8af96f5d97994d8 (diff)
fdo#45233 Allow editing pps/ppsx Autoplay Presentations
Added a context menu "Edit Presentation" when in Autplay mode. This has been discussed and approved by the Design team: https://wiki.documentfoundation.org/Design/Meetings/2013-07-20 Change-Id: Ic229e54bd10d23f999f1d746cce38c4004504d28 Reviewed-on: https://gerrit.libreoffice.org/4998 Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com> Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Reviewed-by: Tor Lillqvist <tml@iki.fi> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/inc/drawdoc.hxx4
-rw-r--r--sd/source/core/drawdoc.cxx10
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx4
-rw-r--r--sd/source/ui/slideshow/slideshow.hrc2
-rw-r--r--sd/source/ui/slideshow/slideshow.src5
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx19
6 files changed, 42 insertions, 2 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 77ac6b676b2a..cb0e758fcdca 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -164,6 +164,7 @@ private:
sal_Bool mbOnlineSpell;
sal_Bool mbSummationOfParagraphs;
bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start
+ bool mbExitAfterPresenting = false; ///< true if mbStartWithPresentation AND Presentation was shown fully
LanguageType meLanguage;
LanguageType meLanguageCJK;
LanguageType meLanguageCTL;
@@ -258,6 +259,9 @@ public:
bool IsStartWithPresentation() const;
void SetStartWithPresentation( bool bStartWithPresentation );
+ bool IsExitAfterPresenting() const;
+ void SetExitAfterPresenting( bool bExitAfterPresenting );
+
/** Insert pages into this document
This method inserts whole pages into this document, either
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 2d294eb5e11c..07dda031cf6f 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -936,6 +936,16 @@ void SdDrawDocument::SetStartWithPresentation( bool bStartWithPresentation )
mbStartWithPresentation = bStartWithPresentation;
}
+bool SdDrawDocument::IsExitAfterPresenting() const
+{
+ return mbExitAfterPresenting;
+}
+
+void SdDrawDocument::SetExitAfterPresenting( bool bExitAfterPresenting )
+{
+ mbExitAfterPresenting = bExitAfterPresenting;
+}
+
void SdDrawDocument::PageListChanged()
{
mpDrawPageListWatcher->Invalidate();
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 50a93e5ff4e0..5213724c0cdc 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -802,9 +802,9 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
}
}
- if( pViewShell->GetDoc()->IsStartWithPresentation() )
+ if( pViewShell->GetDoc()->IsExitAfterPresenting() )
{
- pViewShell->GetDoc()->SetStartWithPresentation( false );
+ pViewShell->GetDoc()->SetExitAfterPresenting( false );
Reference<frame::XDispatchProvider> xProvider(pViewShell->GetViewShellBase().GetController()->getFrame(),
UNO_QUERY);
diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc
index 98a058bdf4c4..4e6169f43b87 100644
--- a/sd/source/ui/slideshow/slideshow.hrc
+++ b/sd/source/ui/slideshow/slideshow.hrc
@@ -41,6 +41,8 @@
#define CM_WIDTH_PEN_VERY_THICK 17
#define CM_PEN_MODE 18
+#define CM_EDIT_PRESENTATION 19
+
#define CM_SLIDES 21 // this must be the last id!
#endif
diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src
index 324ec0997bbb..480cc096063a 100644
--- a/sd/source/ui/slideshow/slideshow.src
+++ b/sd/source/ui/slideshow/slideshow.src
@@ -142,6 +142,11 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
MenuItem
{
+ Identifier = CM_EDIT_PRESENTATION ;
+ Text [ en-US ] = "E~dit Presentation" ;
+ };
+ MenuItem
+ {
Identifier = CM_ENDSHOW ;
Text [ en-US ] = "~End Show" ;
};
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 6f67a1b2b7f2..b096dc48a844 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -897,6 +897,11 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
if (mpParentWindow == NULL)
return false;
+ // Autoplay (pps/ppsx)
+ if (mpViewShell->GetDoc()->IsStartWithPresentation()){
+ mpViewShell->GetDoc()->SetExitAfterPresenting(true);
+ }
+
bool bRet = false;
try
@@ -2145,6 +2150,7 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl)
const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) );
pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) );
+ pMenu->EnableItem( CM_EDIT_PRESENTATION, mpViewShell->GetDoc()->IsStartWithPresentation());
PopupMenu* pPageMenu = pMenu->GetPopupMenu( CM_GOTO );
@@ -2371,6 +2377,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
mbWasPaused = false;
}
break;
+ case CM_EDIT_PRESENTATION:
+ // When in autoplay mode (pps/ppsx), offer editing of the presentation
+ // Turn autostart off, else Impress will close when exiting the Presentation
+ mpViewShell->GetDoc()->SetExitAfterPresenting(false);
+ if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
+ {
+ if( mpSlideController->getCurrentSlideNumber() != -1 )
+ {
+ mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
+ }
+ }
+ endPresentation();
+ break;
case CM_ENDSHOW:
// in case the user cancels the presentation, switch to current slide
// in edit mode