diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-23 10:07:21 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-24 12:51:03 +0000 |
commit | 9ff8c95e54bed9ffd6ae4636c9e8385ad3160643 (patch) | |
tree | 5bb0b4192f0b550723ad5fe5b7eabbd26040bdeb /svtools | |
parent | 1520d59850f027bace775e6055bb4632667573c3 (diff) |
Convert SnapType to scoped enum
Change-Id: I3980c2999bab191bb9357c883868db17db79e81f
Reviewed-on: https://gerrit.libreoffice.org/25353
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/config/apearcfg.cxx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index dffd584c2d23..19f16b4ce322 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -26,7 +26,7 @@ #include <sal/macros.h> #define DEFAULT_DRAGMODE DragMode::SystemDep -#define DEFAULT_SNAPMODE 0 +#define DEFAULT_SNAPMODE SnapType::ToButton #define DEFAULT_SCALEFACTOR 100 #if defined UNX #define DEFAULT_AAMINHEIGHT 8 @@ -72,7 +72,13 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() break; } case 2: bMenuMouseFollow = *static_cast<sal_Bool const *>(pValues->getValue()); break; //"Menu/FollowMouse", - case 3: *pValues >>= nSnapMode; break; //"Dialog/MousePositioning", + case 3: + { + short nTmp; + if (*pValues >>= nTmp) + nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning", + break; + } case 4: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton", #if defined( UNX ) case 5: bFontAntialiasing = *static_cast<sal_Bool const *>(pValues->getValue()); break; // "FontAntialising/Enabled", @@ -127,9 +133,9 @@ void SvtTabAppearanceCfg::ImplCommit() switch(nProp) { case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling", - case 1: pValues[nProp] <<= (short)nDragMode; break; //"Window/Drag", - case 2: pValues[nProp] <<= bMenuMouseFollow; break; //"Menu/FollowMouse", - case 3: pValues[nProp] <<= nSnapMode; break; //"Dialog/MousePositioning", + case 1: pValues[nProp] <<= (short)nDragMode; break; //"Window/Drag", + case 2: pValues[nProp] <<= bMenuMouseFollow; break; //"Menu/FollowMouse", + case 3: pValues[nProp] <<= (short)nSnapMode; break; //"Dialog/MousePositioning", case 4: pValues[nProp] <<= static_cast<short>(nMiddleMouse); break; //"Dialog/MiddleMouseButton", #if defined( UNX ) case 5: pValues[nProp] <<= bFontAntialiasing; break; // "FontAntialising/Enabled", @@ -150,7 +156,7 @@ void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet ) SetModified(); } -void SvtTabAppearanceCfg::SetSnapMode ( sal_uInt16 nSet ) +void SvtTabAppearanceCfg::SetSnapMode ( SnapType nSet ) { nSnapMode = nSet; SetModified(); @@ -196,13 +202,13 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp ) switch ( nSnapMode ) { - case SnapToButton: + case SnapType::ToButton: nMouseOptions |= MouseSettingsOptions::AutoDefBtnPos; break; - case SnapToMiddle: + case SnapType::ToMiddle: nMouseOptions |= MouseSettingsOptions::AutoCenterPos; break; - case NoSnap: + case SnapType::NONE: default: break; } |