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

Side by Side Diff: core/src/fxcrt/fx_xml_parser.cpp

Issue 726143002: Remove FX_LPCWSTR cast to wchar_t* literals (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 1 month 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 | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | fpdfsdk/src/javascript/Consts.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 "../../include/fxcrt/fx_xml.h" 7 #include "../../include/fxcrt/fx_xml.h"
8 #include "xml_int.h" 8 #include "xml_int.h"
9 CXML_Parser::~CXML_Parser() 9 CXML_Parser::~CXML_Parser()
10 { 10 {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } else if (ch == '/') { 465 } else if (ch == '/') {
466 CFX_ByteString space, name; 466 CFX_ByteString space, name;
467 GetName(space, name); 467 GetName(space, name);
468 SkipWhiteSpaces(); 468 SkipWhiteSpaces();
469 m_dwIndex ++; 469 m_dwIndex ++;
470 iState = 10; 470 iState = 10;
471 } else { 471 } else {
472 content << decoder.GetResult(); 472 content << decoder.GetResult();
473 CFX_WideString dataStr = content.GetWideString(); 473 CFX_WideString dataStr = content.GetWideString();
474 if (!bCDATA && !m_bSaveSpaceChars) { 474 if (!bCDATA && !m_bSaveSpaceChars) {
475 dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n"); 475 dataStr.TrimRight(L" \t\r\n");
476 } 476 }
477 InsertContentSegment(bCDATA, dataStr, pElement); 477 InsertContentSegment(bCDATA, dataStr, pElement);
478 content.Clear(); 478 content.Clear();
479 decoder.Clear(); 479 decoder.Clear();
480 bCDATA = FALSE; 480 bCDATA = FALSE;
481 iState = 0; 481 iState = 0;
482 m_dwIndex --; 482 m_dwIndex --;
483 CXML_Element* pSubElement = ParseElement(pElement, TRUE) ; 483 CXML_Element* pSubElement = ParseElement(pElement, TRUE) ;
484 if (pSubElement == NULL) { 484 if (pSubElement == NULL) {
485 break; 485 break;
(...skipping 23 matching lines...) Expand all
509 } 509 }
510 } 510 }
511 m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex; 511 m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
512 if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) { 512 if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) {
513 break; 513 break;
514 } 514 }
515 } while (ReadNextBlock()); 515 } while (ReadNextBlock());
516 content << decoder.GetResult(); 516 content << decoder.GetResult();
517 CFX_WideString dataStr = content.GetWideString(); 517 CFX_WideString dataStr = content.GetWideString();
518 if (!m_bSaveSpaceChars) { 518 if (!m_bSaveSpaceChars) {
519 dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n"); 519 dataStr.TrimRight(L" \t\r\n");
520 } 520 }
521 InsertContentSegment(bCDATA, dataStr, pElement); 521 InsertContentSegment(bCDATA, dataStr, pElement);
522 content.Clear(); 522 content.Clear();
523 decoder.Clear(); 523 decoder.Clear();
524 bCDATA = FALSE; 524 bCDATA = FALSE;
525 return pElement; 525 return pElement;
526 } 526 }
527 void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Ele ment* pElement) 527 void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Ele ment* pElement)
528 { 528 {
529 if (content.IsEmpty()) { 529 if (content.IsEmpty()) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 void CXML_AttrMap::RemoveAll() 861 void CXML_AttrMap::RemoveAll()
862 { 862 {
863 if (!m_pMap) { 863 if (!m_pMap) {
864 return; 864 return;
865 } 865 }
866 m_pMap->RemoveAll(); 866 m_pMap->RemoveAll();
867 delete m_pMap; 867 delete m_pMap;
868 m_pMap = NULL; 868 m_pMap = NULL;
869 } 869 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_wstring.cpp ('k') | fpdfsdk/src/javascript/Consts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698