summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_margindata.cpp
blob: 4eedaeb7e7e27496388121afeec49e9c6f5fcaf1 (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
42
43
44
45
46
47
48
49
// 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 {
  float left = 0;
  TryLeftInset(left);
  return left;
}

float CXFA_MarginData::GetTopInset() const {
  float top = 0;
  TryTopInset(top);
  return top;
}

float CXFA_MarginData::GetRightInset() const {
  float right = 0;
  TryRightInset(right);
  return right;
}

float CXFA_MarginData::GetBottomInset() const {
  float bottom = 0;
  TryBottomInset(bottom);
  return bottom;
}

bool CXFA_MarginData::TryLeftInset(float& fInset) const {
  return TryMeasure(XFA_Attribute::LeftInset, fInset);
}

bool CXFA_MarginData::TryTopInset(float& fInset) const {
  return TryMeasure(XFA_Attribute::TopInset, fInset);
}

bool CXFA_MarginData::TryRightInset(float& fInset) const {
  return TryMeasure(XFA_Attribute::RightInset, fInset);
}

bool CXFA_MarginData::TryBottomInset(float& fInset) const {
  return TryMeasure(XFA_Attribute::BottomInset, fInset);
}