diff options
author | Lei Zhang <thestig@chromium.org> | 2017-07-25 17:20:43 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-26 00:33:29 +0000 |
commit | a27c752a048ac2b88bc0c9c293917a7a0494d8a2 (patch) | |
tree | 566d7689a11209ccb8430828b3e9c56050d3736e /xfa/fxfa/parser/cxfa_measurement.h | |
parent | 952477dbee761a6e38ce675f2095bbfc9cfd7450 (diff) | |
download | pdfium-a27c752a048ac2b88bc0c9c293917a7a0494d8a2.tar.xz |
Clean up CXFA_Measurement and callers.
Change-Id: Iaa34127aaf616a0a7bdf7ccc8f8f001d34abcca1
Reviewed-on: https://pdfium-review.googlesource.com/7371
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_measurement.h')
-rw-r--r-- | xfa/fxfa/parser/cxfa_measurement.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/cxfa_measurement.h b/xfa/fxfa/parser/cxfa_measurement.h index 34cf780f81..2c03ec0dc6 100644 --- a/xfa/fxfa/parser/cxfa_measurement.h +++ b/xfa/fxfa/parser/cxfa_measurement.h @@ -17,24 +17,23 @@ class CXFA_Measurement { CXFA_Measurement(); CXFA_Measurement(float fValue, XFA_UNIT eUnit); - void Set(const CFX_WideStringC& wsMeasure); + static XFA_UNIT GetUnitFromString(const CFX_WideStringC& wsUnit); + void Set(float fValue, XFA_UNIT eUnit) { m_fValue = fValue; m_eUnit = eUnit; } - XFA_UNIT GetUnit(const CFX_WideStringC& wsUnit); XFA_UNIT GetUnit() const { return m_eUnit; } float GetValue() const { return m_fValue; } - bool ToString(CFX_WideString& wsMeasure) const; - bool ToUnit(XFA_UNIT eUnit, float& fValue) const; - float ToUnit(XFA_UNIT eUnit) const { - float f; - return ToUnit(eUnit, f) ? f : 0; - } + bool ToString(CFX_WideString* wsMeasure) const; + float ToUnit(XFA_UNIT eUnit) const; private: + void SetString(const CFX_WideStringC& wsMeasure); + bool ToUnitInternal(XFA_UNIT eUnit, float* fValue) const; + float m_fValue; XFA_UNIT m_eUnit; }; |