| 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 "core/fxcrt/include/fx_basic.h" | 7 #include "core/fxcrt/include/fx_basic.h" |
| 8 #include "core/fxcrt/include/fx_ext.h" | 8 #include "core/fxcrt/include/fx_ext.h" |
| 9 | 9 |
| 10 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 10 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
| 11 #include <dirent.h> | 11 #include <dirent.h> |
| 12 #include <sys/types.h> | 12 #include <sys/types.h> |
| 13 #else | 13 #else |
| 14 #include <direct.h> | 14 #include <direct.h> |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #include <algorithm> | 17 #include <algorithm> |
| 18 #include <cctype> | 18 #include <cctype> |
| 19 | 19 |
| 20 #ifdef PDF_ENABLE_XFA |
| 20 CFX_PrivateData::CFX_PrivateData() {} | 21 CFX_PrivateData::CFX_PrivateData() {} |
| 21 | 22 |
| 22 CFX_PrivateData::~CFX_PrivateData() { | 23 CFX_PrivateData::~CFX_PrivateData() { |
| 23 ClearAll(); | 24 ClearAll(); |
| 24 } | 25 } |
| 25 void FX_PRIVATEDATA::FreeData() { | 26 void FX_PRIVATEDATA::FreeData() { |
| 26 if (!m_pData) { | 27 if (!m_pData) { |
| 27 return; | 28 return; |
| 28 } | 29 } |
| 29 if (m_bSelfDestruct) { | 30 if (m_bSelfDestruct) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return NULL; | 89 return NULL; |
| 89 } | 90 } |
| 90 void CFX_PrivateData::ClearAll() { | 91 void CFX_PrivateData::ClearAll() { |
| 91 FX_PRIVATEDATA* pList = m_DataList.GetData(); | 92 FX_PRIVATEDATA* pList = m_DataList.GetData(); |
| 92 int count = m_DataList.GetSize(); | 93 int count = m_DataList.GetSize(); |
| 93 for (int i = 0; i < count; i++) { | 94 for (int i = 0; i < count; i++) { |
| 94 pList[i].FreeData(); | 95 pList[i].FreeData(); |
| 95 } | 96 } |
| 96 m_DataList.RemoveAll(); | 97 m_DataList.RemoveAll(); |
| 97 } | 98 } |
| 99 #endif // PDF_ENABLE_XFA |
| 98 | 100 |
| 99 void FX_atonum(const CFX_ByteStringC& strc, FX_BOOL& bInteger, void* pData) { | 101 void FX_atonum(const CFX_ByteStringC& strc, FX_BOOL& bInteger, void* pData) { |
| 100 if (strc.Find('.') == -1) { | 102 if (strc.Find('.') == -1) { |
| 101 bInteger = TRUE; | 103 bInteger = TRUE; |
| 102 int cc = 0; | 104 int cc = 0; |
| 103 pdfium::base::CheckedNumeric<int> integer = 0; | 105 pdfium::base::CheckedNumeric<int> integer = 0; |
| 104 FX_STRSIZE len = strc.GetLength(); | 106 FX_STRSIZE len = strc.GetLength(); |
| 105 bool bNegative = false; | 107 bool bNegative = false; |
| 106 if (strc[0] == '+') { | 108 if (strc[0] == '+') { |
| 107 cc++; | 109 cc++; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 dstShift -= 8; | 390 dstShift -= 8; |
| 389 result |= *dataPtr++ << dstShift; | 391 result |= *dataPtr++ << dstShift; |
| 390 } | 392 } |
| 391 if (dstShift > 0) { | 393 if (dstShift > 0) { |
| 392 bitShift = 8 - dstShift; | 394 bitShift = 8 - dstShift; |
| 393 bitMask = (1 << dstShift) - 1; | 395 bitMask = (1 << dstShift) - 1; |
| 394 result |= *dataPtr++ >> bitShift & bitMask; | 396 result |= *dataPtr++ >> bitShift & bitMask; |
| 395 } | 397 } |
| 396 return result; | 398 return result; |
| 397 } | 399 } |
| OLD | NEW |