Presenter console: simplify configuration access (EnablePresenterScreen)
for key officecfg::Office::Impress::Misc::Start::EnablePresenterScreen Change-Id: I635f6ba593ada4fcc4b2f6c4ba66684ddb98f6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198067 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <com/sun/star/document/XEventBroadcaster.hpp>
|
||||
#include <cppuhelper/compbase.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <officecfg/Office/Impress.hxx>
|
||||
#include <officecfg/Office/PresenterScreen.hxx>
|
||||
|
||||
#include <utility>
|
||||
@@ -211,7 +212,7 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb
|
||||
if ( Event.EventName == "OnStartPresentation" )
|
||||
{
|
||||
mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
|
||||
if(PresenterScreen::isPresenterScreenEnabled(mxComponentContext))
|
||||
if ( officecfg::Office::Impress::Misc::Start::EnablePresenterScreen::get() )
|
||||
mpPresenterScreen->InitializePresenterScreen();
|
||||
}
|
||||
else if ( Event.EventName == "OnEndPresentation" )
|
||||
@@ -273,18 +274,6 @@ PresenterScreen::~PresenterScreen()
|
||||
{
|
||||
}
|
||||
|
||||
bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
|
||||
{
|
||||
bool dEnablePresenterScreen=true;
|
||||
PresenterConfigurationAccess aConfiguration (
|
||||
rxContext,
|
||||
u"/org.openoffice.Office.Impress/"_ustr,
|
||||
PresenterConfigurationAccess::READ_ONLY);
|
||||
aConfiguration.GetConfigurationNode(u"Misc/Start/EnablePresenterScreen"_ustr)
|
||||
>>= dEnablePresenterScreen;
|
||||
return dEnablePresenterScreen;
|
||||
}
|
||||
|
||||
bool PresenterScreen::isPresenterScreenFullScreen(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
|
||||
{
|
||||
bool dPresenterScreenFullScreen = true;
|
||||
|
||||
@@ -107,8 +107,6 @@ public:
|
||||
|
||||
virtual void SAL_CALL disposing() override;
|
||||
|
||||
static bool isPresenterScreenEnabled(
|
||||
const css::uno::Reference<css::uno::XComponentContext>& rxContext);
|
||||
static bool isPresenterScreenFullScreen(
|
||||
const css::uno::Reference<css::uno::XComponentContext>& rxContext);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user