summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-28 10:37:00 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-28 19:35:04 +0000
commitd7de8e15eaae5a37abfcb8d1cf7028fbcebbaccd (patch)
tree05017ae10ab82f998aa684c13a6ba11a9d5c69b9 /xfa/fxfa/app
parentfb906e34cb8e0d1030f743939cb1100ebfbcdbf0 (diff)
downloadpdfium-d7de8e15eaae5a37abfcb8d1cf7028fbcebbaccd.tar.xz
Convert FX_RTFLINEALIGNMENT to an enum class
This Cl removes unused items and converts the remaining members to an enum class. Change-Id: I86e95231275ab20f274a5913715c1579a6fbc5dc Reviewed-on: https://pdfium-review.googlesource.com/2875 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/cxfa_textlayout.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fxfa/app/cxfa_textlayout.cpp b/xfa/fxfa/app/cxfa_textlayout.cpp
index a0e7fada82..fe0e249c1f 100644
--- a/xfa/fxfa/app/cxfa_textlayout.cpp
+++ b/xfa/fxfa/app/cxfa_textlayout.cpp
@@ -108,26 +108,26 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) {
FX_FLOAT fStart = 0;
FX_FLOAT fStartPos = 0;
if (para) {
- int32_t iAlign = FX_RTFLINEALIGNMENT_Left;
+ CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left;
switch (para.GetHorizontalAlign()) {
case XFA_ATTRIBUTEENUM_Center:
- iAlign = FX_RTFLINEALIGNMENT_Center;
+ iAlign = CFX_RTFLineAlignment::Center;
break;
case XFA_ATTRIBUTEENUM_Right:
- iAlign = FX_RTFLINEALIGNMENT_Right;
+ iAlign = CFX_RTFLineAlignment::Right;
break;
case XFA_ATTRIBUTEENUM_Justify:
- iAlign = FX_RTFLINEALIGNMENT_Justified;
+ iAlign = CFX_RTFLineAlignment::Justified;
break;
case XFA_ATTRIBUTEENUM_JustifyAll:
- iAlign = FX_RTFLINEALIGNMENT_Distributed;
+ iAlign = CFX_RTFLineAlignment::Distributed;
break;
}
m_pBreak->SetAlignment(iAlign);
fStart = para.GetMarginLeft();
if (m_pTextProvider->IsCheckButtonAndAutoWidth()) {
- if (iAlign != FX_RTFLINEALIGNMENT_Left)
+ if (iAlign != CFX_RTFLineAlignment::Left)
fLineWidth -= para.GetMarginRight();
} else {
fLineWidth -= para.GetMarginRight();
@@ -167,24 +167,25 @@ void CXFA_TextLayout::InitBreak(CFDE_CSSComputedStyle* pStyle,
if (eDisplay == FDE_CSSDisplay::Block ||
eDisplay == FDE_CSSDisplay::ListItem) {
- int32_t iAlign = FX_RTFLINEALIGNMENT_Left;
+ CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left;
switch (pStyle->GetTextAlign()) {
case FDE_CSSTextAlign::Right:
- iAlign = FX_RTFLINEALIGNMENT_Right;
+ iAlign = CFX_RTFLineAlignment::Right;
break;
case FDE_CSSTextAlign::Center:
- iAlign = FX_RTFLINEALIGNMENT_Center;
+ iAlign = CFX_RTFLineAlignment::Center;
break;
case FDE_CSSTextAlign::Justify:
- iAlign = FX_RTFLINEALIGNMENT_Justified;
+ iAlign = CFX_RTFLineAlignment::Justified;
break;
case FDE_CSSTextAlign::JustifyAll:
- iAlign = FX_RTFLINEALIGNMENT_Distributed;
+ iAlign = CFX_RTFLineAlignment::Distributed;
break;
default:
break;
}
m_pBreak->SetAlignment(iAlign);
+
FX_FLOAT fStart = 0;
const FDE_CSSRect* pRect = pStyle->GetMarginWidth();
const FDE_CSSRect* pPaddingRect = pStyle->GetPaddingWidth();