summaryrefslogtreecommitdiff
path: root/xfa/fde/xml/cfde_xmlsyntaxparser.h
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-04-06 10:55:39 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-06 15:25:51 +0000
commitbf58fbb14a8b235fb864fbc45c353174446da4ca (patch)
treebf8c252db2314de5fe79dc2297573add24d2d35c /xfa/fde/xml/cfde_xmlsyntaxparser.h
parent1b22880748c3f3b3740699ae4c953a33f65ad10f (diff)
downloadpdfium-bf58fbb14a8b235fb864fbc45c353174446da4ca.tar.xz
Convert XMLSyntaxParser buffer to vector.
This Cl updates the m_pBuffer pointer to a vector. Change-Id: Ib971d224376122a1d5ebf5bb0e712db552df2342 Reviewed-on: https://pdfium-review.googlesource.com/3815 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde/xml/cfde_xmlsyntaxparser.h')
-rw-r--r--xfa/fde/xml/cfde_xmlsyntaxparser.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.h b/xfa/fde/xml/cfde_xmlsyntaxparser.h
index ef2cd275bd..9e1558ea73 100644
--- a/xfa/fde/xml/cfde_xmlsyntaxparser.h
+++ b/xfa/fde/xml/cfde_xmlsyntaxparser.h
@@ -8,6 +8,7 @@
#define XFA_FDE_XML_CFDE_XMLSYNTAXPARSER_H_
#include <stack>
+#include <vector>
#include "core/fxcrt/cfx_blockbuffer.h"
#include "core/fxcrt/cfx_retain_ptr.h"
@@ -41,9 +42,7 @@ class CFDE_XMLSyntaxParser {
FDE_XmlSyntaxResult DoSyntaxParse();
int32_t GetStatus() const;
- int32_t GetCurrentPos() const {
- return m_iParsedChars + (m_pStart - m_pBuffer);
- }
+ int32_t GetCurrentPos() const { return m_iParsedChars + m_pStart; }
FX_FILESIZE GetCurrentBinaryPos() const;
int32_t GetCurrentNodeNumber() const { return m_iCurrentNodeNum; }
int32_t GetLastNodeNumber() const { return m_iLastNodeNum; }
@@ -105,17 +104,17 @@ class CFDE_XMLSyntaxParser {
int32_t m_iLastNodeNum;
int32_t m_iParsedChars;
int32_t m_iParsedBytes;
- wchar_t* m_pBuffer;
+ std::vector<wchar_t> m_Buffer;
int32_t m_iBufferChars;
bool m_bEOS;
- wchar_t* m_pStart;
- wchar_t* m_pEnd;
+ int32_t m_pStart; // Start position in m_Buffer
+ int32_t m_pEnd; // End position in m_Buffer
FDE_XMLNODE m_CurNode;
std::stack<FDE_XMLNODE> m_XMLNodeStack;
CFX_BlockBuffer m_BlockBuffer;
int32_t m_iAllocStep;
int32_t& m_iDataLength;
- wchar_t* m_pCurrentBlock;
+ wchar_t* m_pCurrentBlock; // Pointer into CFX_BlockBuffer
int32_t m_iIndexInBlock;
int32_t m_iTextDataLength;
FDE_XmlSyntaxResult m_syntaxParserResult;