OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "xfa/fxfa/parser/cxfa_widgetdata.h" | 7 #include "xfa/fxfa/parser/cxfa_widgetdata.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fxbarcode/include/BC_Library.h" | 10 #include "xfa/fxbarcode/include/BC_Library.h" |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 if (iCount == 0) | 1746 if (iCount == 0) |
1747 return wsValue; | 1747 return wsValue; |
1748 | 1748 |
1749 int32_t i = 0; | 1749 int32_t i = 0; |
1750 if (wsValue[i] == L'-') { | 1750 if (wsValue[i] == L'-') { |
1751 wsRet += L'-'; | 1751 wsRet += L'-'; |
1752 i++; | 1752 i++; |
1753 } | 1753 } |
1754 for (; i < iCount; i++) { | 1754 for (; i < iCount; i++) { |
1755 FX_WCHAR wc = wsValue[i]; | 1755 FX_WCHAR wc = wsValue[i]; |
1756 if (XFA_IsDigit(wc)) { | 1756 if (FXSYS_isDecimalDigit(wc)) { |
1757 if (iLead >= 0) { | 1757 if (iLead >= 0) { |
1758 iLead_++; | 1758 iLead_++; |
1759 if (iLead_ > iLead) | 1759 if (iLead_ > iLead) |
1760 return L"0"; | 1760 return L"0"; |
1761 } else if (iTread_ >= 0) { | 1761 } else if (iTread_ >= 0) { |
1762 iTread_++; | 1762 iTread_++; |
1763 if (iTread_ > iTread) { | 1763 if (iTread_ > iTread) { |
1764 if (iTread != -1) { | 1764 if (iTread != -1) { |
1765 CFX_Decimal wsDeci = CFX_Decimal(wsValue.AsStringC()); | 1765 CFX_Decimal wsDeci = CFX_Decimal(wsValue.AsStringC()); |
1766 wsDeci.SetScale(iTread); | 1766 wsDeci.SetScale(iTread); |
1767 wsRet = wsDeci; | 1767 wsRet = wsDeci; |
1768 } | 1768 } |
1769 return wsRet; | 1769 return wsRet; |
1770 } | 1770 } |
1771 } | 1771 } |
1772 } else if (wc == L'.') { | 1772 } else if (wc == L'.') { |
1773 iTread_ = 0; | 1773 iTread_ = 0; |
1774 iLead = -1; | 1774 iLead = -1; |
1775 } | 1775 } |
1776 wsRet += wc; | 1776 wsRet += wc; |
1777 } | 1777 } |
1778 return wsRet; | 1778 return wsRet; |
1779 } | 1779 } |
OLD | NEW |