summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-06-06 15:05:18 +0900
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-22 20:59:42 +0200
commit2369ae97cfe868262dd521f350fcd82dc8e91cf1 (patch)
tree633e7801b8d5a0669747380784e9e241c569ba03 /include
parent8395acfec900ea23d25632909eb22e02763bbe37 (diff)
lok: send theme palette after the change in ThemeDialog
For some reason the SdrPage is constructed in Online after every change (cursor, selection) so can't use that to send theme change callback. Instead of that send it after the theme is changed with the ThemeDialog. in addition this requires that we transport model::ColorSet in a shared_ptr more, to prevent doing constant copies. This requires that the IThemeColorChanger interface is changed and the signature of apply() method. Change-Id: Iac951fce57a8e9dff467bd27b2f9c64ec65ea30c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152635 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 6c40e4d1796bcb6418dcb5ec17f46f576c171796) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152728 Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153440
Diffstat (limited to 'include')
-rw-r--r--include/svx/dialog/ThemeDialog.hxx7
-rw-r--r--include/svx/theme/IThemeColorChanger.hxx2
-rw-r--r--include/svx/theme/ThemeColorChanger.hxx2
3 files changed, 4 insertions, 7 deletions
diff --git a/include/svx/dialog/ThemeDialog.hxx b/include/svx/dialog/ThemeDialog.hxx
index d715894f027a..020240c97ca3 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -36,7 +36,7 @@ private:
std::unique_ptr<weld::CustomWeld> mxValueSetThemeColorsWindow;
std::unique_ptr<weld::Button> mxAdd;
- std::optional<std::reference_wrapper<model::ColorSet>> moCurrentColorSet;
+ std::shared_ptr<model::ColorSet> mpCurrentColorSet;
void runThemeColorEditDialog();
void initColorSets();
@@ -49,10 +49,7 @@ public:
DECL_LINK(SelectItem, ValueSet*, void);
DECL_LINK(ButtonClicked, weld::Button&, void);
- std::optional<std::reference_wrapper<model::ColorSet>> const& getCurrentColorSet()
- {
- return moCurrentColorSet;
- }
+ std::shared_ptr<model::ColorSet> const& getCurrentColorSet() { return mpCurrentColorSet; }
};
} // end svx namespace
diff --git a/include/svx/theme/IThemeColorChanger.hxx b/include/svx/theme/IThemeColorChanger.hxx
index 4f10ad15120f..d9273238c712 100644
--- a/include/svx/theme/IThemeColorChanger.hxx
+++ b/include/svx/theme/IThemeColorChanger.hxx
@@ -18,7 +18,7 @@ class SVXCORE_DLLPUBLIC IThemeColorChanger
{
public:
virtual ~IThemeColorChanger() = default;
- virtual void apply(model::ColorSet const& rColorSet) = 0;
+ virtual void apply(std::shared_ptr<model::ColorSet> const& pColorSet) = 0;
};
} // end svx namespace
diff --git a/include/svx/theme/ThemeColorChanger.hxx b/include/svx/theme/ThemeColorChanger.hxx
index 708344fef2b3..8e942ea975ad 100644
--- a/include/svx/theme/ThemeColorChanger.hxx
+++ b/include/svx/theme/ThemeColorChanger.hxx
@@ -31,7 +31,7 @@ public:
ThemeColorChanger(SdrPage* pPage);
virtual ~ThemeColorChanger() override;
- void apply(model::ColorSet const& rColorSet) override;
+ void apply(std::shared_ptr<model::ColorSet> const& pColorSet) override;
};
} // end svx namespace