diff options
Diffstat (limited to 'xfa/fxfa/parser/cxfa_margin.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_margin.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_margin.cpp b/xfa/fxfa/parser/cxfa_margin.cpp index 6a50d13e4d..6dd4d39ee4 100644 --- a/xfa/fxfa/parser/cxfa_margin.cpp +++ b/xfa/fxfa/parser/cxfa_margin.cpp @@ -39,3 +39,35 @@ CXFA_Margin::CXFA_Margin(CXFA_Document* doc, XFA_PacketType packet) pdfium::MakeUnique<CJX_Margin>(this)) {} CXFA_Margin::~CXFA_Margin() {} + +float CXFA_Margin::GetLeftInset() const { + return TryLeftInset().value_or(0); +} + +float CXFA_Margin::GetTopInset() const { + return TryTopInset().value_or(0); +} + +float CXFA_Margin::GetRightInset() const { + return TryRightInset().value_or(0); +} + +float CXFA_Margin::GetBottomInset() const { + return TryBottomInset().value_or(0); +} + +pdfium::Optional<float> CXFA_Margin::TryLeftInset() const { + return JSObject()->TryMeasureAsFloat(XFA_Attribute::LeftInset); +} + +pdfium::Optional<float> CXFA_Margin::TryTopInset() const { + return JSObject()->TryMeasureAsFloat(XFA_Attribute::TopInset); +} + +pdfium::Optional<float> CXFA_Margin::TryRightInset() const { + return JSObject()->TryMeasureAsFloat(XFA_Attribute::RightInset); +} + +pdfium::Optional<float> CXFA_Margin::TryBottomInset() const { + return JSObject()->TryMeasureAsFloat(XFA_Attribute::BottomInset); +} |