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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1332 if (nContentMark < 1) { | 1332 if (nContentMark < 1) { |
1333 return FPDFTEXT_MC_PASS; | 1333 return FPDFTEXT_MC_PASS; |
1334 } | 1334 } |
1335 CFX_WideString actText; | 1335 CFX_WideString actText; |
1336 FX_BOOL bExist = FALSE; | 1336 FX_BOOL bExist = FALSE; |
1337 CPDF_Dictionary* pDict = NULL; | 1337 CPDF_Dictionary* pDict = NULL; |
1338 int n = 0; | 1338 int n = 0; |
1339 for (n = 0; n < nContentMark; n++) { | 1339 for (n = 0; n < nContentMark; n++) { |
1340 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1340 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
1341 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1341 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
1342 pDict = (CPDF_Dictionary*)item.GetParam(); | 1342 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
1343 CPDF_String* temp = | 1343 CPDF_String* temp = |
1344 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) | 1344 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) |
1345 : NULL); | 1345 : NULL); |
1346 if (temp) { | 1346 if (temp) { |
1347 bExist = TRUE; | 1347 bExist = TRUE; |
1348 actText = temp->GetUnicodeText(); | 1348 actText = temp->GetUnicodeText(); |
1349 } | 1349 } |
1350 } | 1350 } |
1351 if (!bExist) { | 1351 if (!bExist) { |
1352 return FPDFTEXT_MC_PASS; | 1352 return FPDFTEXT_MC_PASS; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1403 int nContentMark = pMarkData->CountItems(); | 1403 int nContentMark = pMarkData->CountItems(); |
1404 if (nContentMark < 1) { | 1404 if (nContentMark < 1) { |
1405 return; | 1405 return; |
1406 } | 1406 } |
1407 CFX_WideString actText; | 1407 CFX_WideString actText; |
1408 CPDF_Dictionary* pDict = NULL; | 1408 CPDF_Dictionary* pDict = NULL; |
1409 int n = 0; | 1409 int n = 0; |
1410 for (n = 0; n < nContentMark; n++) { | 1410 for (n = 0; n < nContentMark; n++) { |
1411 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); | 1411 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); |
1412 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); | 1412 CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); |
1413 pDict = (CPDF_Dictionary*)item.GetParam(); | 1413 |
1414 CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText")); | 1414 pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
1415 CPDF_String* temp = | |
1416 (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) | |
dsinclair
2015/10/20 19:18:31
On XFA the ternary is missing and it was just:
(C
Tom Sepez
2015/10/20 19:49:28
Acknowledged.
| |
1417 : NULL); | |
1418 | |
1415 if (temp) { | 1419 if (temp) { |
1416 actText = temp->GetUnicodeText(); | 1420 actText = temp->GetUnicodeText(); |
1417 } | 1421 } |
1418 } | 1422 } |
1419 FX_STRSIZE nItems = actText.GetLength(); | 1423 FX_STRSIZE nItems = actText.GetLength(); |
1420 if (nItems < 1) { | 1424 if (nItems < 1) { |
1421 return; | 1425 return; |
1422 } | 1426 } |
1423 CPDF_Font* pFont = pTextObj->GetFont(); | 1427 CPDF_Font* pFont = pTextObj->GetFont(); |
1424 CFX_AffineMatrix formMatrix = Obj.m_formMatrix; | 1428 CFX_AffineMatrix formMatrix = Obj.m_formMatrix; |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2768 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2772 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2769 return; | 2773 return; |
2770 } | 2774 } |
2771 CPDF_LinkExt* link = NULL; | 2775 CPDF_LinkExt* link = NULL; |
2772 link = m_LinkList.GetAt(index); | 2776 link = m_LinkList.GetAt(index); |
2773 if (!link) { | 2777 if (!link) { |
2774 return; | 2778 return; |
2775 } | 2779 } |
2776 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2780 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2777 } | 2781 } |
OLD | NEW |