• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #include "xfa/fxfa/parser/cxfa_margin.h"
8 
9 #include "xfa/fxfa/parser/xfa_object.h"
10 
CXFA_Margin(CXFA_Node * pNode)11 CXFA_Margin::CXFA_Margin(CXFA_Node* pNode) : CXFA_Data(pNode) {}
12 
GetLeftInset(FX_FLOAT & fInset,FX_FLOAT fDefInset) const13 bool CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
14   fInset = fDefInset;
15   return TryMeasure(XFA_ATTRIBUTE_LeftInset, fInset);
16 }
17 
GetTopInset(FX_FLOAT & fInset,FX_FLOAT fDefInset) const18 bool CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
19   fInset = fDefInset;
20   return TryMeasure(XFA_ATTRIBUTE_TopInset, fInset);
21 }
22 
GetRightInset(FX_FLOAT & fInset,FX_FLOAT fDefInset) const23 bool CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
24   fInset = fDefInset;
25   return TryMeasure(XFA_ATTRIBUTE_RightInset, fInset);
26 }
27 
GetBottomInset(FX_FLOAT & fInset,FX_FLOAT fDefInset) const28 bool CXFA_Margin::GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const {
29   fInset = fDefInset;
30   return TryMeasure(XFA_ATTRIBUTE_BottomInset, fInset);
31 }
32