diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-27 11:54:28 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-27 22:30:54 +0200 |
commit | 8eb05127e8ffcbe4a6bd6eb10b073d015cea34aa (patch) | |
tree | 5f99923f170e9e1f6a92d2b27d3242b79f23ecb5 /include | |
parent | 7b72143ef48df465fb25370ccb680c4601585730 (diff) |
Resolves: tdf#109289 add SvxColorListBox::IsValueChangedFromSaved
and remove PushButton::IsValueChangedFromSaved
Change-Id: Ib1c51e27fd708c5d4811c90ef5659b4d55dd8860
(cherry picked from commit 39fd7e97c253153a10161ef3694b64e90e65e80a)
Related: tdf#109289 move PushButton::IsValueChangedFromSaved to consumer
inheriting the IsValueChangedFromSaved from PushButton has allowed
undesirable behaviour to be selected
Change-Id: Ifccb1657d2565005e6f9e239c6118f2e5ae7970c
(cherry picked from commit 247607727986df0fd0fef198459eb6646e056ea3)
Reviewed-on: https://gerrit.libreoffice.org/40484
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/colorbox.hxx | 8 | ||||
-rw-r--r-- | include/vcl/button.hxx | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx index a813d545fb01..e2cb74962aad 100644 --- a/include/svx/colorbox.hxx +++ b/include/svx/colorbox.hxx @@ -35,6 +35,7 @@ private: Link<SvxColorListBox&, void> m_aSelectedLink; SvxListBoxColorWrapper m_aColorWrapper; Color m_aAutoDisplayColor; + Color m_aSaveColor; NamedColor m_aSelectedColor; sal_uInt16 m_nSlotId; bool m_bShowNoneButton; @@ -58,8 +59,8 @@ public: void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false); - NamedColor GetSelectEntry() const; - Color GetSelectEntryColor() const; + Color GetSelectEntryColor() const { return m_aSelectedColor.first; } + NamedColor GetSelectEntry() const { return m_aSelectedColor; } void SelectEntry(const NamedColor& rColor); void SelectEntry(const Color& rColor); @@ -70,6 +71,9 @@ public: void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; } void ShowPreview(const NamedColor &rColor); void EnsurePaletteManager(); + + void SaveValue() { m_aSaveColor = GetSelectEntryColor(); } + bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); } }; /** A wrapper for SvxColorListBox. */ diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index c1e433edae14..96689dd04876 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -157,9 +157,6 @@ public: void EndSelection(); - void SaveValue() { meSaveValue = GetState(); } - bool IsValueChangedFromSaved() const { return meSaveValue != GetState(); } - Size CalcMinimumSize() const; virtual Size GetOptimalSize() const override; @@ -200,7 +197,6 @@ protected: private: SymbolType meSymbol; TriState meState; - TriState meSaveValue; bool mbPressed; }; |