diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-30 22:06:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-30 22:06:40 +0000 |
commit | d02c4d8b1199799340833ebfc79d7092f9b2d043 (patch) | |
tree | 46c5ad3489153bf600529314fdbcf8c772622a24 /xfa/fxfa/cxfa_textlayout.cpp | |
parent | f65f1d398804ec4702a3de691398902a0347461c (diff) | |
download | pdfium-d02c4d8b1199799340833ebfc79d7092f9b2d043.tar.xz |
Rename XFA_ATTRIBUTEENUM to XFA_AttributeEnum enum class
This CL changes the enum XFA_ATTRIBUTEENUM to an enum class
XFA_AttributeEnum. Methods expecting an int32 have been updated to take
or return the XFA_AttrbuteEnum type.
Change-Id: I268453949545fe2dd3eae707be4d9cc7edeff763
Reviewed-on: https://pdfium-review.googlesource.com/20070
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_textlayout.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index e951e3fe3a..ed36426578 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -108,20 +108,20 @@ void CXFA_TextLayout::InitBreak(float fLineWidth) { if (paraData.HasValidNode()) { CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left; switch (paraData.GetHorizontalAlign()) { - case XFA_ATTRIBUTEENUM_Center: + case XFA_AttributeEnum::Center: iAlign = CFX_RTFLineAlignment::Center; break; - case XFA_ATTRIBUTEENUM_Right: + case XFA_AttributeEnum::Right: iAlign = CFX_RTFLineAlignment::Right; break; - case XFA_ATTRIBUTEENUM_Justify: + case XFA_AttributeEnum::Justify: iAlign = CFX_RTFLineAlignment::Justified; break; - case XFA_ATTRIBUTEENUM_JustifyAll: + case XFA_AttributeEnum::JustifyAll: iAlign = CFX_RTFLineAlignment::Distributed; break; - case XFA_ATTRIBUTEENUM_Left: - case XFA_ATTRIBUTEENUM_Radix: + case XFA_AttributeEnum::Left: + case XFA_AttributeEnum::Radix: break; default: NOTREACHED(); @@ -313,10 +313,10 @@ float CXFA_TextLayout::DoLayout(int32_t iBlockIndex, if (iBlockCount == 0 && fHeight > 0) { fHeight = fTextHeight - GetLayoutHeight(); if (fHeight > 0) { - int32_t iAlign = m_textParser.GetVAlign(m_pTextProvider); - if (iAlign == XFA_ATTRIBUTEENUM_Middle) + XFA_AttributeEnum iAlign = m_textParser.GetVAlign(m_pTextProvider); + if (iAlign == XFA_AttributeEnum::Middle) fHeight /= 2.0f; - else if (iAlign != XFA_ATTRIBUTEENUM_Bottom) + else if (iAlign != XFA_AttributeEnum::Bottom) fHeight = 0; m_pLoader->m_fStartLineOffset = fHeight; } @@ -607,10 +607,10 @@ void CXFA_TextLayout::UpdateAlign(float fHeight, float fBottom) { return; switch (m_textParser.GetVAlign(m_pTextProvider)) { - case XFA_ATTRIBUTEENUM_Middle: + case XFA_AttributeEnum::Middle: fHeight /= 2.0f; break; - case XFA_ATTRIBUTEENUM_Bottom: + case XFA_AttributeEnum::Bottom: break; default: return; @@ -659,9 +659,9 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode, fSpaceAbove = 0; switch (paraData.GetVerticalAlign()) { - case XFA_ATTRIBUTEENUM_Top: - case XFA_ATTRIBUTEENUM_Middle: - case XFA_ATTRIBUTEENUM_Bottom: { + case XFA_AttributeEnum::Top: + case XFA_AttributeEnum::Middle: + case XFA_AttributeEnum::Bottom: { fLinePos += fSpaceAbove; break; } @@ -1161,7 +1161,7 @@ void CXFA_TextLayout::RenderPath(CFX_RenderDevice* pDevice, if (iChars > 0) { CFX_PointF pt1, pt2; float fEndY = pCharPos[0].m_Origin.y + 1.05f; - if (pPiece->iPeriod == XFA_ATTRIBUTEENUM_Word) { + if (pPiece->iPeriod == XFA_AttributeEnum::Word) { for (int32_t i = 0; i < pPiece->iUnderline; i++) { for (int32_t j = 0; j < iChars; j++) { pt1.x = pCharPos[j].m_Origin.x; @@ -1194,7 +1194,7 @@ void CXFA_TextLayout::RenderPath(CFX_RenderDevice* pDevice, } } else { if (bNoLineThrough && - (bNoUnderline || pPiece->iPeriod != XFA_ATTRIBUTEENUM_All)) { + (bNoUnderline || pPiece->iPeriod != XFA_AttributeEnum::All)) { return; } int32_t iCharsTmp = 0; |