summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_para.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/parser/cxfa_para.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/parser/cxfa_para.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_para.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp
index fa91eb6a3d..ad7190dd1f 100644
--- a/xfa/fxfa/parser/cxfa_para.cpp
+++ b/xfa/fxfa/parser/cxfa_para.cpp
@@ -8,6 +8,7 @@
#include "fxjs/xfa/cjx_para.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fxfa/parser/cxfa_measurement.h"
namespace {
@@ -52,3 +53,41 @@ CXFA_Para::CXFA_Para(CXFA_Document* doc, XFA_PacketType packet)
pdfium::MakeUnique<CJX_Para>(this)) {}
CXFA_Para::~CXFA_Para() {}
+
+XFA_AttributeEnum CXFA_Para::GetHorizontalAlign() {
+ return JSObject()
+ ->TryEnum(XFA_Attribute::HAlign, true)
+ .value_or(XFA_AttributeEnum::Left);
+}
+
+XFA_AttributeEnum CXFA_Para::GetVerticalAlign() {
+ return JSObject()
+ ->TryEnum(XFA_Attribute::VAlign, true)
+ .value_or(XFA_AttributeEnum::Top);
+}
+
+float CXFA_Para::GetLineHeight() {
+ return JSObject()->GetMeasure(XFA_Attribute::LineHeight).ToUnit(XFA_Unit::Pt);
+}
+
+float CXFA_Para::GetMarginLeft() {
+ return JSObject()->GetMeasure(XFA_Attribute::MarginLeft).ToUnit(XFA_Unit::Pt);
+}
+
+float CXFA_Para::GetMarginRight() {
+ return JSObject()
+ ->GetMeasure(XFA_Attribute::MarginRight)
+ .ToUnit(XFA_Unit::Pt);
+}
+
+float CXFA_Para::GetSpaceAbove() {
+ return JSObject()->GetMeasure(XFA_Attribute::SpaceAbove).ToUnit(XFA_Unit::Pt);
+}
+
+float CXFA_Para::GetSpaceBelow() {
+ return JSObject()->GetMeasure(XFA_Attribute::SpaceBelow).ToUnit(XFA_Unit::Pt);
+}
+
+float CXFA_Para::GetTextIndent() {
+ return JSObject()->GetMeasure(XFA_Attribute::TextIndent).ToUnit(XFA_Unit::Pt);
+}