[Libreoffice-commits] core.git: sd/inc sd/source
Samuel Mehrbrodt
s.mehrbrodt at gmail.com
Mon Jul 29 04:53:26 PDT 2013
sd/inc/drawdoc.hxx | 4 ++++
sd/source/core/drawdoc.cxx | 10 ++++++++++
sd/source/ui/slideshow/slideshow.cxx | 4 ++--
sd/source/ui/slideshow/slideshow.hrc | 2 ++
sd/source/ui/slideshow/slideshow.src | 5 +++++
sd/source/ui/slideshow/slideshowimpl.cxx | 19 +++++++++++++++++++
6 files changed, 42 insertions(+), 2 deletions(-)
New commits:
commit b8608fddf09bc243af63f3721443f518138f9be0
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date: Wed Jul 17 17:42:15 2013 +0200
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 at suse.cz>
Tested-by: LuboÅ¡ LuÅák <l.lunak at suse.cz>
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 77ac6b6..cb0e758 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 aca4996..5fe9786 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 a34e660..a510589 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 98a058b..4e6169f 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 324ec09..480cc09 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 68b9b77..21687ef 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
More information about the Libreoffice-commits
mailing list