summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-13 14:35:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-13 14:35:02 +0000
commit589e4659555c346148b8ef0837961ba8239811d9 (patch)
treeefd84f00eeba205611dd4f50906e5b44be401201
parent753edfbfa7310241c51c61e2045f0f55971c142a (diff)
downloadpdfium-589e4659555c346148b8ef0837961ba8239811d9.tar.xz
Inline CXML_Element private methods.
Bug: 541 Change-Id: I43bb09312b0d7312207e5c235ba80a2593877d07 Reviewed-on: https://pdfium-review.googlesource.com/21070 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--core/fxcrt/xml/cxml_element.cpp39
-rw-r--r--core/fxcrt/xml/cxml_element.h6
2 files changed, 8 insertions, 37 deletions
diff --git a/core/fxcrt/xml/cxml_element.cpp b/core/fxcrt/xml/cxml_element.cpp
index 9e595914dd..ee51004b2c 100644
--- a/core/fxcrt/xml/cxml_element.cpp
+++ b/core/fxcrt/xml/cxml_element.cpp
@@ -72,50 +72,27 @@ void CXML_Element::GetAttrByIndex(int index,
*value = item.m_Value;
}
-bool CXML_Element::GetAttrValue(const ByteStringView& name,
- WideString& attribute) const {
+WideString CXML_Element::GetAttrValue(const ByteStringView& name) const {
ByteStringView bsSpace;
ByteStringView bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- return GetAttrValue(bsSpace, bsName, attribute);
-}
-WideString CXML_Element::GetAttrValue(const ByteStringView& name) const {
WideString attr;
- GetAttrValue(name, attr);
- return attr;
-}
-
-bool CXML_Element::GetAttrValue(const ByteStringView& space,
- const ByteStringView& name,
- WideString& attribute) const {
const WideString* pValue =
- m_AttrMap.Lookup(ByteString(space), ByteString(name));
- if (!pValue)
- return false;
-
- attribute = *pValue;
- return true;
+ m_AttrMap.Lookup(ByteString(bsSpace), ByteString(bsName));
+ if (pValue)
+ attr = *pValue;
+ return attr;
}
-bool CXML_Element::GetAttrInteger(const ByteStringView& name,
- int& attribute) const {
+int CXML_Element::GetAttrInteger(const ByteStringView& name) const {
ByteStringView bsSpace;
ByteStringView bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+
const WideString* pwsValue =
m_AttrMap.Lookup(ByteString(bsSpace), ByteString(bsName));
- if (!pwsValue)
- return false;
-
- attribute = pwsValue->GetInteger();
- return true;
-}
-
-int CXML_Element::GetAttrInteger(const ByteStringView& name) const {
- int attr = 0;
- GetAttrInteger(name, attr);
- return attr;
+ return pwsValue ? pwsValue->GetInteger() : 0;
}
uint32_t CXML_Element::CountElements(const ByteStringView& space,
diff --git a/core/fxcrt/xml/cxml_element.h b/core/fxcrt/xml/cxml_element.h
index 498a0708ad..220eb7bcad 100644
--- a/core/fxcrt/xml/cxml_element.h
+++ b/core/fxcrt/xml/cxml_element.h
@@ -56,12 +56,6 @@ class CXML_Element : public CXML_Object {
const WideString& value);
private:
- bool GetAttrValue(const ByteStringView& name, WideString& attribute) const;
- bool GetAttrValue(const ByteStringView& space,
- const ByteStringView& name,
- WideString& attribute) const;
- bool GetAttrInteger(const ByteStringView& name, int& attribute) const;
-
UnownedPtr<const CXML_Element> const m_pParent;
ByteString m_QSpaceName;
ByteString m_TagName;