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

Side by Side Diff: core/src/fpdftext/fpdf_text_int.cpp

Issue 1411833003: XFA: Manually apply changes to fpdf_text.h and fx_font.h from master (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Fix NULL comparisons. Created 5 years, 2 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 | « core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fpdftext/text_int.h » ('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 <ctype.h> 7 #include <ctype.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "../../../third_party/base/nonstd_unique_ptr.h" 10 #include "../../../third_party/base/nonstd_unique_ptr.h"
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 int CPDF_TextPageFind::GetMatchedCount() const { 2554 int CPDF_TextPageFind::GetMatchedCount() const {
2555 int resStart = GetCharIndex(m_resStart); 2555 int resStart = GetCharIndex(m_resStart);
2556 int resEnd = GetCharIndex(m_resEnd); 2556 int resEnd = GetCharIndex(m_resEnd);
2557 return resEnd - resStart + 1; 2557 return resEnd - resStart + 1;
2558 } 2558 }
2559 CPDF_LinkExtract::CPDF_LinkExtract() : m_pTextPage(NULL), m_IsParserd(FALSE) {} 2559 CPDF_LinkExtract::CPDF_LinkExtract() : m_pTextPage(NULL), m_IsParserd(FALSE) {}
2560 CPDF_LinkExtract::~CPDF_LinkExtract() { 2560 CPDF_LinkExtract::~CPDF_LinkExtract() {
2561 DeleteLinkList(); 2561 DeleteLinkList();
2562 } 2562 }
2563 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) { 2563 FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage) {
2564 if (!pTextPage || !pTextPage->IsParsered()) { 2564 if (!pTextPage || !pTextPage->IsParsed()) {
2565 return FALSE; 2565 return FALSE;
2566 } 2566 }
2567 m_pTextPage = (const CPDF_TextPage*)pTextPage; 2567 m_pTextPage = (const CPDF_TextPage*)pTextPage;
2568 m_strPageText = m_pTextPage->GetPageText(0, -1); 2568 m_strPageText = m_pTextPage->GetPageText(0, -1);
2569 DeleteLinkList(); 2569 DeleteLinkList();
2570 if (m_strPageText.IsEmpty()) { 2570 if (m_strPageText.IsEmpty()) {
2571 return FALSE; 2571 return FALSE;
2572 } 2572 }
2573 parserLink(); 2573 parserLink();
2574 m_IsParserd = TRUE; 2574 m_IsParserd = TRUE;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { 2769 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
2770 return; 2770 return;
2771 } 2771 }
2772 CPDF_LinkExt* link = NULL; 2772 CPDF_LinkExt* link = NULL;
2773 link = m_LinkList.GetAt(index); 2773 link = m_LinkList.GetAt(index);
2774 if (!link) { 2774 if (!link) {
2775 return; 2775 return;
2776 } 2776 }
2777 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); 2777 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects);
2778 } 2778 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp ('k') | core/src/fpdftext/text_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698