summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textlayout.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 21:14:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 21:14:14 +0000
commit9a2c6552460c82417de13e86f07e23dc8c8cef74 (patch)
tree9b1971968c9d371b226457090ab0f73efe45bca4 /xfa/fxfa/cxfa_textlayout.cpp
parent8eb2722e764fff0a39d0d1dc0c59473aa938b31f (diff)
downloadpdfium-9a2c6552460c82417de13e86f07e23dc8c8cef74.tar.xz
Fold CXFA_ParaData into CXFA_Para
This CL removes the CXFA_ParaData wrapper and folds the code into CXFA_Para. Change-Id: I86d139f1df48dcc80d28c7516b1bda95a59e94bd Reviewed-on: https://pdfium-review.googlesource.com/21270 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/cxfa_textlayout.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index 85ec36998b..133f564deb 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -29,7 +29,7 @@
#include "xfa/fxfa/cxfa_textuserdata.h"
#include "xfa/fxfa/parser/cxfa_fontdata.h"
#include "xfa/fxfa/parser/cxfa_node.h"
-#include "xfa/fxfa/parser/cxfa_paradata.h"
+#include "xfa/fxfa/parser/cxfa_para.h"
#define XFA_LOADERCNTXTFLG_FILTERSPACE 0x001
@@ -102,12 +102,12 @@ std::unique_ptr<CFX_RTFBreak> CXFA_TextLayout::CreateBreak(bool bDefault) {
}
void CXFA_TextLayout::InitBreak(float fLineWidth) {
- CXFA_ParaData paraData = m_pTextProvider->GetParaData();
+ CXFA_Para* para = m_pTextProvider->GetPara();
float fStart = 0;
float fStartPos = 0;
- if (paraData.HasValidNode()) {
+ if (para) {
CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left;
- switch (paraData.GetHorizontalAlign()) {
+ switch (para->GetHorizontalAlign()) {
case XFA_AttributeEnum::Center:
iAlign = CFX_RTFLineAlignment::Center;
break;
@@ -129,18 +129,18 @@ void CXFA_TextLayout::InitBreak(float fLineWidth) {
}
m_pBreak->SetAlignment(iAlign);
- fStart = paraData.GetMarginLeft();
+ fStart = para->GetMarginLeft();
if (m_pTextProvider->IsCheckButtonAndAutoWidth()) {
if (iAlign != CFX_RTFLineAlignment::Left)
- fLineWidth -= paraData.GetMarginRight();
+ fLineWidth -= para->GetMarginRight();
} else {
- fLineWidth -= paraData.GetMarginRight();
+ fLineWidth -= para->GetMarginRight();
}
if (fLineWidth < 0)
fLineWidth = fStart;
fStartPos = fStart;
- float fIndent = paraData.GetTextIndent();
+ float fIndent = para->GetTextIndent();
if (fIndent > 0)
fStartPos += fIndent;
}
@@ -651,14 +651,14 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode,
bool bSavePieces) {
InitBreak(textWidth);
- CXFA_ParaData paraData = m_pTextProvider->GetParaData();
+ CXFA_Para* para = m_pTextProvider->GetPara();
float fSpaceAbove = 0;
- if (paraData.HasValidNode()) {
- fSpaceAbove = paraData.GetSpaceAbove();
+ if (para) {
+ fSpaceAbove = para->GetSpaceAbove();
if (fSpaceAbove < 0.1f)
fSpaceAbove = 0;
- switch (paraData.GetVerticalAlign()) {
+ switch (para->GetVerticalAlign()) {
case XFA_AttributeEnum::Top:
case XFA_AttributeEnum::Middle:
case XFA_AttributeEnum::Bottom: {
@@ -1099,14 +1099,14 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
if (dwStatus == CFX_BreakType::Paragraph) {
m_pBreak->Reset();
if (!pStyle && bEndBreak) {
- CXFA_ParaData paraData = m_pTextProvider->GetParaData();
- if (paraData.HasValidNode()) {
- float fStartPos = paraData.GetMarginLeft();
- float fIndent = paraData.GetTextIndent();
+ CXFA_Para* para = m_pTextProvider->GetPara();
+ if (para) {
+ float fStartPos = para->GetMarginLeft();
+ float fIndent = para->GetTextIndent();
if (fIndent > 0)
fStartPos += fIndent;
- float fSpaceBelow = paraData.GetSpaceBelow();
+ float fSpaceBelow = para->GetSpaceBelow();
if (fSpaceBelow < 0.1f)
fSpaceBelow = 0;