sd/source/console/PresenterScreen.cxx        |   16 ++------
 sd/source/console/PresenterWindowManager.cxx |   52 +++++++++------------------
 sd/source/console/PresenterWindowManager.hxx |    2 -
 3 files changed, 25 insertions(+), 45 deletions(-)

New commits:
commit 384f2a0f4610b19c2d337595737e80005f1e8e98
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Sun Jan 18 22:12:45 2026 +0100
Commit:     Gabor Kelemen <[email protected]>
CommitDate: Sat Jan 31 19:04:22 2026 +0100

    Presenter console: simplify configuration access (StartAlways)
    
    for key officecfg::Office::PresenterScreen::Presenter::StartAlways
    
    Change-Id: I391ae947aed260eb996144e9a420380fd5fc998f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198066
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <[email protected]>

diff --git a/sd/source/console/PresenterScreen.cxx 
b/sd/source/console/PresenterScreen.cxx
index e82fa3779ef6..33c9e0824c93 100644
--- a/sd/source/console/PresenterScreen.cxx
+++ b/sd/source/console/PresenterScreen.cxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/document/XEventBroadcaster.hpp>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
+#include <officecfg/Office/PresenterScreen.hxx>
 
 #include <utility>
 #include <vcl/svapp.hxx>
@@ -504,18 +505,11 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber (
             // is set or when the presenter screen will be shown as
             // non-full screen window
             Reference<XComponentContext> xContext (mxContextWeak);
-            PresenterConfigurationAccess aConfiguration (
-                xContext,
-                u"/org.openoffice.Office.PresenterScreen/"_ustr,
-                PresenterConfigurationAccess::READ_ONLY);
-            bool bStartAlways (false);
+            bool bStartAlways = 
officecfg::Office::PresenterScreen::Presenter::StartAlways::get().value_or(
+                false);
             bool bPresenterScreenFullScreen = 
isPresenterScreenFullScreen(xContext);
-            if (aConfiguration.GetConfigurationNode(
-                u"Presenter/StartAlways"_ustr) >>= bStartAlways)
-            {
-                if (bStartAlways || !bPresenterScreenFullScreen)
-                    return GetPresenterScreenFromScreen(nScreenNumber);
-            }
+            if (bStartAlways || !bPresenterScreenFullScreen)
+                return GetPresenterScreenFromScreen(nScreenNumber);
             return -1;
         }
     }
commit 7da01c77377d598343e29dacf09e4720b6bd1564
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Sat Jan 17 20:07:57 2026 +0100
Commit:     Gabor Kelemen <[email protected]>
CommitDate: Sat Jan 31 19:04:07 2026 +0100

    Presenter console: simplify configuration access (InitialViewMode)
    
    for key officecfg::Office::PresenterScreen::Presenter::InitialViewMode
    
    Change-Id: I0af8f0193828149abade00af96df0a98de3f8ee7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198065
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <[email protected]>

diff --git a/sd/source/console/PresenterWindowManager.cxx 
b/sd/source/console/PresenterWindowManager.cxx
index 08222efb8415..d4e79e2b7823 100644
--- a/sd/source/console/PresenterWindowManager.cxx
+++ b/sd/source/console/PresenterWindowManager.cxx
@@ -38,6 +38,7 @@
 #include <com/sun/star/rendering/Texture.hpp>
 #include <com/sun/star/rendering/TexturingMode.hpp>
 #include <math.h>
+#include <officecfg/Office/PresenterScreen.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -459,12 +460,8 @@ PresenterWindowManager::ViewMode 
PresenterWindowManager::GetViewMode() const
 
 void PresenterWindowManager::RestoreViewMode()
 {
-    sal_Int32 nMode (0);
-    PresenterConfigurationAccess aConfiguration (
-        mxComponentContext,
-        u"/org.openoffice.Office.PresenterScreen/"_ustr,
-        PresenterConfigurationAccess::READ_ONLY);
-    aConfiguration.GetConfigurationNode(u"Presenter/InitialViewMode"_ustr) >>= 
nMode;
+    sal_Int32 nMode = 
officecfg::Office::PresenterScreen::Presenter::InitialViewMode::get().value_or(
+            0);
     switch (nMode)
     {
         default:
@@ -484,36 +481,25 @@ void PresenterWindowManager::RestoreViewMode()
 
 void PresenterWindowManager::StoreViewMode (const ViewMode eViewMode)
 {
-    try
+    auto xChanges = comphelper::ConfigurationChanges::create();
+    sal_Int32 aValue = 0;
+    switch (eViewMode)
     {
-        PresenterConfigurationAccess aConfiguration (
-            mxComponentContext,
-            u"/org.openoffice.Office.PresenterScreen/"_ustr,
-            PresenterConfigurationAccess::READ_WRITE);
-        aConfiguration.GoToChild(u"Presenter"_ustr);
-        Any aValue;
-        switch (eViewMode)
-        {
-            default:
-            case VM_Standard:
-                aValue <<= sal_Int32(0);
-                break;
-
-            case VM_Notes:
-                aValue <<= sal_Int32(1);
-                break;
-
-            case VM_SlideOverview:
-                aValue <<= sal_Int32(2);
-                break;
-        }
+        default:
+        case VM_Standard:
+            aValue = 0;
+            break;
 
-        aConfiguration.SetProperty (u"InitialViewMode"_ustr, aValue);
-        aConfiguration.CommitChanges();
-    }
-    catch (Exception&)
-    {
+        case VM_Notes:
+            aValue = 1;
+            break;
+
+        case VM_SlideOverview:
+            aValue = 2;
+            break;
     }
+    
officecfg::Office::PresenterScreen::Presenter::InitialViewMode::set(aValue, 
xChanges);
+    xChanges->commit();
 }
 
 void PresenterWindowManager::AddLayoutListener (
diff --git a/sd/source/console/PresenterWindowManager.hxx 
b/sd/source/console/PresenterWindowManager.hxx
index 766958963b3b..068f5aed139c 100644
--- a/sd/source/console/PresenterWindowManager.hxx
+++ b/sd/source/console/PresenterWindowManager.hxx
@@ -175,7 +175,7 @@ private:
     void ProvideBackgroundBitmap();
     css::uno::Reference<css::rendering::XPolyPolygon2D> 
CreateClipPolyPolygon() const;
 
-    void StoreViewMode (const ViewMode eViewMode);
+    static void StoreViewMode (const ViewMode eViewMode);
 
     void LayoutStandardMode();
     void LayoutNotesMode();

Reply via email to