summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/cxfa_textparser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-11 16:31:27 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-11 21:45:02 +0000
commit96f482c9cd3c99425fd3422251903b1218253c66 (patch)
tree5d089e55f47ab5e46b993026a5f961b44fed04e9 /xfa/fxfa/app/cxfa_textparser.cpp
parenta63dd01d2fdda06f96e6188dbc3b415447bf2bc9 (diff)
downloadpdfium-96f482c9cd3c99425fd3422251903b1218253c66.tar.xz
Convert FDE CSS enums to enum classes.
This CL updates the possible FDE CSS enums to enum classes and fixes up any instances of incorrect values being used. A few other cleanups and changes were needed to complete the conversion. Change-Id: Ibcca5229a9ca8de1f4beb6462535f61705fd4f8c Reviewed-on: https://pdfium-review.googlesource.com/2170 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/cxfa_textparser.cpp')
-rw-r--r--xfa/fxfa/app/cxfa_textparser.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/xfa/fxfa/app/cxfa_textparser.cpp b/xfa/fxfa/app/cxfa_textparser.cpp
index 50f6cbaea2..ec2b7c3cb0 100644
--- a/xfa/fxfa/app/cxfa_textparser.cpp
+++ b/xfa/fxfa/app/cxfa_textparser.cpp
@@ -75,7 +75,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) {
if (!m_pUASheet) {
m_pUASheet = LoadDefaultSheetStyle();
- m_pSelector->SetStyleSheet(FDE_CSSSTYLESHEETGROUP_UserAgent, m_pUASheet);
+ m_pSelector->SetStyleSheet(FDE_CSSStyleSheetGroup::UserAgent, m_pUASheet);
m_pSelector->UpdateStyleIndex(FDE_CSSMEDIATYPE_ALL);
}
}
@@ -107,42 +107,42 @@ IFDE_CSSComputedStyle* CXFA_TextParser::CreateRootStyle(
if (para) {
fLineHeight = para.GetLineHeight();
FDE_CSSLENGTH indent;
- indent.Set(FDE_CSSLENGTHUNIT_Point, para.GetTextIndent());
+ indent.Set(FDE_CSSLengthUnit::Point, para.GetTextIndent());
pParaStyle->SetTextIndent(indent);
- FDE_CSSTEXTALIGN hAlign = FDE_CSSTEXTALIGN_Left;
+ FDE_CSSTextAlign hAlign = FDE_CSSTextAlign::Left;
switch (para.GetHorizontalAlign()) {
case XFA_ATTRIBUTEENUM_Center:
- hAlign = FDE_CSSTEXTALIGN_Center;
+ hAlign = FDE_CSSTextAlign::Center;
break;
case XFA_ATTRIBUTEENUM_Right:
- hAlign = FDE_CSSTEXTALIGN_Right;
+ hAlign = FDE_CSSTextAlign::Right;
break;
case XFA_ATTRIBUTEENUM_Justify:
- hAlign = FDE_CSSTEXTALIGN_Justify;
+ hAlign = FDE_CSSTextAlign::Justify;
break;
case XFA_ATTRIBUTEENUM_JustifyAll:
- hAlign = FDE_CSSTEXTALIGN_JustifyAll;
+ hAlign = FDE_CSSTextAlign::JustifyAll;
break;
}
pParaStyle->SetTextAlign(hAlign);
FDE_CSSRECT rtMarginWidth;
- rtMarginWidth.left.Set(FDE_CSSLENGTHUNIT_Point, para.GetMarginLeft());
- rtMarginWidth.top.Set(FDE_CSSLENGTHUNIT_Point, para.GetSpaceAbove());
- rtMarginWidth.right.Set(FDE_CSSLENGTHUNIT_Point, para.GetMarginRight());
- rtMarginWidth.bottom.Set(FDE_CSSLENGTHUNIT_Point, para.GetSpaceBelow());
+ rtMarginWidth.left.Set(FDE_CSSLengthUnit::Point, para.GetMarginLeft());
+ rtMarginWidth.top.Set(FDE_CSSLengthUnit::Point, para.GetSpaceAbove());
+ rtMarginWidth.right.Set(FDE_CSSLengthUnit::Point, para.GetMarginRight());
+ rtMarginWidth.bottom.Set(FDE_CSSLengthUnit::Point, para.GetSpaceBelow());
pStyle->GetBoundaryStyles()->SetMarginWidth(rtMarginWidth);
}
if (font) {
pFontStyle->SetColor(font.GetColor());
- pFontStyle->SetFontStyle(font.IsItalic() ? FDE_CSSFONTSTYLE_Italic
- : FDE_CSSFONTSTYLE_Normal);
+ pFontStyle->SetFontStyle(font.IsItalic() ? FDE_CSSFontStyle::Italic
+ : FDE_CSSFontStyle::Normal);
pFontStyle->SetFontWeight(font.IsBold() ? FXFONT_FW_BOLD
: FXFONT_FW_NORMAL);
pParaStyle->SetNumberVerticalAlign(-font.GetBaselineShift());
fFontSize = font.GetFontSize();
FDE_CSSLENGTH letterSpacing;
- letterSpacing.Set(FDE_CSSLENGTHUNIT_Point, font.GetLetterSpacing());
+ letterSpacing.Set(FDE_CSSLengthUnit::Point, font.GetLetterSpacing());
pParaStyle->SetLetterSpacing(letterSpacing);
uint32_t dwDecoration = 0;
if (font.GetLineThrough() > 0)
@@ -170,7 +170,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::CreateStyle(
IFDE_CSSParagraphStyle* pParaStyle = pParentStyle->GetParagraphStyles();
uint32_t dwDecoration = pParaStyle->GetTextDecoration();
FX_FLOAT fBaseLine = 0;
- if (pParaStyle->GetVerticalAlign() == FDE_CSSVERTICALALIGN_Number)
+ if (pParaStyle->GetVerticalAlign() == FDE_CSSVerticalAlign::Number)
fBaseLine = pParaStyle->GetNumberVerticalAlign();
pParaStyle = pNewStyle->GetParagraphStyles();
@@ -240,7 +240,7 @@ void CXFA_TextParser::ParseRichText(CFDE_XMLNode* pXMLNode,
if ((tagProvider.GetTagName() != FX_WSTRC(L"body")) ||
(tagProvider.GetTagName() != FX_WSTRC(L"html"))) {
CXFA_TextParseContext* pTextContext = new CXFA_TextParseContext;
- FDE_CSSDISPLAY eDisplay = FDE_CSSDISPLAY_Inline;
+ FDE_CSSDisplay eDisplay = FDE_CSSDisplay::Inline;
if (!tagProvider.m_bContent) {
pNewStyle = CreateStyle(pParentStyle);
CFDE_CSSAccelerator* pCSSAccel = m_pSelector->InitAccelerator();
@@ -364,7 +364,7 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont(
dwStyle = 0;
if (pFontStyle->GetFontWeight() > FXFONT_FW_NORMAL)
dwStyle |= FX_FONTSTYLE_Bold;
- if (pFontStyle->GetFontStyle() == FDE_CSSFONTSTYLE_Italic)
+ if (pFontStyle->GetFontStyle() == FDE_CSSFontStyle::Italic)
dwStyle |= FX_FONTSTYLE_Italic;
}
@@ -482,7 +482,7 @@ FX_FLOAT CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle) const {
if (pStyle) {
IFDE_CSSParagraphStyle* pParaStyle = pStyle->GetParagraphStyles();
- if (pParaStyle->GetVerticalAlign() == FDE_CSSVERTICALALIGN_Number)
+ if (pParaStyle->GetVerticalAlign() == FDE_CSSVerticalAlign::Number)
return pParaStyle->GetNumberVerticalAlign();
} else if (CXFA_Font font = pTextProvider->GetFontNode()) {
return font.GetBaselineShift();