summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2024-01-07 18:31:22 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2024-01-15 21:07:27 +0100
commit035cd913e0361cce9d799eb3b331b6d7bcf7910e (patch)
tree8d3b81d3ec7e5c1258e150b75b598a2cea4e7373 /sc
parentdeec43b36446ac3ac5c77b88bf47e4e0a4ba2057 (diff)
sc: announce theme colors with lok callback
As it is done already for Writer. Unfortunately cannot move the code from afterCallbackRegistered to base class in sfx2 as it is not linked to svx which is needed to generate JSON. So at least share generation and sending part in ThemeColorChangerCommon. Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Icbf681230bd4c49698c47d852a0862620d93bcec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161771 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161927 Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/ThemeColorChanger.hxx2
-rw-r--r--sc/source/ui/theme/ThemeColorChanger.cxx4
-rw-r--r--sc/source/ui/view/tabvwshc.cxx7
3 files changed, 10 insertions, 3 deletions
diff --git a/sc/source/ui/inc/ThemeColorChanger.hxx b/sc/source/ui/inc/ThemeColorChanger.hxx
index 57ca91cdb83c..f85401385888 100644
--- a/sc/source/ui/inc/ThemeColorChanger.hxx
+++ b/sc/source/ui/inc/ThemeColorChanger.hxx
@@ -24,7 +24,7 @@ public:
ThemeColorChanger(ScDocShell& rDocShell);
virtual ~ThemeColorChanger() override;
- void apply(std::shared_ptr<model::ColorSet> const& pColorSet) override;
+ void doApply(std::shared_ptr<model::ColorSet> const& pColorSet) override;
};
} // end sc namespace
diff --git a/sc/source/ui/theme/ThemeColorChanger.cxx b/sc/source/ui/theme/ThemeColorChanger.cxx
index c9b88652dcc3..2ba881544372 100644
--- a/sc/source/ui/theme/ThemeColorChanger.cxx
+++ b/sc/source/ui/theme/ThemeColorChanger.cxx
@@ -19,7 +19,7 @@
#include <editeng/boxitem.hxx>
#include <editeng/borderline.hxx>
#include <svx/svditer.hxx>
-#include <svx/theme/ThemeColorChangerCommon.hxx>
+#include <svx/theme/IThemeColorChanger.hxx>
#include <undodraw.hxx>
#include <stlpool.hxx>
@@ -311,7 +311,7 @@ void changeThemeColorInTheDocModel(ScDocShell& rDocShell,
} // end anonymous ns
-void ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
+void ThemeColorChanger::doApply(std::shared_ptr<model::ColorSet> const& pColorSet)
{
// Can't change to an empty color set
if (!pColorSet)
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 147bf68c4968..3cde75058033 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -20,6 +20,7 @@
#include <scitems.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/dispatch.hxx>
+#include <svx/theme/ThemeColorChangerCommon.hxx>
#include <editeng/editview.hxx>
#include <inputhdl.hxx>
@@ -474,6 +475,12 @@ void ScTabViewShell::afterCallbackRegistered()
pInputWindow->NotifyLOKClient();
}
}
+
+ SfxObjectShell* pDocShell = GetObjectShell();
+ if (pDocShell)
+ {
+ svx::theme::notifyLOK(pDocShell->GetThemeColors());
+ }
}
void ScTabViewShell::NotifyCursor(SfxViewShell* pOtherShell) const