diff options
Diffstat (limited to 'xfa/src/fgas/src/xml')
-rw-r--r-- | xfa/src/fgas/src/xml/fx_sax_imp.cpp | 13 | ||||
-rw-r--r-- | xfa/src/fgas/src/xml/fx_sax_imp.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp index dce96470a6..6b3cc778ab 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp +++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp @@ -4,8 +4,17 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "xfa/src/fgas/src/fgas_base.h"
#include "fx_sax_imp.h"
+
+namespace {
+
+const FX_DWORD kSaxFileBufSize = 32768;
+
+} // namespace
+
IFX_SAXReader* FX_SAXReader_Create() {
return new CFX_SAXReader;
}
@@ -31,7 +40,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, if (dwLen == 0) {
return FALSE;
}
- m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE);
+ m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
return FALSE;
@@ -49,7 +58,7 @@ FX_BOOL CFX_SAXFile::ReadNextBlock() { if (dwSize == 0) {
return FALSE;
}
- m_dwBufSize = FX_MIN(dwSize, FX_SAXFILE_BUFSIZE);
+ m_dwBufSize = std::min(dwSize, kSaxFileBufSize);
if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) {
return FALSE;
}
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/src/xml/fx_sax_imp.h index 7d04f14698..71be388efd 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.h +++ b/xfa/src/fgas/src/xml/fx_sax_imp.h @@ -6,7 +6,7 @@ #ifndef _FX_SAX_IMP_
#define _FX_SAX_IMP_
-#define FX_SAXFILE_BUFSIZE 32768
+
class CFX_SAXFile {
public:
CFX_SAXFile();
|