summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-09 16:59:12 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-13 14:46:37 +0000
commit9e9bab6fe80b41f18c45f52db7ad61503124cbf8 (patch)
tree6f2d635e89b3309c6d21ae464259f834b4faf9f5 /xfa/fde
parent1c97fd137e03a22c69be6d0162197e2add6b81e0 (diff)
downloadpdfium-9e9bab6fe80b41f18c45f52db7ad61503124cbf8.tar.xz
Cleanup TXTLINEALIGNMENT defines
This Cl replaces the FX_TXTLINEALIGNMENT_ defines with an enum and cleans up various usages. Change-Id: I5ff20f046322e5cd39a7d2abbd8735eac81e8c69 Reviewed-on: https://pdfium-review.googlesource.com/2941 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde')
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp36
-rw-r--r--xfa/fde/tto/fde_textout.cpp6
2 files changed, 20 insertions, 22 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index fbc5e159ed..9d9fed5ab1 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -1001,20 +1001,19 @@ void CFDE_TxtEdtEngine::UpdatePages() {
void CFDE_TxtEdtEngine::UpdateTxtBreak() {
uint32_t dwStyle = m_pTextBreak->GetLayoutStyles();
- if (m_Param.dwMode & FDE_TEXTEDITMODE_MultiLines) {
+ if (m_Param.dwMode & FDE_TEXTEDITMODE_MultiLines)
dwStyle &= ~FX_TXTLAYOUTSTYLE_SingleLine;
- } else {
+ else
dwStyle |= FX_TXTLAYOUTSTYLE_SingleLine;
- }
+
dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalLayout;
dwStyle &= ~FX_TXTLAYOUTSTYLE_ReverseLine;
dwStyle &= ~FX_TXTLAYOUTSTYLE_RTLReadingOrder;
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) {
+ if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText)
dwStyle |= FX_TXTLAYOUTSTYLE_CombText;
- } else {
+ else
dwStyle &= ~FX_TXTLAYOUTSTYLE_CombText;
- }
dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalChars;
dwStyle &= ~FX_TXTLAYOUTSTYLE_ExpandTab;
@@ -1023,28 +1022,27 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() {
m_pTextBreak->SetLayoutStyles(dwStyle);
uint32_t dwAligment = 0;
- if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Justified) {
- dwAligment |= FX_TXTLINEALIGNMENT_Justified;
- }
- if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Center) {
- dwAligment |= FX_TXTLINEALIGNMENT_Center;
- } else if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Right) {
- dwAligment |= FX_TXTLINEALIGNMENT_Right;
- }
+ if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Justified)
+ dwAligment |= CFX_TxtLineAlignment_Justified;
+
+ if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Center)
+ dwAligment |= CFX_TxtLineAlignment_Center;
+ else if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Right)
+ dwAligment |= CFX_TxtLineAlignment_Right;
+
m_pTextBreak->SetAlignment(dwAligment);
- if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
+ if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap)
m_pTextBreak->SetLineWidth(m_Param.fPlateWidth);
- } else {
+ else
m_pTextBreak->SetLineWidth(kPageWidthMax);
- }
m_nPageLineCount = m_Param.nLineCount;
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) {
FX_FLOAT fCombWidth = m_Param.fPlateWidth;
- if (m_nLimit > 0) {
+ if (m_nLimit > 0)
fCombWidth /= m_nLimit;
- }
+
m_pTextBreak->SetCombWidth(fCombWidth);
}
m_pTextBreak->SetFont(m_Param.pFont);
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index 93be50d34a..0a92bd53d7 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -107,15 +107,15 @@ void CFDE_TextOut::SetAlignment(int32_t iAlignment) {
case FDE_TTOALIGNMENT_TopCenter:
case FDE_TTOALIGNMENT_Center:
case FDE_TTOALIGNMENT_BottomCenter:
- m_iTxtBkAlignment = FX_TXTLINEALIGNMENT_Center;
+ m_iTxtBkAlignment = CFX_TxtLineAlignment_Center;
break;
case FDE_TTOALIGNMENT_TopRight:
case FDE_TTOALIGNMENT_CenterRight:
case FDE_TTOALIGNMENT_BottomRight:
- m_iTxtBkAlignment = FX_TXTLINEALIGNMENT_Right;
+ m_iTxtBkAlignment = CFX_TxtLineAlignment_Right;
break;
default:
- m_iTxtBkAlignment = FX_TXTLINEALIGNMENT_Left;
+ m_iTxtBkAlignment = CFX_TxtLineAlignment_Left;
break;
}
m_pTxtBreak->SetAlignment(m_iTxtBkAlignment);