summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2013-07-17 17:42:15 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-07-29 11:53:05 +0000
commitb8608fddf09bc243af63f3721443f518138f9be0 (patch)
tree1c59beba35d5544de2fff6ad55f65278c56a3c37
parentdd9c97d587d2a295d44e8685d253d30542a2c85a (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/4960 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
-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 aca4996aadae..5fe97862b718 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -935,6 +935,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 a34e66008c49..a51058940293 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 68b9b7766731..21687ef25bf2 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
@@ -2158,6 +2163,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 );
@@ -2384,6 +2390,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