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
Center,
Right
};
enum RectVerAlign
{ RVA_TOP, RVA_MID, RVA_BOTTOM, RVA_BASELINE, RVA_CENTERY,
RVA_ATTRIBUT_HI, RVA_ATTRIBUT_MID, RVA_ATTRIBUT_LO
enum class RectVerAlign
{
Top,
Mid,
Bottom,
Baseline,
CenterY,
AttributeHi,
AttributeMid,
AttributeLo
};
// 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,
if (ePos == RectPos::Left || ePos == RectPos::Right || ePos == RectPos::Attribute)
// correct error in current vertical position
switch (eVer)
{ case RVA_TOP :
{ case RectVerAlign::Top :
aPos.Y() += rRect.GetAlignT() - GetAlignT();
break;
case RVA_MID :
case RectVerAlign::Mid :
aPos.Y() += rRect.GetAlignM() - GetAlignM();
break;
case RVA_BASELINE :
case RectVerAlign::Baseline :
// align baselines if possible else align mid's
if (HasBaseline() && rRect.HasBaseline())
aPos.Y() += rRect.GetBaseline() - GetBaseline();
else
aPos.Y() += rRect.GetAlignM() - GetAlignM();
break;
case RVA_BOTTOM :
case RectVerAlign::Bottom :
aPos.Y() += rRect.GetAlignB() - GetAlignB();
break;
case RVA_CENTERY :
case RectVerAlign::CenterY :
aPos.Y() += rRect.GetCenterY() - GetCenterY();
break;
case RVA_ATTRIBUT_HI:
case RectVerAlign::AttributeHi:
aPos.Y() += rRect.GetHiAttrFence() - GetBottom();
break;
case RVA_ATTRIBUT_MID :
case RectVerAlign::AttributeMid :
aPos.Y() += SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4)
- GetCenterY();
break;
case RVA_ATTRIBUT_LO :
case RectVerAlign::AttributeLo :
aPos.Y() += rRect.GetLoAttrFence() - GetTop();
break;
default :
SAL_WARN("starmath", "unknown case");
assert(false);
}
// 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