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:
Gabor Kelemen
2026-01-31 23:33:31 +01:00
parent 8215006a9d
commit a2ac0b8a27
2 changed files with 2 additions and 15 deletions
+2 -13
View File
@@ -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;
-2
View File
@@ -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);