diff options
-rw-r--r-- | core/fxcrt/xml/cfx_xmldocument.h | 1 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlparser.cpp | 34 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlparser.h | 7 | ||||
-rw-r--r-- | fxjs/xfa/cjx_node.cpp | 2 | ||||
-rw-r--r-- | fxjs/xfa/cjx_object.cpp | 1 | ||||
-rw-r--r-- | fxjs/xfa/cjx_object.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffdoc.h | 1 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.cpp | 1 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.h | 6 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser_unittest.cpp | 1 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 1 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.h | 2 |
12 files changed, 31 insertions, 28 deletions
diff --git a/core/fxcrt/xml/cfx_xmldocument.h b/core/fxcrt/xml/cfx_xmldocument.h index 7d6f02b48d..9931314ec5 100644 --- a/core/fxcrt/xml/cfx_xmldocument.h +++ b/core/fxcrt/xml/cfx_xmldocument.h @@ -13,7 +13,6 @@ #include "core/fxcrt/xml/cfx_xmlelement.h" #include "third_party/base/ptr_util.h" -class CFX_XMLInstruction; class CFX_XMLNode; class CFX_XMLDocument { diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp index 97ba90d0fe..956aa76b4d 100644 --- a/core/fxcrt/xml/cfx_xmlparser.cpp +++ b/core/fxcrt/xml/cfx_xmlparser.cpp @@ -69,11 +69,10 @@ CFX_XMLParser::CFX_XMLParser(const RetainPtr<IFX_SeekableReadStream>& pStream) { wCodePage != FX_CODEPAGE_UTF8) { proxy->SetCodePage(FX_CODEPAGE_UTF8); } - m_pStream = proxy; + stream_ = proxy; - m_iXMLPlaneSize = - std::min(m_iXMLPlaneSize, - pdfium::base::checked_cast<size_t>(m_pStream->GetSize())); + xml_plane_size_ = std::min( + xml_plane_size_, pdfium::base::checked_cast<size_t>(stream_->GetSize())); current_text_.reserve(kCurrentTextReserve); } @@ -91,10 +90,10 @@ bool CFX_XMLParser::DoSyntaxParse(CFX_XMLDocument* doc) { FX_FILESIZE current_buffer_idx = 0; FX_FILESIZE buffer_size = 0; - FX_SAFE_SIZE_T alloc_size_safe = m_iXMLPlaneSize; + FX_SAFE_SIZE_T alloc_size_safe = xml_plane_size_; alloc_size_safe += 1; // For NUL. if (!alloc_size_safe.IsValid() || alloc_size_safe.ValueOrDie() <= 0 || - m_iXMLPlaneSize <= 0) + xml_plane_size_ <= 0) return false; std::vector<wchar_t> buffer; @@ -110,11 +109,10 @@ bool CFX_XMLParser::DoSyntaxParse(CFX_XMLDocument* doc) { while (true) { if (current_buffer_idx >= buffer_size) { - if (m_pStream->IsEOF()) + if (stream_->IsEOF()) return true; - size_t buffer_chars = - m_pStream->ReadBlock(buffer.data(), m_iXMLPlaneSize); + size_t buffer_chars = stream_->ReadBlock(buffer.data(), xml_plane_size_); if (buffer_chars == 0) return true; @@ -261,7 +259,7 @@ bool CFX_XMLParser::DoSyntaxParse(CFX_XMLDocument* doc) { break; case FDE_XmlSyntaxState::AttriValue: if (ch == current_quote_character) { - if (m_iEntityStart > -1) + if (entity_start_ > -1) return false; current_quote_character = 0; @@ -467,13 +465,13 @@ bool CFX_XMLParser::DoSyntaxParse(CFX_XMLDocument* doc) { void CFX_XMLParser::ProcessTextChar(wchar_t character) { current_text_.push_back(character); - if (m_iEntityStart > -1 && character == L';') { + if (entity_start_ > -1 && character == L';') { // Copy the entity out into a string and remove from the vector. When we // copy the entity we don't want to copy out the & or the ; so we start // shifted by one and want to copy 2 less characters in total. - WideString csEntity(current_text_.data() + m_iEntityStart + 1, - current_text_.size() - m_iEntityStart - 2); - current_text_.erase(current_text_.begin() + m_iEntityStart, + WideString csEntity(current_text_.data() + entity_start_ + 1, + current_text_.size() - entity_start_ - 2); + current_text_.erase(current_text_.begin() + entity_start_, current_text_.end()); int32_t iLen = csEntity.GetLength(); @@ -514,9 +512,9 @@ void CFX_XMLParser::ProcessTextChar(wchar_t character) { } } - m_iEntityStart = -1; - } else if (m_iEntityStart < 0 && character == L'&') { - m_iEntityStart = current_text_.size() - 1; + entity_start_ = -1; + } else if (entity_start_ < 0 && character == L'&') { + entity_start_ = current_text_.size() - 1; } } @@ -532,7 +530,7 @@ void CFX_XMLParser::ProcessTargetData() { WideString CFX_XMLParser::GetTextData() { WideString ret(current_text_.data(), current_text_.size()); - m_iEntityStart = -1; + entity_start_ = -1; current_text_.clear(); current_text_.reserve(kCurrentTextReserve); return ret; diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h index 466968054b..3d7cc78829 100644 --- a/core/fxcrt/xml/cfx_xmlparser.h +++ b/core/fxcrt/xml/cfx_xmlparser.h @@ -12,7 +12,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/retain_ptr.h" -#include "core/fxcrt/xml/cfx_xmlnode.h" class CFX_XMLDocument; class CFX_XMLElement; @@ -54,10 +53,10 @@ class CFX_XMLParser { void ProcessTargetData(); CFX_XMLNode* current_node_ = nullptr; - RetainPtr<IFX_SeekableReadStream> m_pStream; + RetainPtr<IFX_SeekableReadStream> stream_; std::vector<wchar_t> current_text_; - size_t m_iXMLPlaneSize = 1024; - int32_t m_iEntityStart = -1; + size_t xml_plane_size_ = 1024; + int32_t entity_start_ = -1; }; #endif // CORE_FXCRT_XML_CFX_XMLPARSER_H_ diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index 49cd041c88..c78ddccd0b 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -12,6 +12,8 @@ #include "core/fxcrt/cfx_memorystream.h" #include "core/fxcrt/fx_codepage.h" +#include "core/fxcrt/xml/cfx_xmldocument.h" +#include "core/fxcrt/xml/cfx_xmlnode.h" #include "fxjs/cfxjse_engine.h" #include "fxjs/cfxjse_value.h" #include "fxjs/js_resources.h" diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp index afbcee9b01..c1c7cbc710 100644 --- a/fxjs/xfa/cjx_object.cpp +++ b/fxjs/xfa/cjx_object.cpp @@ -10,6 +10,7 @@ #include "core/fxcrt/cfx_decimal.h" #include "core/fxcrt/fx_extension.h" +#include "core/fxcrt/xml/cfx_xmlelement.h" #include "core/fxcrt/xml/cfx_xmltext.h" #include "fxjs/cfxjse_engine.h" #include "fxjs/cfxjse_value.h" diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index a88900e73e..4edf1bd73b 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h @@ -14,13 +14,13 @@ #include "core/fxcrt/unowned_ptr.h" #include "core/fxcrt/widestring.h" -#include "core/fxcrt/xml/cfx_xmlelement.h" #include "fxjs/jse_define.h" #include "third_party/base/optional.h" #include "third_party/base/span.h" #include "xfa/fxfa/fxfa_basic.h" #include "xfa/fxfa/parser/cxfa_measurement.h" +class CFX_XMLElement; class CFXJSE_Value; class CFX_V8; class CJX_Object; diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h index 50888b8bde..1b7536c836 100644 --- a/xfa/fxfa/cxfa_ffdoc.h +++ b/xfa/fxfa/cxfa_ffdoc.h @@ -12,7 +12,6 @@ #include "core/fxcrt/fx_stream.h" #include "core/fxcrt/unowned_ptr.h" -#include "core/fxcrt/xml/cfx_xmlnode.h" #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/cxfa_document.h" diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index c6b3f54636..643695f34b 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -15,6 +15,7 @@ #include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/xml/cfx_xmlchardata.h" +#include "core/fxcrt/xml/cfx_xmldocument.h" #include "core/fxcrt/xml/cfx_xmlelement.h" #include "core/fxcrt/xml/cfx_xmlinstruction.h" #include "core/fxcrt/xml/cfx_xmlnode.h" diff --git a/xfa/fxfa/parser/cxfa_document_parser.h b/xfa/fxfa/parser/cxfa_document_parser.h index 064475aee3..28b8d61793 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.h +++ b/xfa/fxfa/parser/cxfa_document_parser.h @@ -10,10 +10,12 @@ #include <memory> #include <utility> -#include "core/fxcrt/xml/cfx_xmldocument.h" -#include "core/fxcrt/xml/cfx_xmlnode.h" +#include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" #include "xfa/fxfa/fxfa_basic.h" +class CFX_XMLDocument; +class CFX_XMLNode; class CXFA_Document; class CXFA_Node; class CFX_XMLInstruction; diff --git a/xfa/fxfa/parser/cxfa_document_parser_unittest.cpp b/xfa/fxfa/parser/cxfa_document_parser_unittest.cpp index 7af43e14ad..8024fb80d6 100644 --- a/xfa/fxfa/parser/cxfa_document_parser_unittest.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser_unittest.cpp @@ -5,6 +5,7 @@ #include "xfa/fxfa/parser/cxfa_document_parser.h" #include "core/fxcrt/cfx_readonlymemorystream.h" +#include "core/fxcrt/xml/cfx_xmldocument.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" #include "third_party/base/ptr_util.h" diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 1f44b05a4a..f11542c9ae 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -19,6 +19,7 @@ #include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/locale_iface.h" +#include "core/fxcrt/xml/cfx_xmldocument.h" #include "core/fxcrt/xml/cfx_xmlelement.h" #include "core/fxcrt/xml/cfx_xmlnode.h" #include "core/fxcrt/xml/cfx_xmltext.h" diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index ab06b4b4b7..e8311f42ff 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -12,7 +12,6 @@ #include <vector> #include "core/fxcrt/fx_string.h" -#include "core/fxcrt/xml/cfx_xmlnode.h" #include "core/fxge/fx_dib.h" #include "third_party/base/optional.h" #include "xfa/fxfa/cxfa_ffwidget.h" @@ -20,6 +19,7 @@ class CFGAS_GEFont; class CFX_DIBitmap; +class CFX_XMLNode; class CXFA_Bind; class CXFA_Border; class CXFA_Calculate; |