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/fxfa/parser/cxfa_localevalue.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_localevalue.h') diff --git a/xfa/fxfa/parser/cxfa_localevalue.h b/xfa/fxfa/parser/cxfa_localevalue.h index cedea10b10..c6f9c1ee98 100644 --- a/xfa/fxfa/parser/cxfa_localevalue.h +++ b/xfa/fxfa/parser/cxfa_localevalue.h @@ -9,6 +9,7 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" +#include "core/fxcrt/unowned_ptr.h" #include "xfa/fxfa/parser/cxfa_node.h" class LocaleIface; @@ -28,7 +29,6 @@ class CXFA_LocaleMgr; class CXFA_LocaleValue { public: CXFA_LocaleValue(); - CXFA_LocaleValue(const CXFA_LocaleValue& value); CXFA_LocaleValue(uint32_t dwType, CXFA_LocaleMgr* pLocaleMgr); CXFA_LocaleValue(uint32_t dwType, const WideString& wsValue, @@ -38,8 +38,10 @@ class CXFA_LocaleValue { const WideString& wsFormat, LocaleIface* pLocale, CXFA_LocaleMgr* pLocaleMgr); + CXFA_LocaleValue(const CXFA_LocaleValue& that); ~CXFA_LocaleValue(); - CXFA_LocaleValue& operator=(const CXFA_LocaleValue& value); + + CXFA_LocaleValue& operator=(const CXFA_LocaleValue& that); bool ValidateValue(const WideString& wsValue, const WideString& wsPattern, @@ -56,6 +58,7 @@ class CXFA_LocaleValue { const WideString& wsFormat, LocaleIface* pLocale); + bool IsValid() const { return m_bValid; } WideString GetValue() const { return m_wsValue; } uint32_t GetType() const { return m_dwType; } double GetDoubleNum() const; @@ -63,8 +66,6 @@ class CXFA_LocaleValue { CFX_DateTime GetDate() const; CFX_DateTime GetTime() const; - bool IsValid() const { return m_bValid; } - private: bool FormatSinglePattern(WideString& wsResult, const WideString& wsFormat, @@ -81,10 +82,10 @@ class CXFA_LocaleValue { const WideString& wsPattern, LocaleIface* pLocale); - CXFA_LocaleMgr* m_pLocaleMgr; + UnownedPtr m_pLocaleMgr; WideString m_wsValue; - uint32_t m_dwType; - bool m_bValid; + uint32_t m_dwType = XFA_VT_NULL; + bool m_bValid = true; }; #endif // XFA_FXFA_PARSER_CXFA_LOCALEVALUE_H_ -- cgit v1.2.3