OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "core/fxcrt/include/fx_xml.h" | 10 #include "core/fxcrt/include/fx_xml.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 wsFormat.Format(L"%%.%df", nTreading); | 449 wsFormat.Format(L"%%.%df", nTreading); |
450 CFX_WideString wsResult; | 450 CFX_WideString wsResult; |
451 wsResult.Format(wsFormat.c_str(), GetDouble()); | 451 wsResult.Format(wsFormat.c_str(), GetDouble()); |
452 if (bTrimTailZeros && nTreading > 0) { | 452 if (bTrimTailZeros && nTreading > 0) { |
453 wsResult.TrimRight(L"0"); | 453 wsResult.TrimRight(L"0"); |
454 wsResult.TrimRight(L"."); | 454 wsResult.TrimRight(L"."); |
455 } | 455 } |
456 return wsResult; | 456 return wsResult; |
457 } | 457 } |
458 | 458 |
459 IFX_FormatString* IFX_FormatString::Create(IFX_LocaleMgr* pLocaleMgr, | |
460 FX_BOOL bUseLCID) { | |
461 if (!pLocaleMgr) { | |
462 return NULL; | |
463 } | |
464 return new CFX_FormatString(pLocaleMgr, bUseLCID); | |
465 } | |
466 CFX_FormatString::CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, FX_BOOL bUseLCID) | 459 CFX_FormatString::CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, FX_BOOL bUseLCID) |
467 : m_pLocaleMgr(pLocaleMgr), m_bUseLCID(bUseLCID) {} | 460 : m_pLocaleMgr(pLocaleMgr), m_bUseLCID(bUseLCID) {} |
468 CFX_FormatString::~CFX_FormatString() {} | 461 CFX_FormatString::~CFX_FormatString() {} |
469 void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, | 462 void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, |
470 CFX_WideStringArray& wsPatterns) { | 463 CFX_WideStringArray& wsPatterns) { |
471 int32_t iStrLen = wsFormatString.GetLength(); | 464 int32_t iStrLen = wsFormatString.GetLength(); |
472 const FX_WCHAR* pStr = (const FX_WCHAR*)wsFormatString; | 465 const FX_WCHAR* pStr = (const FX_WCHAR*)wsFormatString; |
473 const FX_WCHAR* pToken = pStr; | 466 const FX_WCHAR* pToken = pStr; |
474 const FX_WCHAR* pEnd = pStr + iStrLen; | 467 const FX_WCHAR* pEnd = pStr + iStrLen; |
475 FX_BOOL iQuote = FALSE; | 468 FX_BOOL iQuote = FALSE; |
(...skipping 4549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5025 } | 5018 } |
5026 CFX_Decimal CFX_Decimal::operator*(const CFX_Decimal& val) const { | 5019 CFX_Decimal CFX_Decimal::operator*(const CFX_Decimal& val) const { |
5027 return Multiply(val); | 5020 return Multiply(val); |
5028 } | 5021 } |
5029 CFX_Decimal CFX_Decimal::operator/(const CFX_Decimal& val) const { | 5022 CFX_Decimal CFX_Decimal::operator/(const CFX_Decimal& val) const { |
5030 return Divide(val); | 5023 return Divide(val); |
5031 } | 5024 } |
5032 CFX_Decimal CFX_Decimal::operator%(const CFX_Decimal& val) const { | 5025 CFX_Decimal CFX_Decimal::operator%(const CFX_Decimal& val) const { |
5033 return Modulus(val); | 5026 return Modulus(val); |
5034 } | 5027 } |
OLD | NEW |