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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1428763002: Merge to XFA: Add PDFCharIsLineEnding helper (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | no next file » | 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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 while (PDFCharIsWhitespace(ch)) { 1773 while (PDFCharIsWhitespace(ch)) {
1774 if (!GetNextChar(ch)) 1774 if (!GetNextChar(ch))
1775 return; 1775 return;
1776 } 1776 }
1777 if (ch != '%') 1777 if (ch != '%')
1778 break; 1778 break;
1779 1779
1780 while (1) { 1780 while (1) {
1781 if (!GetNextChar(ch)) 1781 if (!GetNextChar(ch))
1782 return; 1782 return;
1783 if (ch == '\r' || ch == '\n') 1783 if (PDFCharIsLineEnding(ch))
1784 break; 1784 break;
1785 } 1785 }
1786 } 1786 }
1787 1787
1788 if (PDFCharIsDelimiter(ch)) { 1788 if (PDFCharIsDelimiter(ch)) {
1789 m_bIsNumber = FALSE; 1789 m_bIsNumber = FALSE;
1790 m_WordBuffer[m_WordSize++] = ch; 1790 m_WordBuffer[m_WordSize++] = ch;
1791 if (ch == '/') { 1791 if (ch == '/') {
1792 while (1) { 1792 while (1) {
1793 if (!GetNextChar(ch)) 1793 if (!GetNextChar(ch))
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 if (!GetNextChar(ch)) 1992 if (!GetNextChar(ch))
1993 return; 1993 return;
1994 } 1994 }
1995 1995
1996 if (ch != '%') 1996 if (ch != '%')
1997 break; 1997 break;
1998 1998
1999 while (1) { 1999 while (1) {
2000 if (!GetNextChar(ch)) 2000 if (!GetNextChar(ch))
2001 return; 2001 return;
2002 if (ch == '\r' || ch == '\n') 2002 if (PDFCharIsLineEnding(ch))
2003 break; 2003 break;
2004 } 2004 }
2005 } 2005 }
2006 m_Pos--; 2006 m_Pos--;
2007 } 2007 }
2008 2008
2009 CFX_ByteString CPDF_SyntaxParser::GetNextWord(FX_BOOL& bIsNumber) { 2009 CFX_ByteString CPDF_SyntaxParser::GetNextWord(FX_BOOL& bIsNumber) {
2010 GetNextWord(); 2010 GetNextWord();
2011 bIsNumber = m_bIsNumber; 2011 bIsNumber = m_bIsNumber;
2012 return CFX_ByteString((const FX_CHAR*)m_WordBuffer, m_WordSize); 2012 return CFX_ByteString((const FX_CHAR*)m_WordBuffer, m_WordSize);
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3760 if (!GetNextChar(ch)) 3760 if (!GetNextChar(ch))
3761 return FALSE; 3761 return FALSE;
3762 } 3762 }
3763 3763
3764 if (ch != '%') 3764 if (ch != '%')
3765 break; 3765 break;
3766 3766
3767 while (1) { 3767 while (1) {
3768 if (!GetNextChar(ch)) 3768 if (!GetNextChar(ch))
3769 return FALSE; 3769 return FALSE;
3770 if (ch == '\r' || ch == '\n') 3770 if (PDFCharIsLineEnding(ch))
3771 break; 3771 break;
3772 } 3772 }
3773 } 3773 }
3774 3774
3775 if (PDFCharIsDelimiter(ch)) { 3775 if (PDFCharIsDelimiter(ch)) {
3776 m_WordBuffer[m_WordSize++] = ch; 3776 m_WordBuffer[m_WordSize++] = ch;
3777 if (ch == '/') { 3777 if (ch == '/') {
3778 while (1) { 3778 while (1) {
3779 if (!GetNextChar(ch)) 3779 if (!GetNextChar(ch))
3780 return FALSE; 3780 return FALSE;
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
4539 return FALSE; 4539 return FALSE;
4540 } 4540 }
4541 CPDF_PageNode::~CPDF_PageNode() { 4541 CPDF_PageNode::~CPDF_PageNode() {
4542 int32_t iSize = m_childNode.GetSize(); 4542 int32_t iSize = m_childNode.GetSize();
4543 for (int32_t i = 0; i < iSize; ++i) { 4543 for (int32_t i = 0; i < iSize; ++i) {
4544 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; 4544 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i];
4545 delete pNode; 4545 delete pNode;
4546 } 4546 }
4547 m_childNode.RemoveAll(); 4547 m_childNode.RemoveAll();
4548 } 4548 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698