summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_boxdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-16 14:19:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-16 14:19:47 +0000
commitce7ccd5f638eff42c6c79da682061fa2c39b028f (patch)
treec150e99f3c7ffb4e2d611e33aba743b43d718ac9 /xfa/fxfa/parser/cxfa_boxdata.cpp
parent8873a4dffed0ae3ccd961ada58c588f92b210bf2 (diff)
downloadpdfium-ce7ccd5f638eff42c6c79da682061fa2c39b028f.tar.xz
Convert CJX_Node::TryMeasure to pdfium::Optional
This CL converts TryMeasure to return a pdfium::Optional instead of a bool with an out parameter. Change-Id: I6e92e53aa0eaa7a6b855253061acca8a59db49fd Reviewed-on: https://pdfium-review.googlesource.com/18550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_boxdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_boxdata.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/cxfa_boxdata.cpp b/xfa/fxfa/parser/cxfa_boxdata.cpp
index fb4423ad71..813a0a6229 100644
--- a/xfa/fxfa/parser/cxfa_boxdata.cpp
+++ b/xfa/fxfa/parser/cxfa_boxdata.cpp
@@ -113,13 +113,13 @@ bool CXFA_BoxData::GetStartAngle(float& fStartAngle) const {
if (!m_pNode)
return false;
- CXFA_Measurement ms;
- bool bRet =
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::StartAngle, ms, false);
- if (bRet)
- fStartAngle = ms.GetValue();
+ pdfium::Optional<CXFA_Measurement> measure =
+ m_pNode->JSNode()->TryMeasure(XFA_Attribute::StartAngle, false);
+ if (!measure)
+ return false;
- return bRet;
+ fStartAngle = measure->GetValue();
+ return true;
}
bool CXFA_BoxData::GetSweepAngle(float& fSweepAngle) const {
@@ -127,13 +127,13 @@ bool CXFA_BoxData::GetSweepAngle(float& fSweepAngle) const {
if (!m_pNode)
return false;
- CXFA_Measurement ms;
- bool bRet =
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::SweepAngle, ms, false);
- if (bRet)
- fSweepAngle = ms.GetValue();
+ pdfium::Optional<CXFA_Measurement> measure =
+ m_pNode->JSNode()->TryMeasure(XFA_Attribute::SweepAngle, false);
+ if (!measure)
+ return false;
- return bRet;
+ fSweepAngle = measure->GetValue();
+ return true;
}
CXFA_FillData CXFA_BoxData::GetFillData(bool bModified) const {