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

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

Issue 1862123003: Rename both As{Byte,Wide}StringC() helpers to AsStringC(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, fix new usage. 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_localemgr.cpp ('k') | xfa/fxfa/parser/xfa_object_imp.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_localevalue.h" 7 #include "xfa/fxfa/parser/xfa_localevalue.h"
8 8
9 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" 9 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
10 #include "xfa/fxfa/parser/xfa_docdata.h" 10 #include "xfa/fxfa/parser/xfa_docdata.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 CFX_Unitime dt; 362 CFX_Unitime dt;
363 FX_DateFromCanonical(m_wsValue, dt); 363 FX_DateFromCanonical(m_wsValue, dt);
364 return dt; 364 return dt;
365 } 365 }
366 return CFX_Unitime(); 366 return CFX_Unitime();
367 } 367 }
368 CFX_Unitime CXFA_LocaleValue::GetTime() const { 368 CFX_Unitime CXFA_LocaleValue::GetTime() const {
369 if (m_bValid && m_dwType == XFA_VT_TIME) { 369 if (m_bValid && m_dwType == XFA_VT_TIME) {
370 CFX_Unitime dt(0); 370 CFX_Unitime dt(0);
371 FXSYS_assert(m_pLocaleMgr); 371 FXSYS_assert(m_pLocaleMgr);
372 FX_TimeFromCanonical(m_wsValue.AsWideStringC(), dt, 372 FX_TimeFromCanonical(m_wsValue.AsStringC(), dt,
373 m_pLocaleMgr->GetDefLocale()); 373 m_pLocaleMgr->GetDefLocale());
374 return dt; 374 return dt;
375 } 375 }
376 return CFX_Unitime(); 376 return CFX_Unitime();
377 } 377 }
378 CFX_Unitime CXFA_LocaleValue::GetDateTime() const { 378 CFX_Unitime CXFA_LocaleValue::GetDateTime() const {
379 if (m_bValid && m_dwType == XFA_VT_DATETIME) { 379 if (m_bValid && m_dwType == XFA_VT_DATETIME) {
380 int32_t index = m_wsValue.Find('T'); 380 int32_t index = m_wsValue.Find('T');
381 CFX_Unitime dt; 381 CFX_Unitime dt;
382 FX_DateFromCanonical(m_wsValue.Left(index), dt); 382 FX_DateFromCanonical(m_wsValue.Left(index), dt);
383 FXSYS_assert(m_pLocaleMgr); 383 FXSYS_assert(m_pLocaleMgr);
384 FX_TimeFromCanonical( 384 FX_TimeFromCanonical(
385 m_wsValue.Right(m_wsValue.GetLength() - index - 1).AsWideStringC(), dt, 385 m_wsValue.Right(m_wsValue.GetLength() - index - 1).AsStringC(), dt,
386 m_pLocaleMgr->GetDefLocale()); 386 m_pLocaleMgr->GetDefLocale());
387 return dt; 387 return dt;
388 } 388 }
389 return CFX_Unitime(); 389 return CFX_Unitime();
390 } 390 }
391 FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText) { 391 FX_BOOL CXFA_LocaleValue::SetText(const CFX_WideString& wsText) {
392 m_dwType = XFA_VT_TEXT; 392 m_dwType = XFA_VT_TEXT;
393 m_wsValue = wsText; 393 m_wsValue = wsText;
394 return TRUE; 394 return TRUE;
395 } 395 }
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 } else if (cf == L'z') { 974 } else if (cf == L'z') {
975 nf++; 975 nf++;
976 } else { 976 } else {
977 return FALSE; 977 return FALSE;
978 } 978 }
979 } 979 }
980 n++; 980 n++;
981 } 981 }
982 return n == nCount; 982 return n == nCount;
983 } 983 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_localemgr.cpp ('k') | xfa/fxfa/parser/xfa_object_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698