summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_locale.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-15 12:25:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-15 12:25:29 -0700
commit8e557bd9e7c09f9ce75fbea42f826b74d5cdc54b (patch)
tree64484433a43f21fa73e89c80eddded27d16a3e48 /xfa/fxfa/parser/xfa_locale.cpp
parent1099b29f5569004f8a83be93dbe0c31a3620a9e5 (diff)
downloadpdfium-8e557bd9e7c09f9ce75fbea42f826b74d5cdc54b.tar.xz
Clean up XFA locale and locale manager
Return unique_ptr for GetLocale(), directly use destructors instead of Release() functions, use vectors to manage arrays. Review-Url: https://codereview.chromium.org/2241863002
Diffstat (limited to 'xfa/fxfa/parser/xfa_locale.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_locale.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/xfa_locale.cpp b/xfa/fxfa/parser/xfa_locale.cpp
index 723fdbc15c..686af80576 100644
--- a/xfa/fxfa/parser/xfa_locale.cpp
+++ b/xfa/fxfa/parser/xfa_locale.cpp
@@ -24,11 +24,7 @@ CXFA_XMLLocale::CXFA_XMLLocale(std::unique_ptr<CXML_Element> pLocaleData)
CXFA_XMLLocale::~CXFA_XMLLocale() {}
-void CXFA_XMLLocale::Release() {
- delete this;
-}
-
-CFX_WideString CXFA_XMLLocale::GetName() {
+CFX_WideString CXFA_XMLLocale::GetName() const {
return m_pLocaleData ? m_pLocaleData->GetAttrValue("name") : CFX_WideString();
}
@@ -232,11 +228,7 @@ CXFA_NodeLocale::CXFA_NodeLocale(CXFA_Node* pLocale) : m_pLocale(pLocale) {}
CXFA_NodeLocale::~CXFA_NodeLocale() {}
-void CXFA_NodeLocale::Release() {
- delete this;
-}
-
-CFX_WideString CXFA_NodeLocale::GetName() {
+CFX_WideString CXFA_NodeLocale::GetName() const {
return CFX_WideString(m_pLocale ? m_pLocale->GetCData(XFA_ATTRIBUTE_Name)
: nullptr);
}