diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-24 12:25:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-24 12:27:32 +0100 |
commit | 33740b7d5abb8aca34692fbdaa787b26a60652a9 (patch) | |
tree | ad2574a7850e2aa8ac18eaff89f4a85567896692 /include | |
parent | 43d7f4e3640c5e370fd1204739c2b0c7eb5f40e4 (diff) |
Replace exisiting TriState, AutoState with more generic TriState
Change-Id: Ida05478aae5a379775c671e0c2f2851d820d78be
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/controlwrapper.hxx | 12 | ||||
-rw-r--r-- | include/svx/orienthelper.hxx | 8 | ||||
-rw-r--r-- | include/toolkit/controls/unocontrols.hxx | 3 | ||||
-rw-r--r-- | include/tools/gen.hxx | 2 | ||||
-rw-r--r-- | include/tools/wintypes.hxx | 5 | ||||
-rw-r--r-- | include/vcl/button.hxx | 8 | ||||
-rw-r--r-- | include/vcl/settings.hxx | 10 | ||||
-rw-r--r-- | include/vcl/toolbox.hxx | 4 |
8 files changed, 23 insertions, 29 deletions
diff --git a/include/sfx2/controlwrapper.hxx b/include/sfx2/controlwrapper.hxx index f6f647bda225..fcf94f2dec8c 100644 --- a/include/sfx2/controlwrapper.hxx +++ b/include/sfx2/controlwrapper.hxx @@ -153,7 +153,7 @@ public: virtual ~ControlWrapperBase(); /** Derived classes enable, disable, show, or hide control(s). - @descr Will do nothing, if the corresponding parameter is STATE_DONTKNOW. */ + @descr Will do nothing, if the corresponding parameter is TRISTATE_INDET. */ virtual void ModifyControl( TriState eEnable, TriState eShow ) = 0; /** Derived classes return true if the control is in "don't know" state. */ @@ -200,7 +200,7 @@ public: inline ControlT& GetControl() { return mrControl; } /** Enables, disables, shows, or hides the control. - @descr Does nothing, if the corresponding parameter is STATE_DONTKNOW. */ + @descr Does nothing, if the corresponding parameter is TRISTATE_INDET. */ virtual void ModifyControl( TriState eEnable, TriState eShow ); /** Derived classes return the value the control contains. */ @@ -542,10 +542,10 @@ PosT PosValueMapper< PosT, ValueT >::GetPosFromValue( ValueT nValue ) const template< typename ControlT, typename ValueT > inline void SingleControlWrapper< ControlT, ValueT >::ModifyControl( TriState eEnable, TriState eShow ) { - if( eEnable != STATE_DONTKNOW ) - mrControl.Enable( eEnable == STATE_CHECK ); - if( eShow != STATE_DONTKNOW ) - mrControl.Show( eShow == STATE_CHECK ); + if( eEnable != TRISTATE_INDET ) + mrControl.Enable( eEnable == TRISTATE_TRUE ); + if( eShow != TRISTATE_INDET ) + mrControl.Show( eShow == TRISTATE_TRUE ); } // ============================================================================ diff --git a/include/svx/orienthelper.hxx b/include/svx/orienthelper.hxx index a6a52cb7a677..271e87a61d3e 100644 --- a/include/svx/orienthelper.hxx +++ b/include/svx/orienthelper.hxx @@ -65,10 +65,10 @@ public: /** Registers the passed window to be enabled/disabled on call of Enable(). @param eDisableIfStacked - STATE_CHECK: Window always disabled, if stacked text is turned on. - STATE_NOCHECK: Window always disabled, if stacked text is turned off. - STATE_DONTKNOW: Window will be enabled/disabled independent from stacked text. */ - void AddDependentWindow( Window& rWindow, TriState eDisableIfStacked = STATE_DONTKNOW ); + TRISTATE_TRUE: Window always disabled, if stacked text is turned on. + TRISTATE_FALSE: Window always disabled, if stacked text is turned off. + TRISTATE_INDET: Window will be enabled/disabled independent from stacked text. */ + void AddDependentWindow( Window& rWindow, TriState eDisableIfStacked = TRISTATE_INDET ); /** Enables or disables the dial control and all dependent windows. */ void Enable( bool bEnable = true ); diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx index 85bc0fddf879..4d72d61d2b60 100644 --- a/include/toolkit/controls/unocontrols.hxx +++ b/include/toolkit/controls/unocontrols.hxx @@ -48,7 +48,6 @@ #include <toolkit/helper/macros.hxx> #include <toolkit/helper/servicenames.hxx> #include <vcl/bitmapex.hxx> -#include <vcl/settings.hxx> #include <cppuhelper/implbase5.hxx> #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase2.hxx> @@ -1083,7 +1082,7 @@ class UnoDateFieldControl : public UnoSpinFieldControl, private: ::com::sun::star::util::Date mnFirst; ::com::sun::star::util::Date mnLast; - AutoState mbLongFormat; + TriState mbLongFormat; public: UnoDateFieldControl(); OUString GetComponentServiceName(); diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index bc3fb35dd5ab..492a3104d6d6 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -28,6 +28,8 @@ class SvStream; +enum TriState { TRISTATE_FALSE, TRISTATE_TRUE, TRISTATE_INDET }; + // Pair class SAL_WARN_UNUSED Pair diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index be55c19029b7..abba9c63b5c0 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -294,11 +294,6 @@ enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_ IMAGEALIGN_BOTTOM_LEFT, IMAGEALIGN_BOTTOM_RIGHT, IMAGEALIGN_CENTER }; enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT }; -// TriState - -enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW }; - - // ButtonDialog-Types typedef sal_uInt16 StandardButtonType; diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 6c3fe18e8585..1da2e8ce894e 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -196,12 +196,12 @@ public: inline void PushButton::Check( bool bCheck ) { - SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK ); + SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE ); } inline bool PushButton::IsChecked() const { - return (GetState() == STATE_CHECK); + return (GetState() == TRISTATE_TRUE); } // ------------ @@ -504,12 +504,12 @@ public: inline void CheckBox::Check( bool bCheck ) { - SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK ); + SetState( (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE ); } inline bool CheckBox::IsChecked() const { - return (GetState() == STATE_CHECK); + return (GetState() == TRISTATE_TRUE); } // --------------------------------- diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index ee50d38b1ae8..9651d4ddb997 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -235,8 +235,6 @@ struct FrameStyle {} }; -enum AutoState { AUTO_STATE_OFF, AUTO_STATE_ON, AUTO_STATE_AUTO }; - // ----------------- // - ImplStyleData - // ----------------- @@ -340,7 +338,7 @@ private: bool mbHighContrast; bool mbUseSystemUIFonts; sal_uInt16 mnAutoMnemonic; - AutoState mnUseImagesInMenus; + TriState mnUseImagesInMenus; bool mnUseFlatBorders; bool mbPreferredUseImagesInMenus; long mnMinThumbSize; @@ -651,7 +649,7 @@ public: bool GetUseFlatMenus() const { return mpData->mnUseFlatMenus; } void SetUseImagesInMenus( bool bUseImagesInMenus ) - { CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus ? AUTO_STATE_ON : AUTO_STATE_OFF; } + { CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus ? TRISTATE_TRUE : TRISTATE_FALSE; } bool GetUseImagesInMenus() const; void SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus ) { CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; } @@ -958,9 +956,9 @@ public: ImplMiscData( const ImplMiscData& rData ); private: - AutoState mnEnableATT; + TriState mnEnableATT; bool mbEnableLocalizedDecimalSep; - AutoState mnDisablePrinting; + TriState mnDisablePrinting; }; // ---------------- diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 4ca253f9df0b..f0abfe9162e5 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -579,12 +579,12 @@ public: inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck ) { - SetItemState( nItemId, (bCheck) ? STATE_CHECK : STATE_NOCHECK ); + SetItemState( nItemId, (bCheck) ? TRISTATE_TRUE : TRISTATE_FALSE ); } inline bool ToolBox::IsItemChecked( sal_uInt16 nItemId ) const { - return (GetItemState( nItemId ) == STATE_CHECK); + return (GetItemState( nItemId ) == TRISTATE_TRUE); } inline Size ToolBox::CalcWindowSizePixel() const |