summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-07-03 19:00:59 +0300
committerParis Oplopoios <parisoplop@gmail.com>2023-07-04 22:12:16 +0200
commit884fd220d0025a92510d3ff4710c8c517c8f271e (patch)
tree83fe21cd28d1c98b3355097bc53bae9d6f8d73ca /sd
parente53be4d13c4a328eb4ee0ceb937e4b272ecbde7c (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>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/ViewShellBase.hxx2
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx12
2 files changed, 14 insertions, 0 deletions
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index aa0346ea5b2f..71522c7892d4 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -223,6 +223,8 @@ public:
void NotifyCursor(SfxViewShell* pViewShell) const override;
/// See SfxViewShell::GetColorConfigColor().
::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override;
+ /// See SfxViewShell::GetColorConfigName().
+ OUString GetColorConfigName() const override;
void setLOKVisibleArea(const ::tools::Rectangle& rArea) { maLOKVisibleArea = rArea; }
virtual ::tools::Rectangle getLOKVisibleArea() const override { return maLOKVisibleArea; }
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 834e1d6cc3e2..19be45aaca12 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1091,6 +1091,18 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const
return {};
}
+OUString ViewShellBase::GetColorConfigName() const
+{
+ if (DrawViewShell* pCurrentDrawShell = dynamic_cast<DrawViewShell*>(GetMainViewShell().get()))
+ {
+ const SdViewOptions& rViewOptions = pCurrentDrawShell->GetViewOptions();
+ return rViewOptions.msColorSchemeName;
+ }
+
+ SAL_WARN("sd", "dynamic_cast to DrawViewShell failed");
+ return {};
+}
+
//===== ViewShellBase::Implementation =========================================
ViewShellBase::Implementation::Implementation (ViewShellBase& rBase)