Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1436)

Unified Diff: xfa/fxfa/parser/cxfa_measurement.cpp

Issue 2467203003: Remove FX_BOOL from xfa. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_measurement.h ('k') | xfa/fxfa/parser/cxfa_node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/cxfa_measurement.cpp
diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp
index cd34f8af258e828147eb70ca652ae9fdd0cfef9b..b1843a8b49ba600bee467ba739991af44fe3dea0 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;
}
}
« no previous file with comments | « xfa/fxfa/parser/cxfa_measurement.h ('k') | xfa/fxfa/parser/cxfa_node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698