From 39da7ee77e5c5add8aaef12bf1e80c66132782fa Mon Sep 17 00:00:00 2001 From: mmeof Date: Fri, 3 May 2013 09:20:28 -0700 Subject: fdo#56995 Created global option to disable presenter console in Impress Changes made are as Follows /officecfg/registry/schema/org/openoffice/Office/Impress.xcs To add the new global checkbox to Libreoffice Impress>General>Start A new xml block for EnablePresenterScreen was added /sd/source/ui/app/optsitem.cxx To add the setter/getter for the new checkbox button, namely: SetEnablePresenterScreen IsEnablePresenterScreen EnablePresenterScreen added to index number 26 of: GetPropNameArray() /sd/source/ui/dlg/tpoption.cxx SdTpOptionsMisc() editted to attach EnablePresenterScreen to CBX_ENABLE_PRESENTER_SCREEN aCbxEnablePresenterScreen ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN)) Also Added to FillItemSet() and Reset() functions /sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src enableSdRemote size changed to Size = MAP_APPFONT ( 116 , 10 ) ; Pos = MAP_APPFONT ( 12 , 171 ) ; 158 was correct but 171 was added on request To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresenterScreen( CBX_ENABLE_PRESENTER_SCREEN) to be drawn adjacent. enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN added /sd/source/ui/inc/optsitem.hxx Set default value for enablePresenterScreen as 1 or TRUE sal_Bool bEnablePresenterScreen : 1; Added getter/setter named same as above for interface definition sd/source/ui/inc/tpoption.hrc Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox #define CBX_ENABLE_PRESENTER_SCREEN 42 /sd/source/ui/inc/tpoption.hxx Added interface declaration of aCbxEnablePresenterScreen which was attached to CBX_ENABLE_PRESENTER_SCREEN /sdext/source/presenter/PresenterScreen.hxx Added interface declaration of bool isPresenterScreenEnabled() to PresenterScreen class to allow presenterscreen to get if the option is checked /sdext/source/presenter/PresenterScreen.cxx Added definition of isPresenterScreenEnabled(const css::uno::Reference& rxContext) Input : Current Process Context Output : The 0/1 value of EnablePresenterScreen from presenterconfig In PresenterScreenListener::notifyEvent( ) Added if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext) mpPresenterScreen->InitializePresenterScreen() To initialize PresenterScreen only when enabled Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f Reviewed-on: https://gerrit.libreoffice.org/3762 Tested-by: LibreOffice gerrit bot Reviewed-by: Norbert Thiebaud Tested-by: Norbert Thiebaud --- sdext/source/presenter/PresenterScreen.cxx | 14 +++++++++++++- sdext/source/presenter/PresenterScreen.hxx | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'sdext/source') diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 8fe7fcebaf8f..f361912f3882 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -220,7 +220,8 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb if ( Event.EventName == "OnStartPresentation" ) { mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel); - mpPresenterScreen->InitializePresenterScreen(); + if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext)) + mpPresenterScreen->InitializePresenterScreen(); } else if ( Event.EventName == "OnEndPresentation" ) { @@ -286,6 +287,17 @@ PresenterScreen::~PresenterScreen (void) { } +bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference& rxContext) +{ + bool dEnablePresenterScreen=true; + PresenterConfigurationAccess aConfiguration ( + rxContext, + OUString("/org.openoffice.Office.Impress/"), + PresenterConfigurationAccess::READ_ONLY); + aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen") + >>= dEnablePresenterScreen; + return dEnablePresenterScreen; +} void SAL_CALL PresenterScreen::disposing (void) { Reference xCC (mxConfigurationControllerWeak); diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx index 1647f84b99d7..c97447db4315 100644 --- a/sdext/source/presenter/PresenterScreen.hxx +++ b/sdext/source/presenter/PresenterScreen.hxx @@ -109,6 +109,8 @@ public: virtual void SAL_CALL disposing (void); + bool isPresenterScreenEnabled( + const css::uno::Reference& rxContext); /** Make the presenter screen visible. */ void InitializePresenterScreen (void); -- cgit