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

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

Issue 1095893005: Merge to XFA: Add missing operators for CFX_xxxString combo patch. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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
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/fpdfapi/fpdf_parser.h" 7 #include "../../../include/fpdfapi/fpdf_parser.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_page.h" 9 #include "../../../include/fpdfapi/fpdf_page.h"
10 #include "../../../src/fxcrt/fx_safe_types.h" 10 #include "../../../src/fxcrt/fx_safe_types.h"
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 { 2555 {
2556 FX_INT32 taglen = tag.GetLength(); 2556 FX_INT32 taglen = tag.GetLength();
2557 if (taglen == 0) { 2557 if (taglen == 0) {
2558 return FALSE; 2558 return FALSE;
2559 } 2559 }
2560 FX_FILESIZE pos = m_Pos; 2560 FX_FILESIZE pos = m_Pos;
2561 FX_INT32 offset = 0; 2561 FX_INT32 offset = 0;
2562 if (!bForward) { 2562 if (!bForward) {
2563 offset = taglen - 1; 2563 offset = taglen - 1;
2564 } 2564 }
2565 FX_LPCBYTE tag_data = tag; 2565 FX_LPCBYTE tag_data = tag.GetPtr();
2566 FX_BYTE byte; 2566 FX_BYTE byte;
2567 while (1) { 2567 while (1) {
2568 if (bForward) { 2568 if (bForward) {
2569 if (limit) { 2569 if (limit) {
2570 if (pos >= m_Pos + limit) { 2570 if (pos >= m_Pos + limit) {
2571 return FALSE; 2571 return FALSE;
2572 } 2572 }
2573 } 2573 }
2574 if (!GetCharAt(pos, byte)) { 2574 if (!GetCharAt(pos, byte)) {
2575 return FALSE; 2575 return FALSE;
(...skipping 16 matching lines...) Expand all
2592 continue; 2592 continue;
2593 } 2593 }
2594 } else { 2594 } else {
2595 offset --; 2595 offset --;
2596 if (offset >= 0) { 2596 if (offset >= 0) {
2597 pos --; 2597 pos --;
2598 continue; 2598 continue;
2599 } 2599 }
2600 } 2600 }
2601 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos; 2601 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos;
2602 if (!bWholeWord || IsWholeWord(startpos, limit, tag, taglen)) { 2602 if (!bWholeWord || IsWholeWord(startpos, limit, tag.GetPtr(), taglen )) {
2603 m_Pos = startpos; 2603 m_Pos = startpos;
2604 return TRUE; 2604 return TRUE;
2605 } 2605 }
2606 } 2606 }
2607 if (bForward) { 2607 if (bForward) {
2608 offset = byte == tag_data[0] ? 1 : 0; 2608 offset = byte == tag_data[0] ? 1 : 0;
2609 pos ++; 2609 pos ++;
2610 } else { 2610 } else {
2611 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1; 2611 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1;
2612 pos --; 2612 pos --;
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
4646 { 4646 {
4647 FX_INT32 iSize = m_childNode.GetSize(); 4647 FX_INT32 iSize = m_childNode.GetSize();
4648 for (FX_INT32 i = 0; i < iSize; ++i) { 4648 for (FX_INT32 i = 0; i < iSize; ++i) {
4649 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4649 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4650 if (pNode) { 4650 if (pNode) {
4651 delete pNode; 4651 delete pNode;
4652 } 4652 }
4653 } 4653 }
4654 m_childNode.RemoveAll(); 4654 m_childNode.RemoveAll();
4655 } 4655 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698