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 <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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 if (nContentMark < 1) { | 1279 if (nContentMark < 1) { |
1280 return FPDFTEXT_MC_PASS; | 1280 return FPDFTEXT_MC_PASS; |
1281 } | 1281 } |
1282 CFX_WideString actText; | 1282 CFX_WideString actText; |
1283 FX_BOOL bExist = FALSE; | 1283 FX_BOOL bExist = FALSE; |
1284 CPDF_Dictionary* pDict = NULL; | 1284 CPDF_Dictionary* pDict = NULL; |
1285 int n = 0; | 1285 int n = 0; |
1286 for (n = 0; n < nContentMark; n++) { | 1286 for (n = 0; n < nContentMark; n++) { |
1287 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1287 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
1288 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1288 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
1289 pDict = (CPDF_Dictionary*)item.GetParam(); | 1289 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
1290 CPDF_String* temp = | 1290 CPDF_String* temp = |
1291 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) | 1291 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) |
1292 : NULL); | 1292 : NULL); |
1293 if (temp) { | 1293 if (temp) { |
1294 bExist = TRUE; | 1294 bExist = TRUE; |
1295 actText = temp->GetUnicodeText(); | 1295 actText = temp->GetUnicodeText(); |
1296 } | 1296 } |
1297 } | 1297 } |
1298 if (!bExist) { | 1298 if (!bExist) { |
1299 return FPDFTEXT_MC_PASS; | 1299 return FPDFTEXT_MC_PASS; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 int nContentMark = pMarkData->CountItems(); | 1350 int nContentMark = pMarkData->CountItems(); |
1351 if (nContentMark < 1) { | 1351 if (nContentMark < 1) { |
1352 return; | 1352 return; |
1353 } | 1353 } |
1354 CFX_WideString actText; | 1354 CFX_WideString actText; |
1355 CPDF_Dictionary* pDict = NULL; | 1355 CPDF_Dictionary* pDict = NULL; |
1356 int n = 0; | 1356 int n = 0; |
1357 for (n = 0; n < nContentMark; n++) { | 1357 for (n = 0; n < nContentMark; n++) { |
1358 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1358 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
1359 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1359 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
1360 pDict = (CPDF_Dictionary*)item.GetParam(); | 1360 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
1361 CPDF_String* temp = | 1361 CPDF_String* temp = |
1362 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) | 1362 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) |
1363 : NULL); | 1363 : NULL); |
1364 if (temp) { | 1364 if (temp) { |
1365 actText = temp->GetUnicodeText(); | 1365 actText = temp->GetUnicodeText(); |
1366 } | 1366 } |
1367 } | 1367 } |
1368 FX_STRSIZE nItems = actText.GetLength(); | 1368 FX_STRSIZE nItems = actText.GetLength(); |
1369 if (nItems < 1) { | 1369 if (nItems < 1) { |
1370 return; | 1370 return; |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2728 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2728 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
2729 return; | 2729 return; |
2730 } | 2730 } |
2731 CPDF_LinkExt* link = NULL; | 2731 CPDF_LinkExt* link = NULL; |
2732 link = m_LinkList.GetAt(index); | 2732 link = m_LinkList.GetAt(index); |
2733 if (!link) { | 2733 if (!link) { |
2734 return; | 2734 return; |
2735 } | 2735 } |
2736 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2736 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2737 } | 2737 } |
OLD | NEW |