Kaydet (Commit) dea2e507 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Michael Stahl

starmath: Convert RectVerAlign to scoped enum

Change-Id: I6c9a7e1527cf2083f567397eb41db7ae3437c25e
Reviewed-on: https://gerrit.libreoffice.org/22141Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 35fe6dfd
...@@ -67,9 +67,17 @@ enum class RectHorAlign ...@@ -67,9 +67,17 @@ enum class RectHorAlign
Center, Center,
Right Right
}; };
enum RectVerAlign
{ RVA_TOP, RVA_MID, RVA_BOTTOM, RVA_BASELINE, RVA_CENTERY, enum class RectVerAlign
RVA_ATTRIBUT_HI, RVA_ATTRIBUT_MID, RVA_ATTRIBUT_LO {
Top,
Mid,
Bottom,
Baseline,
CenterY,
AttributeHi,
AttributeMid,
AttributeLo
}; };
// different methods of copying baselines and mid's in 'ExtendBy' function // different methods of copying baselines and mid's in 'ExtendBy' function
......
This diff is collapsed.
...@@ -334,37 +334,37 @@ const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos, ...@@ -334,37 +334,37 @@ const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos,
if (ePos == RectPos::Left || ePos == RectPos::Right || ePos == RectPos::Attribute) if (ePos == RectPos::Left || ePos == RectPos::Right || ePos == RectPos::Attribute)
// correct error in current vertical position // correct error in current vertical position
switch (eVer) switch (eVer)
{ case RVA_TOP : { case RectVerAlign::Top :
aPos.Y() += rRect.GetAlignT() - GetAlignT(); aPos.Y() += rRect.GetAlignT() - GetAlignT();
break; break;
case RVA_MID : case RectVerAlign::Mid :
aPos.Y() += rRect.GetAlignM() - GetAlignM(); aPos.Y() += rRect.GetAlignM() - GetAlignM();
break; break;
case RVA_BASELINE : case RectVerAlign::Baseline :
// align baselines if possible else align mid's // align baselines if possible else align mid's
if (HasBaseline() && rRect.HasBaseline()) if (HasBaseline() && rRect.HasBaseline())
aPos.Y() += rRect.GetBaseline() - GetBaseline(); aPos.Y() += rRect.GetBaseline() - GetBaseline();
else else
aPos.Y() += rRect.GetAlignM() - GetAlignM(); aPos.Y() += rRect.GetAlignM() - GetAlignM();
break; break;
case RVA_BOTTOM : case RectVerAlign::Bottom :
aPos.Y() += rRect.GetAlignB() - GetAlignB(); aPos.Y() += rRect.GetAlignB() - GetAlignB();
break; break;
case RVA_CENTERY : case RectVerAlign::CenterY :
aPos.Y() += rRect.GetCenterY() - GetCenterY(); aPos.Y() += rRect.GetCenterY() - GetCenterY();
break; break;
case RVA_ATTRIBUT_HI: case RectVerAlign::AttributeHi:
aPos.Y() += rRect.GetHiAttrFence() - GetBottom(); aPos.Y() += rRect.GetHiAttrFence() - GetBottom();
break; break;
case RVA_ATTRIBUT_MID : case RectVerAlign::AttributeMid :
aPos.Y() += SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4) aPos.Y() += SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4)
- GetCenterY(); - GetCenterY();
break; break;
case RVA_ATTRIBUT_LO : case RectVerAlign::AttributeLo :
aPos.Y() += rRect.GetLoAttrFence() - GetTop(); aPos.Y() += rRect.GetLoAttrFence() - GetTop();
break; break;
default : default :
SAL_WARN("starmath", "unknown case"); assert(false);
} }
// check if vertical position is already set // check if vertical position is already set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment