From 0bf9aef229ae2c4f2f16ab753d6d2e9e6d718a44 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Nov 2017 13:44:38 +0000 Subject: Convert TryInteger to return an optional This Cl changes CJX_Node::TryInteger to return a pdfium::Optional instead of a boolean with an out param. Change-Id: I4675e08d3b132041f7d87e4639efa1d555089dc2 Reviewed-on: https://pdfium-review.googlesource.com/18511 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_filldata.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_filldata.cpp') diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp index b55f24ad2a..4e1e5f1af2 100644 --- a/xfa/fxfa/parser/cxfa_filldata.cpp +++ b/xfa/fxfa/parser/cxfa_filldata.cpp @@ -72,15 +72,13 @@ int32_t CXFA_FillData::GetStipple(FX_ARGB& stippleColor) { CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Stipple, true); - int32_t eAttr = 50; - pNode->JSNode()->TryInteger(XFA_Attribute::Rate, eAttr, true); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color, false)) { pdfium::Optional wsColor = pColor->JSNode()->TryCData(XFA_Attribute::Value, false); if (wsColor) stippleColor = CXFA_DataData::ToColor(wsColor->AsStringView()); } - return eAttr; + return pNode->JSNode()->TryInteger(XFA_Attribute::Rate, true).value_or(50); } int32_t CXFA_FillData::GetLinear(FX_ARGB& endColor) { -- cgit v1.2.3