From 98bae9c95d916f528ed1a394e68e02e39ad709fa Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 16 Jul 2018 17:41:46 +0000 Subject: Use UnownedPtr in CXFA_LocaleMgr Change-Id: I74b1828570e54a3868a77231a8ac13bc412c6c43 Reviewed-on: https://pdfium-review.googlesource.com/37051 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- xfa/fxfa/parser/cxfa_localemgr.cpp | 4 ++-- xfa/fxfa/parser/cxfa_localemgr.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index 5ad0ce2438..a6d5b148d8 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -1145,7 +1145,7 @@ CXFA_LocaleMgr::~CXFA_LocaleMgr() {} LocaleIface* CXFA_LocaleMgr::GetDefLocale() { if (m_pDefLocale) - return m_pDefLocale; + return m_pDefLocale.Get(); if (!m_LocaleArray.empty()) return m_LocaleArray[0].get(); @@ -1158,7 +1158,7 @@ LocaleIface* CXFA_LocaleMgr::GetDefLocale() { if (locale) m_XMLLocaleArray.push_back(std::move(locale)); - return m_pDefLocale; + return m_pDefLocale.Get(); } std::unique_ptr CXFA_LocaleMgr::GetLocale(uint16_t lcid) { diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h index c72e23ab5a..a59fdcdda6 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.h +++ b/xfa/fxfa/parser/cxfa_localemgr.h @@ -10,6 +10,7 @@ #include #include +#include "core/fxcrt/unowned_ptr.h" #include "core/fxcrt/widestring.h" class CXFA_Node; @@ -31,7 +32,10 @@ class CXFA_LocaleMgr { std::vector> m_LocaleArray; std::vector> m_XMLLocaleArray; - LocaleIface* m_pDefLocale; // owned by m_LocaleArray or m_XMLLocaleArray. + + // Owned by m_LocaleArray or m_XMLLocaleArray. + UnownedPtr m_pDefLocale; + WideString m_wsConfigLocale; uint16_t m_dwDeflcid; bool m_hasSetLocaleName = false; -- cgit v1.2.3