summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-07-03 19:12:34 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-03 19:12:34 +0000
commit95b0293a29b235c746db0f01c8462ca89d7a814e (patch)
treeed5e19f83b4e5d0e90bac2c0764175a8ed7a5b8f /xfa/fgas/crt
parentd96fa3b42797332ab53c05b8e6b6357676838e55 (diff)
downloadpdfium-95b0293a29b235c746db0f01c8462ca89d7a814e.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.h3
-rw-r--r--xfa/fgas/crt/cfgas_formatstring_unittest.cpp1
2 files changed, 3 insertions, 1 deletions
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 <vector>
#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<CXFA_LocaleMgr> 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<CXFA_LocaleMgr>(nullptr, locale);
fmt_ = pdfium::MakeUnique<CFGAS_FormatString>(mgr_.get());
return fmt_.get();