diff options
author | Paris Oplopoios <paris.oplopoios@collabora.com> | 2023-07-03 19:00:59 +0300 |
---|---|---|
committer | Paris Oplopoios <parisoplop@gmail.com> | 2023-07-05 10:17:03 +0200 |
commit | 63d019c6780733018ffc0b157a235cb57893d6d4 (patch) | |
tree | 8517a7dd918939d6cb1dc72de7cf26efc203d98c /sfx2 | |
parent | 1a561775a486b5daf4b04b287dc3849b387ec388 (diff) |
Make sure views get new themes on .uno:ChangeTheme
It would be that sometimes .uno:ChangeTheme would not load the new
scheme because it was using EditableConfig::GetCurrentSchemeName which
uses a static name - normally great except for when you need different
views to have different color schemes in tiled rendering
Change-Id: I5b149bd1a4776337f76753c6de98d5386a899d34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153939
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
(cherry picked from commit 77f5b9259864798b6efc213f6dfa685cd440f71a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154001
Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 2d57c7e562dc..cab9f16c5b8a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -583,10 +583,26 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) SAL_WARN("sfx.appl", "FN_CHANGE_THEME: no theme name"); break; } + const OUString& rSchemeName = pNewThemeArg->GetValue(); svtools::EditableColorConfig aEditableConfig; - if (aEditableConfig.GetCurrentSchemeName() != rSchemeName) - aEditableConfig.LoadScheme(rSchemeName); + + if (comphelper::LibreOfficeKit::isActive()) + { + SfxViewShell* pCurrentShell = SfxViewShell::Current(); + if (pCurrentShell && pCurrentShell->GetColorConfigName() != rSchemeName) + { + aEditableConfig.LoadScheme(rSchemeName); + } + } + else + { + if (aEditableConfig.GetCurrentSchemeName() != rSchemeName) + { + aEditableConfig.LoadScheme(rSchemeName); + } + } + break; } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 0d7d7f14ff99..1a6cc15fc3fc 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2323,6 +2323,12 @@ vcl::Window* SfxViewShell::GetEditWindowForActiveOLEObj() const return {}; } +OUString SfxViewShell::GetColorConfigName() const +{ + SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigName not overriden!"); + return {}; +} + void SfxViewShell::SetLOKLanguageTag(const OUString& rBcp47LanguageTag) { LanguageTag aTag(rBcp47LanguageTag, true); |