From 89c24a380a8fb5dd94ba595ce421abafa9004b9a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 14 Feb 2017 14:46:58 +0200 Subject: convert SvxIconChoiceCtrlPositionMode to scoped enum and drop unused AutoAdjust enumerator Change-Id: Ie900f89241947cb93a16f0223071846fecfef09c --- compilerplugins/clang/unusedenumconstants.py | 1 + include/svtools/ivctrl.hxx | 7 +++---- svtools/source/contnr/imivctl.hxx | 2 +- svtools/source/contnr/imivctl1.cxx | 10 +++------- svtools/source/contnr/ivctrl.cxx | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py index 3cc97382d6b5..660d35284f63 100755 --- a/compilerplugins/clang/unusedenumconstants.py +++ b/compilerplugins/clang/unusedenumconstants.py @@ -109,6 +109,7 @@ for d in definitionSet: "include/tools/fontenum.hxx", # part of GDI file format "svx/inc/galobj.hxx", # GalSoundType "include/svx/msdffdef.hxx", + "include/svtools/rtftoken.h", # RTF_TOKEN_IDS # unit test code "cppu/source/uno/check.cxx", # general weird nonsense going on diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx index 2b975084d3f1..ec1d0cfdfcb7 100644 --- a/include/svtools/ivctrl.hxx +++ b/include/svtools/ivctrl.hxx @@ -56,11 +56,10 @@ enum SvxIconChoiceCtrlTextMode IcnShowTextDontKnow // Settings of the View }; -enum SvxIconChoiceCtrlPositionMode +enum class SvxIconChoiceCtrlPositionMode { - IcnViewPositionModeFree = 0, // Free pixel-perfekt positioning - IcnViewPositionModeAutoArrange = 1, // Auto arrange - IcnViewPositionModeAutoAdjust = 2 // Auto adjust + Free, // Free pixel-perfekt positioning + AutoArrange, // Auto arrange }; class SvxIconChoiceCtrlEntry diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index b9b79754db23..444a37a2f937 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -294,7 +294,7 @@ class SvxIconChoiceCtrl_Impl void SetDefaultTextSize(); bool IsAutoArrange() const { - return (ePositionMode == IcnViewPositionModeAutoArrange); + return (ePositionMode == SvxIconChoiceCtrlPositionMode::AutoArrange); } void DocRectChanged() { aDocRectChangedIdle.Start(); } void VisRectChanged() { aVisRectChangedIdle.Start(); } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index f1454f591480..9069a1fd56de 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -118,7 +118,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( eSelectionMode = SelectionMode::Multiple; pView = pCurView; pZOrderList = new SvxIconChoiceCtrlEntryList_impl(); - ePositionMode = IcnViewPositionModeFree; + ePositionMode = SvxIconChoiceCtrlPositionMode::Free; SetStyle( nWinStyle ); nFlags = IconChoiceFlags::NONE; nUserEventAdjustScrBars = nullptr; @@ -3232,7 +3232,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod ePositionMode = eMode; size_t nCount = aEntries.size(); - if( eOldMode == IcnViewPositionModeAutoArrange ) + if( eOldMode == SvxIconChoiceCtrlPositionMode::AutoArrange ) { // when positioning moved entries "hard", there are problems with // unwanted overlaps, as these entries aren't taken into account in @@ -3242,7 +3242,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod return; } - if( ePositionMode == IcnViewPositionModeAutoArrange ) + if( ePositionMode == SvxIconChoiceCtrlPositionMode::AutoArrange ) { for( size_t nCur = 0; nCur < nCount; nCur++ ) { @@ -3254,10 +3254,6 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod if( aEntries.size() ) aAutoArrangeIdle.Start(); } - else if( ePositionMode == IcnViewPositionModeAutoAdjust ) - { - AdjustEntryAtGrid(); - } } void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 198184505a1e..b93f1cf105d1 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -75,7 +75,7 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, WinBits nWinStyle ) { SetLineColor(); _pImpl->InitSettings(); - _pImpl->SetPositionMode( IcnViewPositionModeAutoArrange ); + _pImpl->SetPositionMode( SvxIconChoiceCtrlPositionMode::AutoArrange ); } SvtIconChoiceCtrl::~SvtIconChoiceCtrl() -- cgit