From 95b0293a29b235c746db0f01c8462ca89d7a814e Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 3 Jul 2018 19:12:34 +0000 Subject: Use more UnowendPtr<> in cfgas_formatstring.h and cfx_break.h Move initializers to .h file (proves none missing). Change-Id: Iff8fe76e46634aa32a32ecd592476594a9d1bafa Reviewed-on: https://pdfium-review.googlesource.com/36950 Reviewed-by: dsinclair Commit-Queue: dsinclair --- xfa/fgas/crt/cfgas_formatstring.h | 3 ++- xfa/fgas/crt/cfgas_formatstring_unittest.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'xfa/fgas/crt') diff --git a/xfa/fgas/crt/cfgas_formatstring.h b/xfa/fgas/crt/cfgas_formatstring.h index 2cc5d569cd..3cbe6ff65a 100644 --- a/xfa/fgas/crt/cfgas_formatstring.h +++ b/xfa/fgas/crt/cfgas_formatstring.h @@ -10,6 +10,7 @@ #include #include "core/fxcrt/locale_iface.h" +#include "core/fxcrt/unowned_ptr.h" #include "xfa/fxfa/parser/cxfa_localemgr.h" bool FX_DateFromCanonical(const WideString& wsDate, CFX_DateTime* datetime); @@ -67,7 +68,7 @@ class CFGAS_FormatString { WideString* wsDatePattern, WideString* wsTimePattern); - CXFA_LocaleMgr* m_pLocaleMgr; + UnownedPtr m_pLocaleMgr; }; #endif // XFA_FGAS_CRT_CFGAS_FORMATSTRING_H_ diff --git a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp index 51c001090c..afbd00f068 100644 --- a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp +++ b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp @@ -44,6 +44,7 @@ class CFGAS_FormatStringTest : public testing::Test { // Note, this re-creates the fmt on each call. If you need to multiple // times store it locally. CFGAS_FormatString* fmt(const WideString& locale) { + fmt_.reset(); // Can't outlive |mgr_|. mgr_ = pdfium::MakeUnique(nullptr, locale); fmt_ = pdfium::MakeUnique(mgr_.get()); return fmt_.get(); -- cgit v1.2.3