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 "../../../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 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 { | 2551 { |
2552 FX_INT32 taglen = tag.GetLength(); | 2552 FX_INT32 taglen = tag.GetLength(); |
2553 if (taglen == 0) { | 2553 if (taglen == 0) { |
2554 return FALSE; | 2554 return FALSE; |
2555 } | 2555 } |
2556 FX_FILESIZE pos = m_Pos; | 2556 FX_FILESIZE pos = m_Pos; |
2557 FX_INT32 offset = 0; | 2557 FX_INT32 offset = 0; |
2558 if (!bForward) { | 2558 if (!bForward) { |
2559 offset = taglen - 1; | 2559 offset = taglen - 1; |
2560 } | 2560 } |
2561 FX_LPCBYTE tag_data = tag; | 2561 FX_LPCBYTE tag_data = tag.GetPtr(); |
2562 FX_BYTE byte; | 2562 FX_BYTE byte; |
2563 while (1) { | 2563 while (1) { |
2564 if (bForward) { | 2564 if (bForward) { |
2565 if (limit) { | 2565 if (limit) { |
2566 if (pos >= m_Pos + limit) { | 2566 if (pos >= m_Pos + limit) { |
2567 return FALSE; | 2567 return FALSE; |
2568 } | 2568 } |
2569 } | 2569 } |
2570 if (!GetCharAt(pos, byte)) { | 2570 if (!GetCharAt(pos, byte)) { |
2571 return FALSE; | 2571 return FALSE; |
(...skipping 16 matching lines...) Expand all Loading... |
2588 continue; | 2588 continue; |
2589 } | 2589 } |
2590 } else { | 2590 } else { |
2591 offset --; | 2591 offset --; |
2592 if (offset >= 0) { | 2592 if (offset >= 0) { |
2593 pos --; | 2593 pos --; |
2594 continue; | 2594 continue; |
2595 } | 2595 } |
2596 } | 2596 } |
2597 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos; | 2597 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos; |
2598 if (!bWholeWord || IsWholeWord(startpos, limit, tag, taglen)) { | 2598 if (!bWholeWord || IsWholeWord(startpos, limit, tag.GetPtr(), taglen
)) { |
2599 m_Pos = startpos; | 2599 m_Pos = startpos; |
2600 return TRUE; | 2600 return TRUE; |
2601 } | 2601 } |
2602 } | 2602 } |
2603 if (bForward) { | 2603 if (bForward) { |
2604 offset = byte == tag_data[0] ? 1 : 0; | 2604 offset = byte == tag_data[0] ? 1 : 0; |
2605 pos ++; | 2605 pos ++; |
2606 } else { | 2606 } else { |
2607 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1; | 2607 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1; |
2608 pos --; | 2608 pos --; |
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4642 { | 4642 { |
4643 FX_INT32 iSize = m_childNode.GetSize(); | 4643 FX_INT32 iSize = m_childNode.GetSize(); |
4644 for (FX_INT32 i = 0; i < iSize; ++i) { | 4644 for (FX_INT32 i = 0; i < iSize; ++i) { |
4645 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; | 4645 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; |
4646 if (pNode) { | 4646 if (pNode) { |
4647 delete pNode; | 4647 delete pNode; |
4648 } | 4648 } |
4649 } | 4649 } |
4650 m_childNode.RemoveAll(); | 4650 m_childNode.RemoveAll(); |
4651 } | 4651 } |
OLD | NEW |