OLD | NEW |
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/fxcodec/include/fx_codec.h" | 9 #include "core/fxcodec/include/fx_codec.h" |
10 #include "core/fxcrt/include/fx_xml.h" | 10 #include "core/fxcrt/include/fx_xml.h" |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 return pLocale; | 1242 return pLocale; |
1243 } | 1243 } |
1244 void CXFA_LocaleMgr::SetDefLocale(IFX_Locale* pLocale) { | 1244 void CXFA_LocaleMgr::SetDefLocale(IFX_Locale* pLocale) { |
1245 m_pDefLocale = pLocale; | 1245 m_pDefLocale = pLocale; |
1246 } | 1246 } |
1247 CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { | 1247 CFX_WideStringC CXFA_LocaleMgr::GetConfigLocaleName(CXFA_Node* pConfig) { |
1248 if (!(m_dwLocaleFlags & 0x01)) { | 1248 if (!(m_dwLocaleFlags & 0x01)) { |
1249 m_wsConfigLocale.clear(); | 1249 m_wsConfigLocale.clear(); |
1250 if (pConfig) { | 1250 if (pConfig) { |
1251 CXFA_Node* pChildfConfig = | 1251 CXFA_Node* pChildfConfig = |
1252 pConfig->GetFirstChildByClass(XFA_ELEMENT_Acrobat); | 1252 pConfig->GetFirstChildByClass(XFA_Element::Acrobat); |
1253 if (!pChildfConfig) { | 1253 if (!pChildfConfig) { |
1254 pChildfConfig = pConfig->GetFirstChildByClass(XFA_ELEMENT_Present); | 1254 pChildfConfig = pConfig->GetFirstChildByClass(XFA_Element::Present); |
1255 } | 1255 } |
1256 CXFA_Node* pCommon = | 1256 CXFA_Node* pCommon = |
1257 pChildfConfig | 1257 pChildfConfig |
1258 ? pChildfConfig->GetFirstChildByClass(XFA_ELEMENT_Common) | 1258 ? pChildfConfig->GetFirstChildByClass(XFA_Element::Common) |
1259 : NULL; | 1259 : NULL; |
1260 CXFA_Node* pLocale = | 1260 CXFA_Node* pLocale = |
1261 pCommon ? pCommon->GetFirstChildByClass(XFA_ELEMENT_Locale) : NULL; | 1261 pCommon ? pCommon->GetFirstChildByClass(XFA_Element::Locale) : NULL; |
1262 if (pLocale) { | 1262 if (pLocale) { |
1263 pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE); | 1263 pLocale->TryCData(XFA_ATTRIBUTE_Value, m_wsConfigLocale, FALSE); |
1264 } | 1264 } |
1265 } | 1265 } |
1266 m_dwLocaleFlags |= 0x01; | 1266 m_dwLocaleFlags |= 0x01; |
1267 } | 1267 } |
1268 return m_wsConfigLocale.AsStringC(); | 1268 return m_wsConfigLocale.AsStringC(); |
1269 } | 1269 } |
1270 static CXFA_TimeZoneProvider* g_pProvider = NULL; | 1270 static CXFA_TimeZoneProvider* g_pProvider = NULL; |
1271 | 1271 |
(...skipping 30 matching lines...) Expand all Loading... |
1302 m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60); | 1302 m_tz.tzMinute = (int8_t)((FXSYS_abs((int)timezone) % 3600) / 60); |
1303 #endif | 1303 #endif |
1304 } | 1304 } |
1305 CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() {} | 1305 CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() {} |
1306 void CXFA_TimeZoneProvider::SetTimeZone(FX_TIMEZONE& tz) { | 1306 void CXFA_TimeZoneProvider::SetTimeZone(FX_TIMEZONE& tz) { |
1307 m_tz = tz; | 1307 m_tz = tz; |
1308 } | 1308 } |
1309 void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE& tz) { | 1309 void CXFA_TimeZoneProvider::GetTimeZone(FX_TIMEZONE& tz) { |
1310 tz = m_tz; | 1310 tz = m_tz; |
1311 } | 1311 } |
OLD | NEW |