| 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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = ToDictionary(static_cast<CPDF_Object*>(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 ToString(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : nullptr); |
| 1292 : NULL); | |
| 1293 if (temp) { | 1292 if (temp) { |
| 1294 bExist = TRUE; | 1293 bExist = TRUE; |
| 1295 actText = temp->GetUnicodeText(); | 1294 actText = temp->GetUnicodeText(); |
| 1296 } | 1295 } |
| 1297 } | 1296 } |
| 1298 if (!bExist) { | 1297 if (!bExist) { |
| 1299 return FPDFTEXT_MC_PASS; | 1298 return FPDFTEXT_MC_PASS; |
| 1300 } | 1299 } |
| 1301 if (m_pPreTextObj) { | 1300 if (m_pPreTextObj) { |
| 1302 if (CPDF_ContentMarkData* pPreMarkData = | 1301 if (CPDF_ContentMarkData* pPreMarkData = |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 return; | 1351 return; |
| 1353 } | 1352 } |
| 1354 CFX_WideString actText; | 1353 CFX_WideString actText; |
| 1355 CPDF_Dictionary* pDict = NULL; | 1354 CPDF_Dictionary* pDict = NULL; |
| 1356 int n = 0; | 1355 int n = 0; |
| 1357 for (n = 0; n < nContentMark; n++) { | 1356 for (n = 0; n < nContentMark; n++) { |
| 1358 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1357 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
| 1359 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1358 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
| 1360 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); | 1359 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
| 1361 CPDF_String* temp = | 1360 CPDF_String* temp = |
| 1362 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) | 1361 ToString(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : nullptr); |
| 1363 : NULL); | |
| 1364 if (temp) { | 1362 if (temp) { |
| 1365 actText = temp->GetUnicodeText(); | 1363 actText = temp->GetUnicodeText(); |
| 1366 } | 1364 } |
| 1367 } | 1365 } |
| 1368 FX_STRSIZE nItems = actText.GetLength(); | 1366 FX_STRSIZE nItems = actText.GetLength(); |
| 1369 if (nItems < 1) { | 1367 if (nItems < 1) { |
| 1370 return; | 1368 return; |
| 1371 } | 1369 } |
| 1372 CPDF_Font* pFont = pTextObj->GetFont(); | 1370 CPDF_Font* pFont = pTextObj->GetFont(); |
| 1373 CFX_AffineMatrix formMatrix = Obj.m_formMatrix; | 1371 CFX_AffineMatrix formMatrix = Obj.m_formMatrix; |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { | 2726 if (!m_bIsParsed || index < 0 || index >= m_LinkList.GetSize()) { |
| 2729 return; | 2727 return; |
| 2730 } | 2728 } |
| 2731 CPDF_LinkExt* link = NULL; | 2729 CPDF_LinkExt* link = NULL; |
| 2732 link = m_LinkList.GetAt(index); | 2730 link = m_LinkList.GetAt(index); |
| 2733 if (!link) { | 2731 if (!link) { |
| 2734 return; | 2732 return; |
| 2735 } | 2733 } |
| 2736 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2734 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
| 2737 } | 2735 } |
| OLD | NEW |