Index: xfa/fgas/xml/fgas_sax.cpp |
diff --git a/xfa/fgas/xml/fgas_sax_imp.cpp b/xfa/fgas/xml/fgas_sax.cpp |
similarity index 97% |
rename from xfa/fgas/xml/fgas_sax_imp.cpp |
rename to xfa/fgas/xml/fgas_sax.cpp |
index ea3dafff59befdfdebb500162fc00a7ac26d0932..547bcc17f352d20a073519f3ec49a700792c1727 100644 |
--- a/xfa/fgas/xml/fgas_sax_imp.cpp |
+++ b/xfa/fgas/xml/fgas_sax.cpp |
@@ -4,19 +4,18 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
-#include "xfa/fgas/xml/fgas_sax_imp.h" |
+#include "xfa/fgas/xml/fgas_sax.h" |
#include <algorithm> |
+#include "xfa/fxfa/include/xfa_checksum.h" |
+ |
namespace { |
const uint32_t kSaxFileBufSize = 32768; |
} // namespace |
-IFX_SAXReader* FX_SAXReader_Create() { |
- return new CFX_SAXReader; |
-} |
CFX_SAXFile::CFX_SAXFile() |
: m_pFile(NULL), |
m_dwStart(0), |
@@ -657,16 +656,20 @@ void CFX_SAXReader::NotifyClose() { |
m_pHandler->OnTagClose(m_pCurItem->m_pNode, m_dwNodePos); |
} |
} |
+ |
void CFX_SAXReader::NotifyEnd() { |
- FXSYS_assert(m_pHandler != NULL); |
- if (m_pCurItem->m_eNode == FX_SAXNODE_Tag) { |
- m_pHandler->OnTagEnd(m_pCurItem->m_pNode, |
- CFX_ByteStringC(m_pszData, m_iDataLength), |
- m_dwNodePos); |
- } |
+ FXSYS_assert(m_pHandler); |
Lei Zhang
2016/04/27 19:23:49
Delete? If the assertion fails, this will likely c
dsinclair
2016/04/27 19:31:32
Done.
|
+ |
+ if (m_pCurItem->m_eNode != FX_SAXNODE_Tag) |
+ return; |
+ |
+ m_pHandler->OnTagEnd(m_pCurItem->m_pNode, |
+ CFX_ByteStringC(m_pszData, m_iDataLength), m_dwNodePos); |
} |
+ |
void CFX_SAXReader::NotifyTargetData() { |
- FXSYS_assert(m_pHandler != NULL); |
+ FXSYS_assert(m_pHandler); |
+ |
if (m_pCurItem->m_eNode == FX_SAXNODE_Instruction) { |
m_pHandler->OnTargetData(m_pCurItem->m_pNode, m_pCurItem->m_eNode, |
CFX_ByteStringC(m_pszName, m_iNameLength), |
@@ -677,12 +680,14 @@ void CFX_SAXReader::NotifyTargetData() { |
m_dwNodePos); |
} |
} |
+ |
void CFX_SAXReader::SkipCurrentNode() { |
- if (!m_pCurItem) { |
+ if (!m_pCurItem) |
return; |
- } |
+ |
m_pCurItem->m_bSkip = TRUE; |
} |
-void CFX_SAXReader::SetHandler(IFX_SAXReaderHandler* pHandler) { |
+ |
+void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) { |
m_pHandler = pHandler; |
} |