diff options
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/xfa_localevalue.cpp | 42 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_localevalue.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.cpp | 46 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.h | 2 |
4 files changed, 46 insertions, 46 deletions
diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index 6dd02e6a85..b011f0fdad 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -17,22 +17,22 @@ #include "xfa/fxfa/parser/xfa_object.h" #include "xfa/fxfa/parser/xfa_utils.h" -static const FX_DOUBLE fraction_scales[] = {0.1, - 0.01, - 0.001, - 0.0001, - 0.00001, - 0.000001, - 0.0000001, - 0.00000001, - 0.000000001, - 0.0000000001, - 0.00000000001, - 0.000000000001, - 0.0000000000001, - 0.00000000000001, - 0.000000000000001, - 0.0000000000000001}; +static const double fraction_scales[] = {0.1, + 0.01, + 0.001, + 0.0001, + 0.00001, + 0.000001, + 0.0000001, + 0.00000001, + 0.000000001, + 0.0000000001, + 0.00000000001, + 0.000000000001, + 0.0000000000001, + 0.00000000000001, + 0.000000000000001, + 0.0000000000000001}; CXFA_LocaleValue::CXFA_LocaleValue() { m_dwType = XFA_VT_NULL; m_bValid = true; @@ -286,7 +286,7 @@ FX_FLOAT CXFA_LocaleValue::GetNum() const { } return 0; } -FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { +double CXFA_LocaleValue::GetDoubleNum() const { if (m_bValid && (m_dwType == XFA_VT_BOOLEAN || m_dwType == XFA_VT_INTEGER || m_dwType == XFA_VT_DECIMAL || m_dwType == XFA_VT_FLOAT)) { int64_t nIntegral = 0; @@ -320,14 +320,14 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { } nIntegral = bNegative ? -nIntegral : nIntegral; int32_t scale = 0; - FX_DOUBLE fraction = 0.0; + double fraction = 0.0; if (cc < len && str[cc] == '.') { cc++; while (cc < len) { fraction += fraction_scales[scale] * (str[cc] - '0'); scale++; cc++; - if (scale == sizeof fraction_scales / sizeof(FX_DOUBLE) || + if (scale == sizeof fraction_scales / sizeof(double) || !FXSYS_isDecimalDigit(str[cc])) { break; } @@ -353,7 +353,7 @@ FX_DOUBLE CXFA_LocaleValue::GetDoubleNum() const { } nExponent = bExpSign ? -nExponent : nExponent; } - FX_DOUBLE dValue = (dwFractional / 4294967296.0); + double dValue = (dwFractional / 4294967296.0); dValue = nIntegral + (nIntegral >= 0 ? dValue : -dValue); if (nExponent != 0) { dValue *= FXSYS_pow(10, (FX_FLOAT)nExponent); @@ -406,7 +406,7 @@ bool CXFA_LocaleValue::SetText(const CFX_WideString& wsText, } bool CXFA_LocaleValue::SetNum(FX_FLOAT fNum) { m_dwType = XFA_VT_FLOAT; - m_wsValue.Format(L"%.8g", (FX_DOUBLE)fNum); + m_wsValue.Format(L"%.8g", (double)fNum); return true; } bool CXFA_LocaleValue::SetNum(const CFX_WideString& wsNum, diff --git a/xfa/fxfa/parser/xfa_localevalue.h b/xfa/fxfa/parser/xfa_localevalue.h index dbc3513a3f..084f63cb6e 100644 --- a/xfa/fxfa/parser/xfa_localevalue.h +++ b/xfa/fxfa/parser/xfa_localevalue.h @@ -71,7 +71,7 @@ class CXFA_LocaleValue { void SetValue(const CFX_WideString& wsValue, uint32_t dwType); CFX_WideString GetText() const; FX_FLOAT GetNum() const; - FX_DOUBLE GetDoubleNum() const; + double GetDoubleNum() const; CFX_Unitime GetDate() const; CFX_Unitime GetTime() const; CFX_Unitime GetDateTime() const; diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index ef7e939a85..c41902676d 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -17,24 +17,24 @@ namespace { -const FX_DOUBLE fraction_scales[] = {0.1, - 0.01, - 0.001, - 0.0001, - 0.00001, - 0.000001, - 0.0000001, - 0.00000001, - 0.000000001, - 0.0000000001, - 0.00000000001, - 0.000000000001, - 0.0000000000001, - 0.00000000000001, - 0.000000000000001, - 0.0000000000000001}; - -FX_DOUBLE WideStringToDouble(const CFX_WideString& wsStringVal) { +const double fraction_scales[] = {0.1, + 0.01, + 0.001, + 0.0001, + 0.00001, + 0.000001, + 0.0000001, + 0.00000001, + 0.000000001, + 0.0000000001, + 0.00000000001, + 0.000000000001, + 0.0000000000001, + 0.00000000000001, + 0.000000000000001, + 0.0000000000000001}; + +double WideStringToDouble(const CFX_WideString& wsStringVal) { CFX_WideString wsValue = wsStringVal; wsValue.TrimLeft(); wsValue.TrimRight(); @@ -67,7 +67,7 @@ FX_DOUBLE WideStringToDouble(const CFX_WideString& wsStringVal) { } nIntegral = bNegative ? -nIntegral : nIntegral; int32_t scale = 0; - FX_DOUBLE fraction = 0.0; + double fraction = 0.0; if (cc < len && str[cc] == '.') { cc++; while (cc < len) { @@ -77,8 +77,8 @@ FX_DOUBLE WideStringToDouble(const CFX_WideString& wsStringVal) { if (cc == len) { break; } - if (scale == sizeof(fraction_scales) / sizeof(FX_DOUBLE) || - str[cc] == 'E' || str[cc] == 'e') { + if (scale == sizeof(fraction_scales) / sizeof(double) || str[cc] == 'E' || + str[cc] == 'e') { break; } if (!FXSYS_isDecimalDigit(str[cc])) { @@ -106,7 +106,7 @@ FX_DOUBLE WideStringToDouble(const CFX_WideString& wsStringVal) { } nExponent = bExpSign ? -nExponent : nExponent; } - FX_DOUBLE dValue = (dwFractional / 4294967296.0); + double dValue = (dwFractional / 4294967296.0); dValue = nIntegral + (nIntegral >= 0 ? dValue : -dValue); if (nExponent != 0) { dValue *= FXSYS_pow(10, (FX_FLOAT)nExponent); @@ -221,7 +221,7 @@ bool XFA_FieldIsMultiListBox(CXFA_Node* pFieldNode) { return bRet; } -FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) { +double XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal) { CFX_WideString wsValue = CFX_WideString::FromUTF8(szStringVal); return WideStringToDouble(wsValue); } diff --git a/xfa/fxfa/parser/xfa_utils.h b/xfa/fxfa/parser/xfa_utils.h index a5bdeea192..73f6101f3e 100644 --- a/xfa/fxfa/parser/xfa_utils.h +++ b/xfa/fxfa/parser/xfa_utils.h @@ -142,7 +142,7 @@ class CXFA_NodeIteratorTemplate { }; CXFA_LocaleValue XFA_GetLocaleValue(CXFA_WidgetData* pWidgetData); -FX_DOUBLE XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal); +double XFA_ByteStringToDouble(const CFX_ByteStringC& szStringVal); int32_t XFA_MapRotation(int32_t nRotation); bool XFA_RecognizeRichText(CFDE_XMLElement* pRichTextXMLNode); |