summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_para.cpp
diff options
context:
space:
mode:
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);
+}