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

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

Issue 1857073002: Make down-conversion explicit from CFX_Widetring to CFX_WideStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: String argument type 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
« no previous file with comments | « xfa/fxfa/parser/xfa_locale.cpp ('k') | xfa/fxfa/parser/xfa_localevalue.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 #include "xfa/fxfa/parser/xfa_localemgr.h" 7 #include "xfa/fxfa/parser/xfa_localemgr.h"
8 8
9 #include "core/fxcrt/include/fx_xml.h" 9 #include "core/fxcrt/include/fx_xml.h"
10 #include "core/include/fxcodec/fx_codec.h" 10 #include "core/include/fxcodec/fx_codec.h"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 : m_dwLocaleFlags(0x00) { 1125 : m_dwLocaleFlags(0x00) {
1126 m_dwDeflcid = XFA_GetLanguage(wsDeflcid); 1126 m_dwDeflcid = XFA_GetLanguage(wsDeflcid);
1127 CXFA_Node* pNodeLocale = NULL; 1127 CXFA_Node* pNodeLocale = NULL;
1128 if (pLocaleSet && 1128 if (pLocaleSet &&
1129 (pNodeLocale = pLocaleSet->GetNodeItem(XFA_NODEITEM_FirstChild))) { 1129 (pNodeLocale = pLocaleSet->GetNodeItem(XFA_NODEITEM_FirstChild))) {
1130 while (pNodeLocale) { 1130 while (pNodeLocale) {
1131 m_LocaleArray.Add(new CXFA_NodeLocale(pNodeLocale)); 1131 m_LocaleArray.Add(new CXFA_NodeLocale(pNodeLocale));
1132 pNodeLocale = pNodeLocale->GetNodeItem(XFA_NODEITEM_NextSibling); 1132 pNodeLocale = pNodeLocale->GetNodeItem(XFA_NODEITEM_NextSibling);
1133 } 1133 }
1134 } 1134 }
1135 m_pDefLocale = GetLocaleByName(wsDeflcid); 1135 m_pDefLocale = GetLocaleByName(wsDeflcid.AsWideStringC());
1136 } 1136 }
1137 CXFA_LocaleMgr::~CXFA_LocaleMgr() { 1137 CXFA_LocaleMgr::~CXFA_LocaleMgr() {
1138 int32_t iCount = m_LocaleArray.GetSize(); 1138 int32_t iCount = m_LocaleArray.GetSize();
1139 for (int32_t i = 0; i < iCount; i++) { 1139 for (int32_t i = 0; i < iCount; i++) {
1140 ((IFX_Locale*)m_LocaleArray[i])->Release(); 1140 ((IFX_Locale*)m_LocaleArray[i])->Release();
1141 } 1141 }
1142 int32_t iXmls = m_XMLLocaleArray.GetSize(); 1142 int32_t iXmls = m_XMLLocaleArray.GetSize();
1143 for (int32_t j = 0; j < iXmls; j++) { 1143 for (int32_t j = 0; j < iXmls; j++) {
1144 ((IFX_Locale*)m_XMLLocaleArray[j])->Release(); 1144 ((IFX_Locale*)m_XMLLocaleArray[j])->Release();
1145 } 1145 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 ? pChildfConfig->GetFirstChildByClass(XFA_ELEMENT_Common) 1259 ? pChildfConfig->GetFirstChildByClass(XFA_ELEMENT_Common)
1260 : NULL; 1260 : NULL;
1261 CXFA_Node* pLocale = 1261 CXFA_Node* pLocale =
1262 pCommon ? pCommon->GetFirstChildByClass(XFA_ELEMENT_Locale) : NULL; 1262 pCommon ? pCommon->GetFirstChildByClass(XFA_ELEMENT_Locale) : NULL;
1263 if (pLocale) { 1263 if (pLocale) {
1264 pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE); 1264 pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE);
1265 } 1265 }
1266 } 1266 }
1267 m_dwLocaleFlags |= 0x01; 1267 m_dwLocaleFlags |= 0x01;
1268 } 1268 }
1269 return m_wsConfigLocale; 1269 return m_wsConfigLocale.AsWideStringC();
1270 } 1270 }
1271 static CXFA_TimeZoneProvider* g_pProvider = NULL; 1271 static CXFA_TimeZoneProvider* g_pProvider = NULL;
1272 1272
1273 // Static. 1273 // Static.
1274 CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() { 1274 CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() {
1275 FXSYS_assert(!g_pProvider); 1275 FXSYS_assert(!g_pProvider);
1276 g_pProvider = new CXFA_TimeZoneProvider(); 1276 g_pProvider = new CXFA_TimeZoneProvider();
1277 return g_pProvider; 1277 return g_pProvider;
1278 } 1278 }
1279 1279
(...skipping 23 matching lines...) Expand all
1303 m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60); 1303 m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60);
1304 #endif 1304 #endif
1305 } 1305 }
1306 CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() {} 1306 CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() {}
1307 void CXFA_TimeZoneProvider::SetTimeZone(FX_TIMEZONE& tz) { 1307 void CXFA_TimeZoneProvider::SetTimeZone(FX_TIMEZONE& tz) {
1308 m_tz = tz; 1308 m_tz = tz;
1309 } 1309 }
1310 void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE& tz) { 1310 void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE& tz) {
1311 tz = m_tz; 1311 tz = m_tz;
1312 } 1312 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_locale.cpp ('k') | xfa/fxfa/parser/xfa_localevalue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698