[Libreoffice-commits] core.git: sd/inc sd/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 1 09:34:29 UTC 2020
sd/inc/sdenumdef.hxx | 3 ++-
sd/source/ui/dlg/dlgsnap.cxx | 6 +++---
sd/source/ui/func/fusnapln.cxx | 6 +++---
3 files changed, 8 insertions(+), 7 deletions(-)
New commits:
commit e73688139b1d861a19bddbf5c2fd82de97d0c741
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Apr 1 09:27:39 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Apr 1 11:33:51 2020 +0200
convert SnapKind to scoped enum
Change-Id: I56a17f582b66212933077a7de62b3dbe7d3c3af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91465
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/inc/sdenumdef.hxx b/sd/inc/sdenumdef.hxx
index cb9f9a8def34..d042c7671f12 100644
--- a/sd/inc/sdenumdef.hxx
+++ b/sd/inc/sdenumdef.hxx
@@ -21,7 +21,8 @@
#define INCLUDED_SD_INC_SDENUMDEF_HXX
#define RET_SNAP_DELETE 111
-enum SnapKind { SK_HORIZONTAL, SK_VERTICAL, SK_POINT };
+
+enum class SnapKind { Horizontal, Vertical, Point };
#endif
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index c07fa83552e4..9657608c23bb 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -119,9 +119,9 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs)
{
SnapKind eKind;
- if (m_xRbHorz->get_active()) eKind = SK_HORIZONTAL;
- else if (m_xRbVert->get_active()) eKind = SK_VERTICAL;
- else eKind = SK_POINT;
+ if (m_xRbHorz->get_active()) eKind = SnapKind::Horizontal;
+ else if (m_xRbVert->get_active()) eKind = SnapKind::Vertical;
+ else eKind = SnapKind::Point;
nXValue = sal_Int32(GetCoreValue(*m_xMtrFldX, MapUnit::Map100thMM) * aUIScale);
nYValue = sal_Int32(GetCoreValue(*m_xMtrFldY, MapUnit::Map100thMM) * aUIScale);
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index bbad6ce82ef7..dbf08f4fbe01 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -172,9 +172,9 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
switch ( static_cast<SnapKind>(static_cast<const SfxUInt16Item&>(
pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue()) )
{
- case SK_HORIZONTAL : eKind = SdrHelpLineKind::Horizontal; break;
- case SK_VERTICAL : eKind = SdrHelpLineKind::Vertical; break;
- default : eKind = SdrHelpLineKind::Point; break;
+ case SnapKind::Horizontal : eKind = SdrHelpLineKind::Horizontal; break;
+ case SnapKind::Vertical : eKind = SdrHelpLineKind::Vertical; break;
+ default : eKind = SdrHelpLineKind::Point; break;
}
pPV->InsertHelpLine(SdrHelpLine(eKind, aHlpPos));
}
More information about the Libreoffice-commits
mailing list