summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_datadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_datadata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_datadata.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_datadata.cpp b/xfa/fxfa/parser/cxfa_datadata.cpp
index 8f41c2f3dd..cf813fc017 100644
--- a/xfa/fxfa/parser/cxfa_datadata.cpp
+++ b/xfa/fxfa/parser/cxfa_datadata.cpp
@@ -68,12 +68,13 @@ XFA_Element CXFA_DataData::GetElementType() const {
bool CXFA_DataData::TryMeasure(XFA_Attribute eAttr,
float& fValue,
bool bUseDefault) const {
- CXFA_Measurement ms;
- if (m_pNode->JSNode()->TryMeasure(eAttr, ms, bUseDefault)) {
- fValue = ms.ToUnit(XFA_Unit::Pt);
- return true;
- }
- return false;
+ pdfium::Optional<CXFA_Measurement> measure =
+ m_pNode->JSNode()->TryMeasure(eAttr, bUseDefault);
+ if (!measure)
+ return false;
+
+ fValue = measure->ToUnit(XFA_Unit::Pt);
+ return true;
}
bool CXFA_DataData::SetMeasure(XFA_Attribute eAttr, float fValue) {