diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-08 12:26:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-08 17:31:12 +0200 |
commit | 8bc7a39223ba55efa6453d540b1d5e6ff52e51ee (patch) | |
tree | dd5cf9c2a969f81d1f04f6df1dd33c0bdfd24792 /cui | |
parent | 922f3d2f10746ab25deeb5ea4ae78795524e6744 (diff) |
merge duplicated TriStateEnabled class
Change-Id: I1c10010eb7fd33a03f477af0cba03ae74859b174
Reviewed-on: https://gerrit.libreoffice.org/71959
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/paragrph.hxx | 28 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 20 |
2 files changed, 8 insertions, 40 deletions
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index e9de90c4131e..572a8af058b6 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -182,18 +182,6 @@ public: virtual void PageCreated(const SfxAllItemSet& aSet) override; }; -struct TriStateEnabled -{ - TriState eState; - bool bTriStateEnabled; - TriStateEnabled() - : eState(TRISTATE_INDET) - , bTriStateEnabled(true) - { - } - void ButtonToggled(weld::ToggleButton& rToggle); -}; - // class SvxExtParagraphTabPage ------------------------------------------ /* [Description] @@ -233,14 +221,14 @@ protected: private: SvxExtParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); - TriStateEnabled aHyphenState; - TriStateEnabled aPageBreakState; - TriStateEnabled aApplyCollState; - TriStateEnabled aPageNumState; - TriStateEnabled aKeepTogetherState; - TriStateEnabled aKeepParaState; - TriStateEnabled aOrphanState; - TriStateEnabled aWidowState; + weld::TriStateEnabled aHyphenState; + weld::TriStateEnabled aPageBreakState; + weld::TriStateEnabled aApplyCollState; + weld::TriStateEnabled aPageNumState; + weld::TriStateEnabled aKeepTogetherState; + weld::TriStateEnabled aKeepParaState; + weld::TriStateEnabled aOrphanState; + weld::TriStateEnabled aWidowState; bool bPageBreak; bool bHtmlMode; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index caa7a97b33c3..6c8cf7293f26 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -2065,26 +2065,6 @@ IMPL_LINK(SvxExtParagraphTabPage, WidowHdl_Impl, weld::ToggleButton&, rToggle, v WidowHdl(); } -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(SvxExtParagraphTabPage, OrphanHdl_Impl, weld::ToggleButton&, rToggle, void) { aOrphanState.ButtonToggled(rToggle); |