summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_measurement.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-29 18:56:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-29 18:56:40 +0000
commitb3eb4ac763bbeb4744f4c8411d280abda6f17644 (patch)
treee3cf9517fe2833c6d730046017ddb12e43925dfd /xfa/fxfa/parser/cxfa_measurement.cpp
parent97b4b48685b7624cc69f73f9c57bb9e23159c8ec (diff)
downloadpdfium-b3eb4ac763bbeb4744f4c8411d280abda6f17644.tar.xz
Remove static measurement data
This CL removes the static initialized CXFA_Measurement items and replaces them with strings which are converted to measurements at runtime. Bug: pdfium:804 Change-Id: I60422b6ddff750d504a5a8b62de6ad896fc80caf Reviewed-on: https://pdfium-review.googlesource.com/19770 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_measurement.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_measurement.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp
index 288ed0cd31..a929f701be 100644
--- a/xfa/fxfa/parser/cxfa_measurement.cpp
+++ b/xfa/fxfa/parser/cxfa_measurement.cpp
@@ -36,6 +36,7 @@ void CXFA_Measurement::SetString(const WideStringView& wsMeasure) {
m_eUnit = XFA_Unit::Unknown;
return;
}
+
int32_t iUsedLen = 0;
int32_t iOffset = (wsMeasure[0] == L'=') ? 1 : 0;
float fValue = FXSYS_wcstof(wsMeasure.unterminated_c_str() + iOffset,
@@ -142,6 +143,8 @@ XFA_Unit CXFA_Measurement::GetUnitFromString(const WideStringView& wsUnit) {
return XFA_Unit::Mp;
if (wsUnit == L"em")
return XFA_Unit::Em;
+ if (wsUnit == L"an")
+ return XFA_Unit::Angle;
if (wsUnit == L"%")
return XFA_Unit::Percent;
return XFA_Unit::Unknown;