summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_measurement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_measurement.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_measurement.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp
index cd34f8af25..b1843a8b49 100644
--- a/xfa/fxfa/parser/cxfa_measurement.cpp
+++ b/xfa/fxfa/parser/cxfa_measurement.cpp
@@ -34,43 +34,43 @@ void CXFA_Measurement::Set(const CFX_WideStringC& wsMeasure) {
Set(fValue, eUnit);
}
-FX_BOOL CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const {
+bool CXFA_Measurement::ToString(CFX_WideString& wsMeasure) const {
switch (GetUnit()) {
case XFA_UNIT_Mm:
wsMeasure.Format(L"%.8gmm", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Pt:
wsMeasure.Format(L"%.8gpt", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_In:
wsMeasure.Format(L"%.8gin", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Cm:
wsMeasure.Format(L"%.8gcm", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Mp:
wsMeasure.Format(L"%.8gmp", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Pc:
wsMeasure.Format(L"%.8gpc", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Em:
wsMeasure.Format(L"%.8gem", GetValue());
- return TRUE;
+ return true;
case XFA_UNIT_Percent:
wsMeasure.Format(L"%.8g%%", GetValue());
- return TRUE;
+ return true;
default:
wsMeasure.Format(L"%.8g", GetValue());
- return FALSE;
+ return false;
}
}
-FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
+bool CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
fValue = GetValue();
XFA_UNIT eFrom = GetUnit();
if (eFrom == eUnit)
- return TRUE;
+ return true;
switch (eFrom) {
case XFA_UNIT_Pt:
@@ -92,29 +92,29 @@ FX_BOOL CXFA_Measurement::ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const {
break;
default:
fValue = 0;
- return FALSE;
+ return false;
}
switch (eUnit) {
case XFA_UNIT_Pt:
- return TRUE;
+ return true;
case XFA_UNIT_Mm:
fValue /= 72 / 2.54f / 10;
- return TRUE;
+ return true;
case XFA_UNIT_In:
fValue /= 72;
- return TRUE;
+ return true;
case XFA_UNIT_Cm:
fValue /= 72 / 2.54f;
- return TRUE;
+ return true;
case XFA_UNIT_Mp:
fValue /= 0.001f;
- return TRUE;
+ return true;
case XFA_UNIT_Pc:
fValue /= 12.0f;
- return TRUE;
+ return true;
default:
fValue = 0;
- return FALSE;
+ return false;
}
}