summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-21 16:25:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 16:25:01 +0000
commite6e262844037dfc66e5118bcedf1c84d57f78706 (patch)
tree5e939e1be2b819b49e2ac050412de2179e123cc6 /xfa/fxfa/cxfa_ffwidget.cpp
parent120c19b6a19377c341658c342c4351eccbb59741 (diff)
downloadpdfium-e6e262844037dfc66e5118bcedf1c84d57f78706.tar.xz
Add CXFA_MarginData::Get*Inset helpers
This CL adds Get*Inset helpers to CXFA_MarginData which just return a default value of 0 if the Try*Inset method fails. Change-Id: I03b00b7a371c39e521f95952e965b4a3ef71d517 Reviewed-on: https://pdfium-review.googlesource.com/18870 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 00ab8cda0e..24e647a1cd 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -2026,15 +2026,8 @@ void XFA_RectWidthoutMargin(CFX_RectF& rt,
if (!marginData.HasValidNode())
return;
- float fLeftInset = 0;
- float fTopInset = 0;
- float fRightInset = 0;
- float fBottomInset = 0;
- marginData.TryLeftInset(fLeftInset);
- marginData.TryTopInset(fTopInset);
- marginData.TryRightInset(fRightInset);
- marginData.TryBottomInset(fBottomInset);
- rt.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset);
+ rt.Deflate(marginData.GetLeftInset(), marginData.GetTopInset(),
+ marginData.GetRightInset(), marginData.GetBottomInset());
}
CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) {