summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-28 17:15:48 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-28 17:15:48 +0000
commit99acb1c816dc88dbda5d03ef28dbdaa928f7e22a (patch)
treeeb72271a52a952db15d5a4fc70654a65100d8b1a
parent3ff28136fef69f1ecd81a9d0d8c278d7120d85f3 (diff)
downloadpdfium-99acb1c816dc88dbda5d03ef28dbdaa928f7e22a.tar.xz
[XFA] Use default values to optionals
When accessing the margin data for a widget, the Inset values can come back as empty optionals. Those would only get values if there was a border data node present. If there is no border data node, we need to default the optional value. Bug: chromium:788246 Change-Id: Id3d5b76e8dc9d391aaa0d0440bf6ee2e2636fcdc Reviewed-on: https://pdfium-review.googlesource.com/19671 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 4544e2eb51..4c8257a039 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -392,7 +392,8 @@ CFX_RectF CXFA_WidgetData::GetUIMargin() {
left = GetEdgeThickness(strokes, bVisible, 3);
}
}
- return CFX_RectF(*left, *top, *right, *bottom);
+ return CFX_RectF(left.value_or(0.0), top.value_or(0.0), right.value_or(0.0),
+ bottom.value_or(0.0));
}
XFA_ATTRIBUTEENUM CXFA_WidgetData::GetButtonHighlight() {