blob: c8baf2d05a2360939b21d564610e72f4b3dbd13d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "xfa/fxfa/parser/cxfa_margindata.h"
CXFA_MarginData::CXFA_MarginData(CXFA_Node* pNode) : CXFA_DataData(pNode) {}
float CXFA_MarginData::GetLeftInset() const {
return TryLeftInset().value_or(0);
}
float CXFA_MarginData::GetTopInset() const {
return TryTopInset().value_or(0);
}
float CXFA_MarginData::GetRightInset() const {
return TryRightInset().value_or(0);
}
float CXFA_MarginData::GetBottomInset() const {
return TryBottomInset().value_or(0);
}
pdfium::Optional<float> CXFA_MarginData::TryLeftInset() const {
return TryMeasureAsFloat(XFA_Attribute::LeftInset);
}
pdfium::Optional<float> CXFA_MarginData::TryTopInset() const {
return TryMeasureAsFloat(XFA_Attribute::TopInset);
}
pdfium::Optional<float> CXFA_MarginData::TryRightInset() const {
return TryMeasureAsFloat(XFA_Attribute::RightInset);
}
pdfium::Optional<float> CXFA_MarginData::TryBottomInset() const {
return TryMeasureAsFloat(XFA_Attribute::BottomInset);
}
|