Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: xfa/fxfa/parser/xfa_locale.h

Issue 2227883002: Use smart pointers for class owned pointers in xfa/fxfa (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/cxfa_resolveprocessor.cpp ('k') | xfa/fxfa/parser/xfa_locale.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FXFA_PARSER_XFA_LOCALE_H_ 7 #ifndef XFA_FXFA_PARSER_XFA_LOCALE_H_
8 #define XFA_FXFA_PARSER_XFA_LOCALE_H_ 8 #define XFA_FXFA_PARSER_XFA_LOCALE_H_
9 9
10 #include <memory>
11
10 #include "xfa/fgas/localization/fgas_locale.h" 12 #include "xfa/fgas/localization/fgas_locale.h"
11 #include "xfa/fxfa/parser/xfa_object.h" 13 #include "xfa/fxfa/parser/xfa_object.h"
12 14
13 class CXFA_XMLLocale : public IFX_Locale { 15 class CXFA_XMLLocale : public IFX_Locale {
14 public: 16 public:
15 CXFA_XMLLocale(CXML_Element* pLocaleData); 17 explicit CXFA_XMLLocale(std::unique_ptr<CXML_Element> pLocaleData);
16 18
17 // IFX_Locale 19 // IFX_Locale
18 void Release() override; 20 void Release() override;
19 CFX_WideString GetName() override; 21 CFX_WideString GetName() override;
20 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, 22 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
21 CFX_WideString& wsNumSymbol) const override; 23 CFX_WideString& wsNumSymbol) const override;
22 24
23 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override; 25 void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const override;
24 void GetMonthName(int32_t nMonth, 26 void GetMonthName(int32_t nMonth,
25 CFX_WideString& wsMonthName, 27 CFX_WideString& wsMonthName,
(...skipping 18 matching lines...) Expand all
44 46
45 void GetPattern(CXML_Element* pElement, 47 void GetPattern(CXML_Element* pElement,
46 const CFX_ByteStringC& bsTag, 48 const CFX_ByteStringC& bsTag,
47 const CFX_WideStringC& wsName, 49 const CFX_WideStringC& wsName,
48 CFX_WideString& wsPattern) const; 50 CFX_WideString& wsPattern) const;
49 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol, 51 CFX_WideString GetCalendarSymbol(const CFX_ByteStringC& symbol,
50 int index, 52 int index,
51 FX_BOOL bAbbr) const; 53 FX_BOOL bAbbr) const;
52 54
53 private: 55 private:
54 CXML_Element* m_pLocaleData; 56 std::unique_ptr<CXML_Element> m_pLocaleData;
55 }; 57 };
56 58
57 class CXFA_NodeLocale : public IFX_Locale { 59 class CXFA_NodeLocale : public IFX_Locale {
58 public: 60 public:
59 CXFA_NodeLocale(CXFA_Node* pLocale); 61 CXFA_NodeLocale(CXFA_Node* pLocale);
60 62
61 // IFX_Locale 63 // IFX_Locale
62 void Release() override; 64 void Release() override;
63 CFX_WideString GetName() override; 65 CFX_WideString GetName() override;
64 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, 66 void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType,
(...skipping 22 matching lines...) Expand all
87 ~CXFA_NodeLocale() override; 89 ~CXFA_NodeLocale() override;
88 90
89 CXFA_Node* GetNodeByName(CXFA_Node* pParent, 91 CXFA_Node* GetNodeByName(CXFA_Node* pParent,
90 const CFX_WideStringC& wsName) const; 92 const CFX_WideStringC& wsName) const;
91 CFX_WideString GetSymbol(XFA_Element eElement, 93 CFX_WideString GetSymbol(XFA_Element eElement,
92 const CFX_WideStringC& symbol_type) const; 94 const CFX_WideStringC& symbol_type) const;
93 CFX_WideString GetCalendarSymbol(XFA_Element eElement, 95 CFX_WideString GetCalendarSymbol(XFA_Element eElement,
94 int index, 96 int index,
95 FX_BOOL bAbbr) const; 97 FX_BOOL bAbbr) const;
96 98
97 CXFA_Node* m_pLocale; 99 CXFA_Node* const m_pLocale;
98 }; 100 };
99 101
100 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_ 102 #endif // XFA_FXFA_PARSER_XFA_LOCALE_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/cxfa_resolveprocessor.cpp ('k') | xfa/fxfa/parser/xfa_locale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698