diff options
author | Paris Oplopoios <paris.oplopoios@collabora.com> | 2023-03-16 03:55:34 +0200 |
---|---|---|
committer | Paris Oplopoios <parisoplop@gmail.com> | 2023-03-17 01:58:10 +0000 |
commit | bcc9698ad4f8d49dfdd981e4f4c289cb9a6db87b (patch) | |
tree | abeb388c6022a74a9015e263b3672aa2507bb125 /sfx2 | |
parent | 8ffde7f780e93391064d66abc10f0a235378477c (diff) |
Add uno command that changes the theme
Add an uno command that changes the theme to the one specified in the
first parameter
Change-Id: Ia0fef2ca698415e07f1943cf80ab667fb5c37238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148942
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
(cherry picked from commit fc8681b0a783cb82167c42dc0fb730cf2b619eb9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149023
Tested-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/appslots.sdi | 4 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 14 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 14 |
3 files changed, 32 insertions, 0 deletions
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index daa0a86265e0..429c48332f7f 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -64,6 +64,10 @@ interface Application [ ExecMethod = MiscExec_Impl ; ] + FN_CHANGE_THEME // ole(no) api(final/play/rec) + [ + ExecMethod = MiscExec_Impl ; + ] SID_CONFIG // ole(no) api(final/play/rec) [ ExecMethod = MiscExec_Impl ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index ca9e68894e1f..ea3340c426a3 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5807,3 +5807,17 @@ SfxVoidItem WidgetTestDialog SID_WIDGET_TEST_DIALOG ToolBoxConfig = TRUE, GroupId = SfxGroupId::Application; ] + +SfxVoidItem ChangeTheme FN_CHANGE_THEME +(SfxStringItem NewTheme FN_PARAM_NEW_THEME) +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + GroupId = SfxGroupId::Application; +] diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index ace3a1434a63..f2dfca480c5d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -50,6 +50,7 @@ #include <svtools/addresstemplate.hxx> #include <svtools/restartdialog.hxx> +#include <svtools/colorcfg.hxx> #include <svl/visitem.hxx> #include <unotools/configmgr.hxx> @@ -593,6 +594,19 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) break; } + case FN_CHANGE_THEME: + { + const SfxStringItem* pNewThemeArg = rReq.GetArg<SfxStringItem>(FN_PARAM_NEW_THEME); + if (!pNewThemeArg) + { + SAL_WARN("sfx.appl", "FN_CHANGE_THEME: no theme name"); + break; + } + svtools::EditableColorConfig aEditableConfig; + aEditableConfig.LoadScheme(pNewThemeArg->GetValue()); + break; + } + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_HELPINDEX: { |