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

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

Issue 1846993002: Remove IXFA_* interfaces. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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
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 #include "xfa/fxfa/parser/xfa_locale.h" 7 #include "xfa/fxfa/parser/xfa_locale.h"
8 8
9 #include "core/fxcrt/include/fx_xml.h" 9 #include "core/fxcrt/include/fx_xml.h"
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void CXFA_XMLLocale::GetDayName(int32_t nWeek, 100 void CXFA_XMLLocale::GetDayName(int32_t nWeek,
101 CFX_WideString& wsDayName, 101 CFX_WideString& wsDayName,
102 FX_BOOL bAbbr) const { 102 FX_BOOL bAbbr) const {
103 wsDayName = GetCalendarSymbol("day", nWeek, bAbbr); 103 wsDayName = GetCalendarSymbol("day", nWeek, bAbbr);
104 } 104 }
105 void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, 105 void CXFA_XMLLocale::GetMeridiemName(CFX_WideString& wsMeridiemName,
106 FX_BOOL bAM) const { 106 FX_BOOL bAM) const {
107 wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE); 107 wsMeridiemName = GetCalendarSymbol("meridiem", bAM ? 0 : 1, FALSE);
108 } 108 }
109 void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const { 109 void CXFA_XMLLocale::GetTimeZone(FX_TIMEZONE& tz) const {
110 IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); 110 CXFA_TimeZoneProvider* pProvider = CXFA_TimeZoneProvider::Get();
Tom Sepez 2016/03/31 17:01:57 nit: local not needed.
dsinclair 2016/03/31 19:52:27 Done.
111 pProvider->GetTimeZone(tz); 111 pProvider->GetTimeZone(tz);
112 } 112 }
113 void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { 113 void CXFA_XMLLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const {
114 wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE); 114 wsEraName = GetCalendarSymbol("era", bAD ? 1 : 0, FALSE);
115 } 115 }
116 CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol, 116 CFX_WideString CXFA_XMLLocale::GetCalendarSymbol(const CFX_ByteStringC& symbol,
117 int index, 117 int index,
118 FX_BOOL bAbbr) const { 118 FX_BOOL bAbbr) const {
119 CFX_ByteString pstrSymbolNames = symbol + "Names"; 119 CFX_ByteString pstrSymbolNames = symbol + "Names";
120 CFX_WideString wsSymbolName = L""; 120 CFX_WideString wsSymbolName = L"";
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 void CXFA_NodeLocale::GetDayName(int32_t nWeek, 270 void CXFA_NodeLocale::GetDayName(int32_t nWeek,
271 CFX_WideString& wsDayName, 271 CFX_WideString& wsDayName,
272 FX_BOOL bAbbr) const { 272 FX_BOOL bAbbr) const {
273 wsDayName = GetCalendarSymbol(XFA_ELEMENT_DayNames, nWeek, bAbbr); 273 wsDayName = GetCalendarSymbol(XFA_ELEMENT_DayNames, nWeek, bAbbr);
274 } 274 }
275 void CXFA_NodeLocale::GetMeridiemName(CFX_WideString& wsMeridiemName, 275 void CXFA_NodeLocale::GetMeridiemName(CFX_WideString& wsMeridiemName,
276 FX_BOOL bAM) const { 276 FX_BOOL bAM) const {
277 wsMeridiemName = 277 wsMeridiemName =
278 GetCalendarSymbol(XFA_ELEMENT_MeridiemNames, bAM ? 0 : 1, FALSE); 278 GetCalendarSymbol(XFA_ELEMENT_MeridiemNames, bAM ? 0 : 1, FALSE);
279 } 279 }
280 void CXFA_NodeLocale::GetTimeZone(FX_TIMEZONE& tz) const { 280 void CXFA_NodeLocale::GetTimeZone(FX_TIMEZONE& tz) const {
Tom Sepez 2016/03/31 17:01:57 nit: local not needed.
dsinclair 2016/03/31 19:52:27 Done.
281 IXFA_TimeZoneProvider* pProvider = IXFA_TimeZoneProvider::Get(); 281 CXFA_TimeZoneProvider* pProvider = CXFA_TimeZoneProvider::Get();
282 pProvider->GetTimeZone(tz); 282 pProvider->GetTimeZone(tz);
283 } 283 }
284 void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const { 284 void CXFA_NodeLocale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const {
285 wsEraName = GetCalendarSymbol(XFA_ELEMENT_EraNames, bAD ? 1 : 0, FALSE); 285 wsEraName = GetCalendarSymbol(XFA_ELEMENT_EraNames, bAD ? 1 : 0, FALSE);
286 } 286 }
287 void CXFA_NodeLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType, 287 void CXFA_NodeLocale::GetDatePattern(FX_LOCALEDATETIMESUBCATEGORY eType,
288 CFX_WideString& wsPattern) const { 288 CFX_WideString& wsPattern) const {
289 switch (eType) { 289 switch (eType) {
290 case FX_LOCALEDATETIMESUBCATEGORY_Short: 290 case FX_LOCALEDATETIMESUBCATEGORY_Short:
291 wsPattern = GetSymbol(XFA_ELEMENT_DatePatterns, FX_WSTRC(L"short")); 291 wsPattern = GetSymbol(XFA_ELEMENT_DatePatterns, FX_WSTRC(L"short"));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 CXFA_Node* pNode = pCalendar->GetFirstChildByClass(eElement); 368 CXFA_Node* pNode = pCalendar->GetFirstChildByClass(eElement);
369 for (; pNode; pNode = pNode->GetNextSameClassSibling(eElement)) { 369 for (; pNode; pNode = pNode->GetNextSameClassSibling(eElement)) {
370 if (pNode->GetBoolean(XFA_ATTRIBUTE_Abbr) == bAbbr) { 370 if (pNode->GetBoolean(XFA_ATTRIBUTE_Abbr) == bAbbr) {
371 CXFA_Node* pSymbol = pNode->GetChild(index, XFA_ELEMENT_UNKNOWN); 371 CXFA_Node* pSymbol = pNode->GetChild(index, XFA_ELEMENT_UNKNOWN);
372 return pSymbol ? pSymbol->GetContent() : CFX_WideString(); 372 return pSymbol ? pSymbol->GetContent() : CFX_WideString();
373 } 373 }
374 } 374 }
375 } 375 }
376 return CFX_WideString(); 376 return CFX_WideString();
377 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698