sd/source/console/PresenterScreen.cxx | 24 +++++------------------- sd/source/console/PresenterScreen.hxx | 12 ++++-------- 2 files changed, 9 insertions(+), 27 deletions(-)
New commits: commit eadbdfcb1ac5897f792804dfacbd8f4040028456 Author: Gabor Kelemen <[email protected]> AuthorDate: Sun Jan 18 23:56:12 2026 +0100 Commit: Gabor Kelemen <[email protected]> CommitDate: Sun Feb 1 22:04:41 2026 +0100 Presenter console: simplify configuration access (PresenterScreenFullScreen) for key officecfg::Office::Impress::Misc::Start::PresenterScreenFullScreen Change-Id: I0bb82f799de46398b9ff30d63dde29decfab253f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198068 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <[email protected]> diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index c0857096319f..a23a63faadc9 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -274,18 +274,6 @@ PresenterScreen::~PresenterScreen() { } -bool PresenterScreen::isPresenterScreenFullScreen(const css::uno::Reference<css::uno::XComponentContext>& rxContext) -{ - bool dPresenterScreenFullScreen = true; - PresenterConfigurationAccess aConfiguration ( - rxContext, - u"/org.openoffice.Office.Impress/"_ustr, - PresenterConfigurationAccess::READ_ONLY); - aConfiguration.GetConfigurationNode(u"Misc/Start/PresenterScreenFullScreen"_ustr) - >>= dPresenterScreenFullScreen; - return dPresenterScreenFullScreen; -} - void SAL_CALL PresenterScreen::disposing() { rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); @@ -351,7 +339,7 @@ void PresenterScreen::InitializePresenterScreen() Reference<XComponentContext> xContext(mxContextWeak); rtl::Reference<sd::framework::ResourceId> xMainPaneId( - GetMainPaneId(xPresentation, xContext)); + GetMainPaneId(xPresentation)); // An empty reference means that the presenter screen can // not or must not be displayed. if ( ! xMainPaneId.is()) @@ -448,7 +436,7 @@ void PresenterScreen::CheckNextSlideUpdate(const Reference<drawing::XShape>& rxS * on or -1 to not show anything. */ sal_Int32 PresenterScreen::GetPresenterScreenNumber ( - const Reference<presentation::XPresentation2>& rxPresentation) const + const Reference<presentation::XPresentation2>& rxPresentation) { sal_Int32 nScreenNumber (0); try @@ -493,10 +481,9 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber ( // screen is shown only when a special flag in the configuration // is set or when the presenter screen will be shown as // non-full screen window - Reference<XComponentContext> xContext (mxContextWeak); bool bStartAlways = officecfg::Office::PresenterScreen::Presenter::StartAlways::get().value_or( false); - bool bPresenterScreenFullScreen = isPresenterScreenFullScreen(xContext); + bool bPresenterScreenFullScreen = officecfg::Office::Impress::Misc::Start::PresenterScreenFullScreen::get(); if (bStartAlways || !bPresenterScreenFullScreen) return GetPresenterScreenFromScreen(nScreenNumber); return -1; @@ -540,8 +527,7 @@ sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentation } rtl::Reference<sd::framework::ResourceId> PresenterScreen::GetMainPaneId ( - const Reference<presentation::XPresentation2>& rxPresentation, - const Reference<XComponentContext>& xContext) const + const Reference<presentation::XPresentation2>& rxPresentation) { // A negative value means that the presentation spans all available // displays. That leaves no room for the presenter. @@ -549,7 +535,7 @@ rtl::Reference<sd::framework::ResourceId> PresenterScreen::GetMainPaneId ( if (nScreen < 0) return nullptr; - auto fullScreenStr = isPresenterScreenFullScreen(xContext) + auto fullScreenStr = officecfg::Office::Impress::Misc::Start::PresenterScreenFullScreen::get() ? u"true"_ustr : u"false"_ustr; diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx index 3869f6384758..8fc81bca2e0e 100644 --- a/sd/source/console/PresenterScreen.hxx +++ b/sd/source/console/PresenterScreen.hxx @@ -107,9 +107,6 @@ public: virtual void SAL_CALL disposing() override; - static bool isPresenterScreenFullScreen( - const css::uno::Reference<css::uno::XComponentContext>& rxContext); - /** Make the presenter screen visible. */ void InitializePresenterScreen(); @@ -217,17 +214,16 @@ private: Returns -1 when the presenter screen can or shall not be displayed. */ - sal_Int32 GetPresenterScreenNumber ( - const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; + static sal_Int32 GetPresenterScreenNumber ( + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation); static sal_Int32 GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen ); /** Create a resource id for the full screen background pane so that it is displayed on another screen than the full screen presentation. */ - rtl::Reference<sd::framework::ResourceId> GetMainPaneId ( - const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation, - const css::uno::Reference<css::uno::XComponentContext>& xContext) const; + static rtl::Reference<sd::framework::ResourceId> GetMainPaneId ( + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation); }; }
