From 6e4cba99bb35e6697b94309eedd1a08ebea2dc68 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 5 May 2017 12:07:11 +0900 Subject: starmath: Convert SmHorAlign to scoped enum Change-Id: Ie75749ebbea2ec74e2f16b1c42a55fbcd71845c3 Reviewed-on: https://gerrit.libreoffice.org/37270 Tested-by: Jenkins Reviewed-by: Takeshi Abe --- starmath/inc/format.hxx | 6 +++++- starmath/source/dialog.cxx | 12 ++++++------ starmath/source/format.cxx | 2 +- starmath/source/node.cxx | 6 +++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 7dc1a9c32930..4095500839d4 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -82,7 +82,11 @@ #define DIS_END 23 -enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; +enum class SmHorAlign { + Left, + Center, + Right +}; OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 43141395ddc6..b0252455b2f7 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1044,19 +1044,19 @@ void SmAlignDialog::ReadFrom(const SmFormat &rFormat) { switch (rFormat.GetHorAlign()) { - case AlignLeft: + case SmHorAlign::Left: m_pLeft->Check(); m_pCenter->Check(false); m_pRight->Check(false); break; - case AlignCenter: + case SmHorAlign::Center: m_pLeft->Check(false); m_pCenter->Check(); m_pRight->Check(false); break; - case AlignRight: + case SmHorAlign::Right: m_pLeft->Check(false); m_pCenter->Check(false); m_pRight->Check(); @@ -1068,11 +1068,11 @@ void SmAlignDialog::ReadFrom(const SmFormat &rFormat) void SmAlignDialog::WriteTo(SmFormat &rFormat) const { if (m_pLeft->IsChecked()) - rFormat.SetHorAlign(AlignLeft); + rFormat.SetHorAlign(SmHorAlign::Left); else if (m_pRight->IsChecked()) - rFormat.SetHorAlign(AlignRight); + rFormat.SetHorAlign(SmHorAlign::Right); else - rFormat.SetHorAlign(AlignCenter); + rFormat.SetHorAlign(SmHorAlign::Center); rFormat.RequestApplyChanges(); } diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index b169d24cc090..bd6409688eef 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -89,7 +89,7 @@ OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent ) SmFormat::SmFormat() : aBaseSize(0, SmPtsTo100th_mm(12)) { - eHorAlign = AlignCenter; + eHorAlign = SmHorAlign::Center; nGreekCharStyle = 0; bIsTextmode = bScaleNormalBrackets = false; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 3327d8c57b80..efc13f4483ee 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -226,9 +226,9 @@ void SmNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) mnAttributes = FontAttribute::None; switch (rFormat.GetHorAlign()) - { case AlignLeft: meRectHorAlign = RectHorAlign::Left; break; - case AlignCenter: meRectHorAlign = RectHorAlign::Center; break; - case AlignRight: meRectHorAlign = RectHorAlign::Right; break; + { case SmHorAlign::Left: meRectHorAlign = RectHorAlign::Left; break; + case SmHorAlign::Center: meRectHorAlign = RectHorAlign::Center; break; + case SmHorAlign::Right: meRectHorAlign = RectHorAlign::Right; break; } GetFont() = rFormat.GetFont(FNT_MATH); -- cgit