summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-05-02 18:08:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-02 18:08:17 +0000
commit8f893b69012d4f5029cfedf91c5ef653717257a8 (patch)
tree63029b0459277aee7d87c6e6d986885f42b78a54 /core/fxcrt/xml
parent9bd3566d82deb39ea282ddafa4f89930160e637c (diff)
downloadpdfium-8f893b69012d4f5029cfedf91c5ef653717257a8.tar.xz
[xml] Rename CFX_XMLParser::ParseTextChar
This CL renames ParseTextChar to ProcessTextChar to make the usage clearer. The method does not do any parsing, it just decides if the char is part of an entity or not. Change-Id: I9b70a82a421b02e2352cd07bd88b1e581d8578b7 Reviewed-on: https://pdfium-review.googlesource.com/31930 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.cpp8
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp
index b7dbd19eab..b484660f1f 100644
--- a/core/fxcrt/xml/cfx_xmlparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser.cpp
@@ -211,7 +211,7 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() {
m_syntaxParserState = FDE_XmlSyntaxState::Node;
}
} else {
- ParseTextChar(ch);
+ ProcessTextChar(ch);
}
break;
case FDE_XmlSyntaxState::Node:
@@ -340,7 +340,7 @@ FX_XmlSyntaxResult CFX_XMLParser::DoSyntaxParse() {
m_syntaxParserState = FDE_XmlSyntaxState::AttriName;
syntaxParserResult = FX_XmlSyntaxResult::AttriValue;
} else {
- ParseTextChar(ch);
+ ProcessTextChar(ch);
}
break;
case FDE_XmlSyntaxState::CloseInstruction:
@@ -519,7 +519,7 @@ bool CFX_XMLParser::GetStatus() const {
return m_pStream && m_syntaxParserResult != FX_XmlSyntaxResult::Error;
}
-void CFX_XMLParser::ParseTextChar(wchar_t character) {
+void CFX_XMLParser::ProcessTextChar(wchar_t character) {
current_text_.push_back(character);
if (m_iEntityStart > -1 && character == L';') {
@@ -578,8 +578,8 @@ void CFX_XMLParser::ParseTextChar(wchar_t character) {
WideString CFX_XMLParser::GetTextData() {
WideString ret(current_text_.data(), current_text_.size());
- current_text_.clear();
m_iEntityStart = -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 6bf1946402..db8239bd98 100644
--- a/core/fxcrt/xml/cfx_xmlparser.h
+++ b/core/fxcrt/xml/cfx_xmlparser.h
@@ -71,7 +71,7 @@ class CFX_XMLParser {
TargetData
};
- void ParseTextChar(wchar_t ch);
+ void ProcessTextChar(wchar_t ch);
bool GetStatus() const;
CFX_XMLNode* current_node_ = nullptr;