diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-08 12:26:39 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-05-09 11:10:15 +0200 |
commit | 70bb74f2ef9bc81aa1141b6ab35ffb2a411bb656 (patch) | |
tree | e8144d403159feeb9c803d32d61e900774a35131 /sc/source | |
parent | 1b2aaed5e60e4e41f1d3475d6229d893d49bbeb7 (diff) |
merge duplicated TriStateEnabled class
Change-Id: I1c10010eb7fd33a03f477af0cba03ae74859b174
Reviewed-on: https://gerrit.libreoffice.org/71999
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/attrdlg/tabpages.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/inc/tabpages.hxx | 20 |
2 files changed, 4 insertions, 36 deletions
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx index 6ce555b62085..8795514813aa 100644 --- a/sc/source/ui/attrdlg/tabpages.cxx +++ b/sc/source/ui/attrdlg/tabpages.cxx @@ -144,26 +144,6 @@ DeactivateRC ScTabPageProtection::DeactivatePage( SfxItemSet* pSetP ) return DeactivateRC::LeavePage; } -void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle) -{ - if (bTriStateEnabled) - { - switch (eState) - { - case TRISTATE_INDET: - rToggle.set_state(TRISTATE_FALSE); - break; - case TRISTATE_TRUE: - rToggle.set_state(TRISTATE_INDET); - break; - case TRISTATE_FALSE: - rToggle.set_state(TRISTATE_TRUE); - break; - } - } - eState = rToggle.get_state(); -} - IMPL_LINK(ScTabPageProtection, ProtectClickHdl, weld::ToggleButton&, rBox, void) { aProtectState.ButtonToggled(rBox); diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx index 5d195bb3cde2..16046ab4f6bc 100644 --- a/sc/source/ui/inc/tabpages.hxx +++ b/sc/source/ui/inc/tabpages.hxx @@ -22,18 +22,6 @@ #include <sfx2/tabdlg.hxx> -struct TriStateEnabled -{ - TriState eState; - bool bTriStateEnabled; - TriStateEnabled() - : eState(TRISTATE_INDET) - , bTriStateEnabled(true) - { - } - void ButtonToggled(weld::ToggleButton& rToggle); -}; - class ScTabPageProtection : public SfxTabPage { friend class VclPtr<ScTabPageProtection>; @@ -62,10 +50,10 @@ private: bool bHideCell; bool bHidePrint; - TriStateEnabled aHideCellState; - TriStateEnabled aProtectState; - TriStateEnabled aHideFormulaState; - TriStateEnabled aHidePrintState; + weld::TriStateEnabled aHideCellState; + weld::TriStateEnabled aProtectState; + weld::TriStateEnabled aHideFormulaState; + weld::TriStateEnabled aHidePrintState; std::unique_ptr<weld::CheckButton> m_xBtnHideCell; std::unique_ptr<weld::CheckButton> m_xBtnProtect; |