include/svtools/colorcfg.hxx       |    4 ++--
 sc/source/ui/app/scmod.cxx         |    2 +-
 sd/source/ui/view/drviewsk.cxx     |    2 +-
 svtools/source/config/colorcfg.cxx |    5 +++--
 sw/source/uibase/app/apphdl.cxx    |    2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit d7d8c688d7c20ecb49ff5b3577bee3d55b806d3c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jun 6 11:37:44 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jun 6 17:35:10 2023 +0200

    convert ColorConfig to officecfg where possible
    
    Change-Id: I14f0ada21d328b3b6637709e403bfe973a7035b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152670
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index 97193f4e77ef..de16f18eab13 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -98,7 +98,7 @@ struct ColorConfigValue
         { return nColor != rCmp.nColor || bIsVisible != rCmp.bIsVisible;}
 };
 
-class SVT_DLLPUBLIC ColorConfig final :
+class SAL_WARN_UNUSED SVT_DLLPUBLIC ColorConfig final :
     public utl::detail::Options
 {
     friend class ColorConfig_Impl;
@@ -112,7 +112,7 @@ public:
     // instead of the automatic color
     ColorConfigValue        GetColorValue(ColorConfigEntry eEntry, bool bSmart 
= true) const;
     static Color            GetDefaultColor(ColorConfigEntry eEntry);
-    const OUString&         GetCurrentSchemeName() const;
+    static const OUString& GetCurrentSchemeName();
 };
 
 class SVT_DLLPUBLIC EditableColorConfig
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 544d8b80b8ed..a4c3bb4460f0 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -219,7 +219,7 @@ void ScModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* p, Configura
                 ScViewOptions aViewOptions = pViewData.GetOptions();
                 Color 
aFillColor(m_pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor);
                 aViewOptions.SetDocColor(aFillColor);
-                
aViewOptions.SetColorSchemeName(m_pColorConfig->GetCurrentSchemeName());
+                
aViewOptions.SetColorSchemeName(svtools::ColorConfig::GetCurrentSchemeName());
                 pViewData.SetOptions(aViewOptions);
                 ScModelObj* pScModelObj = 
comphelper::getFromUnoTunnel<ScModelObj>(SfxObjectShell::Current()->GetModel());
                 SfxLokHelper::notifyViewRenderState(SfxViewShell::Current(), 
pScModelObj);
diff --git a/sd/source/ui/view/drviewsk.cxx b/sd/source/ui/view/drviewsk.cxx
index 607b59d25111..92a00d5d2ded 100644
--- a/sd/source/ui/view/drviewsk.cxx
+++ b/sd/source/ui/view/drviewsk.cxx
@@ -32,7 +32,7 @@ void DrawViewShell::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pCb, Co
         if (DrawViewShell* pCurrentDrawShell = 
dynamic_cast<DrawViewShell*>(pShellBase->GetMainViewShell().get()))
         {
             pCurrentDrawShell->maViewOptions.mnDocBackgroundColor = 
pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor;
-            pCurrentDrawShell->maViewOptions.msColorSchemeName = 
pColorConfig->GetCurrentSchemeName();
+            pCurrentDrawShell->maViewOptions.msColorSchemeName = 
svtools::ColorConfig::GetCurrentSchemeName();
         }
         SdXImpressDocument* pDoc = 
comphelper::getFromUnoTunnel<SdXImpressDocument>(pCurrentShell->GetCurrentDocument());
         SfxLokHelper::notifyViewRenderState(pCurrentShell, pDoc);
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 80c092d892d2..f2f142071a43 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -40,7 +40,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/event.hxx>
 #include <vcl/settings.hxx>
-
+#include <officecfg/Office/UI.hxx>
 
 using namespace utl;
 using namespace com::sun::star;
@@ -488,8 +488,9 @@ ColorConfigValue 
ColorConfig::GetColorValue(ColorConfigEntry eEntry, bool bSmart
     return aRet;
 }
 
-const OUString& ColorConfig::GetCurrentSchemeName() const
+const OUString& ColorConfig::GetCurrentSchemeName()
 {
+    officecfg::Office::UI::ColorScheme::CurrentColorScheme::get();
     return m_pImpl->GetLoadedScheme();
 }
 
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index dcdb31ae8bc3..674ea0d8b900 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -989,7 +989,7 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
                    dynamic_cast< const SwSrcView *>( pViewShell ) !=  nullptr)
                 {
                     SwViewOption aNewOptions = 
*pSwView->GetWrtShell().GetViewOptions();
-                    
aNewOptions.SetThemeName(m_pColorConfig->GetCurrentSchemeName());
+                    
aNewOptions.SetThemeName(svtools::ColorConfig::GetCurrentSchemeName());
                     SwViewColors aViewColors(*m_pColorConfig);
                     aNewOptions.SetColorConfig(aViewColors);
                     pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);

Reply via email to