dsinclair | 44d054c | 2016-04-06 10:23:46 -0700 | [diff] [blame] | 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 | |
| 11 | CXFA_Margin::CXFA_Margin(CXFA_Node* pNode) : CXFA_Data(pNode) {} |
| 12 | |
| 13 | FX_BOOL CXFA_Margin::GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { |
| 14 | fInset = fDefInset; |
| 15 | return TryMeasure(XFA_ATTRIBUTE_LeftInset, fInset); |
| 16 | } |
| 17 | |
| 18 | FX_BOOL CXFA_Margin::GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { |
| 19 | fInset = fDefInset; |
| 20 | return TryMeasure(XFA_ATTRIBUTE_TopInset, fInset); |
| 21 | } |
| 22 | |
| 23 | FX_BOOL CXFA_Margin::GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset) const { |
| 24 | fInset = fDefInset; |
| 25 | return TryMeasure(XFA_ATTRIBUTE_RightInset, fInset); |
| 26 | } |
| 27 | |
| 28 | FX_BOOL CXFA_Margin::GetBottomInset(FX_FLOAT& fInset, |
| 29 | FX_FLOAT fDefInset) const { |
| 30 | fInset = fDefInset; |
| 31 | return TryMeasure(XFA_ATTRIBUTE_BottomInset, fInset); |
| 32 | } |