summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.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_widgetacc.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_widgetacc.cpp')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp
index 76b4f46e20..63f59dcc28 100644
--- a/xfa/fxfa/cxfa_widgetacc.cpp
+++ b/xfa/fxfa/cxfa_widgetacc.cpp
@@ -25,6 +25,7 @@
#include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
#include "xfa/fxfa/parser/cxfa_localevalue.h"
#include "xfa/fxfa/parser/cxfa_node.h"
+#include "xfa/fxfa/parser/cxfa_para.h"
#include "xfa/fxfa/parser/cxfa_script.h"
#include "xfa/fxfa/parser/cxfa_validate.h"
#include "xfa/fxfa/parser/cxfa_value.h"
@@ -772,9 +773,9 @@ bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
size.height += marginData.GetTopInset() + marginData.GetBottomInset();
}
- CXFA_ParaData paraData = GetParaData();
- if (paraData.HasValidNode())
- size.width += paraData.GetMarginLeft() + paraData.GetTextIndent();
+ CXFA_Para* para = GetPara();
+ if (para)
+ size.width += para->GetMarginLeft() + para->GetTextIndent();
pdfium::Optional<float> width = TryWidth();
if (width) {
@@ -1231,12 +1232,12 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) {
if (fHeight > 0.1f && iBlockIndex == 0) {
fStartOffset = fTopInset;
fHeight -= (fTopInset + fBottomInset);
- CXFA_ParaData paraData = GetParaData();
- if (paraData.HasValidNode()) {
- fSpaceAbove = paraData.GetSpaceAbove();
- float fSpaceBelow = paraData.GetSpaceBelow();
+ CXFA_Para* para = GetPara();
+ if (para) {
+ fSpaceAbove = para->GetSpaceAbove();
+ float fSpaceBelow = para->GetSpaceBelow();
fHeight -= (fSpaceAbove + fSpaceBelow);
- switch (paraData.GetVerticalAlign()) {
+ switch (para->GetVerticalAlign()) {
case XFA_AttributeEnum::Top:
fStartOffset += fSpaceAbove;
break;
@@ -1503,9 +1504,9 @@ float CXFA_WidgetAcc::GetFontSize() {
float CXFA_WidgetAcc::GetLineHeight() {
float fLineHeight = 0;
- CXFA_ParaData paraData = GetParaData();
- if (paraData.HasValidNode())
- fLineHeight = paraData.GetLineHeight();
+ CXFA_Para* para = GetPara();
+ if (para)
+ fLineHeight = para->GetLineHeight();
if (fLineHeight < 1)
fLineHeight = GetFontSize() * 1.2f;
return fLineHeight;