summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_paradata.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_paradata.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_paradata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_paradata.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/cxfa_paradata.cpp b/xfa/fxfa/parser/cxfa_paradata.cpp
index a04c195ba6..95dc80a934 100644
--- a/xfa/fxfa/parser/cxfa_paradata.cpp
+++ b/xfa/fxfa/parser/cxfa_paradata.cpp
@@ -24,37 +24,37 @@ int32_t CXFA_ParaData::GetVerticalAlign() {
}
float CXFA_ParaData::GetLineHeight() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::LineHeight, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::LineHeight)
+ .ToUnit(XFA_Unit::Pt);
}
float CXFA_ParaData::GetMarginLeft() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::MarginLeft, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::MarginLeft)
+ .ToUnit(XFA_Unit::Pt);
}
float CXFA_ParaData::GetMarginRight() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::MarginRight, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::MarginRight)
+ .ToUnit(XFA_Unit::Pt);
}
float CXFA_ParaData::GetSpaceAbove() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::SpaceAbove, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::SpaceAbove)
+ .ToUnit(XFA_Unit::Pt);
}
float CXFA_ParaData::GetSpaceBelow() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::SpaceBelow, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::SpaceBelow)
+ .ToUnit(XFA_Unit::Pt);
}
float CXFA_ParaData::GetTextIndent() {
- CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_Attribute::TextIndent, ms, true);
- return ms.ToUnit(XFA_Unit::Pt);
+ return m_pNode->JSNode()
+ ->GetMeasure(XFA_Attribute::TextIndent)
+ .ToUnit(XFA_Unit::Pt);
}