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_resource.h" | 7 #include "../../include/fpdfapi/fpdf_resource.h" |
8 #include "../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../include/fpdftext/fpdf_text.h" | 9 #include "../../include/fpdftext/fpdf_text.h" |
10 #include "../../include/fpdfapi/fpdf_page.h" | 10 #include "../../include/fpdfapi/fpdf_page.h" |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 return FPDFTEXT_MC_PASS; | 1435 return FPDFTEXT_MC_PASS; |
1436 } | 1436 } |
1437 CFX_WideString actText; | 1437 CFX_WideString actText; |
1438 FX_BOOL bExist = FALSE; | 1438 FX_BOOL bExist = FALSE; |
1439 CPDF_Dictionary* pDict = NULL; | 1439 CPDF_Dictionary* pDict = NULL; |
1440 int n = 0; | 1440 int n = 0; |
1441 for (n = 0; n < nContentMark; n++) { | 1441 for (n = 0; n < nContentMark; n++) { |
1442 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1442 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
1443 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1443 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
1444 pDict = (CPDF_Dictionary*)item.GetParam(); | 1444 pDict = (CPDF_Dictionary*)item.GetParam(); |
1445 CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText
")); | 1445 CPDF_String* temp = (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("A
ctualText")) : NULL); |
1446 if (temp) { | 1446 if (temp) { |
1447 bExist = TRUE; | 1447 bExist = TRUE; |
1448 actText = temp->GetUnicodeText(); | 1448 actText = temp->GetUnicodeText(); |
1449 } | 1449 } |
1450 } | 1450 } |
1451 if (!bExist) { | 1451 if (!bExist) { |
1452 return FPDFTEXT_MC_PASS; | 1452 return FPDFTEXT_MC_PASS; |
1453 } | 1453 } |
1454 if (m_pPreTextObj) { | 1454 if (m_pPreTextObj) { |
1455 if (CPDF_ContentMarkData* pPreMarkData = (CPDF_ContentMarkData*)m_pPreTe
xtObj->m_ContentMark.GetObject()) { | 1455 if (CPDF_ContentMarkData* pPreMarkData = (CPDF_ContentMarkData*)m_pPreTe
xtObj->m_ContentMark.GetObject()) { |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2792 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2792 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2793 return; | 2793 return; |
2794 } | 2794 } |
2795 CPDF_LinkExt* link = NULL; | 2795 CPDF_LinkExt* link = NULL; |
2796 link = m_LinkList.GetAt(index); | 2796 link = m_LinkList.GetAt(index); |
2797 if (!link) { | 2797 if (!link) { |
2798 return ; | 2798 return ; |
2799 } | 2799 } |
2800 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2800 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2801 } | 2801 } |
OLD | NEW |