| 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 "core/fpdftext/include/cpdf_textpage.h" | 7 #include "core/fpdftext/include/cpdf_textpage.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 CFX_WideString actText; | 815 CFX_WideString actText; |
| 816 bool bExist = false; | 816 bool bExist = false; |
| 817 CPDF_Dictionary* pDict = nullptr; | 817 CPDF_Dictionary* pDict = nullptr; |
| 818 int n = 0; | 818 int n = 0; |
| 819 for (n = 0; n < nContentMark; n++) { | 819 for (n = 0; n < nContentMark; n++) { |
| 820 const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n); | 820 const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n); |
| 821 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None) | 821 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None) |
| 822 continue; | 822 continue; |
| 823 pDict = item.GetParam(); | 823 pDict = item.GetParam(); |
| 824 CPDF_String* temp = | 824 CPDF_String* temp = |
| 825 ToString(pDict ? pDict->GetObjectBy("ActualText") : nullptr); | 825 ToString(pDict ? pDict->GetObjectFor("ActualText") : nullptr); |
| 826 if (temp) { | 826 if (temp) { |
| 827 bExist = true; | 827 bExist = true; |
| 828 actText = temp->GetUnicodeText(); | 828 actText = temp->GetUnicodeText(); |
| 829 } | 829 } |
| 830 } | 830 } |
| 831 if (!bExist) | 831 if (!bExist) |
| 832 return FPDFText_MarkedContent::Pass; | 832 return FPDFText_MarkedContent::Pass; |
| 833 | 833 |
| 834 if (m_pPreTextObj && m_pPreTextObj->m_ContentMark && | 834 if (m_pPreTextObj && m_pPreTextObj->m_ContentMark && |
| 835 m_pPreTextObj->m_ContentMark.CountItems() == n && | 835 m_pPreTextObj->m_ContentMark.CountItems() == n && |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 return; | 877 return; |
| 878 | 878 |
| 879 CFX_WideString actText; | 879 CFX_WideString actText; |
| 880 CPDF_Dictionary* pDict = nullptr; | 880 CPDF_Dictionary* pDict = nullptr; |
| 881 for (int n = 0; n < nContentMark; n++) { | 881 for (int n = 0; n < nContentMark; n++) { |
| 882 const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n); | 882 const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n); |
| 883 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None) | 883 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None) |
| 884 continue; | 884 continue; |
| 885 pDict = item.GetParam(); | 885 pDict = item.GetParam(); |
| 886 if (pDict) | 886 if (pDict) |
| 887 actText = pDict->GetUnicodeTextBy("ActualText"); | 887 actText = pDict->GetUnicodeTextFor("ActualText"); |
| 888 } | 888 } |
| 889 FX_STRSIZE nItems = actText.GetLength(); | 889 FX_STRSIZE nItems = actText.GetLength(); |
| 890 if (nItems < 1) | 890 if (nItems < 1) |
| 891 return; | 891 return; |
| 892 | 892 |
| 893 CPDF_Font* pFont = pTextObj->GetFont(); | 893 CPDF_Font* pFont = pTextObj->GetFont(); |
| 894 CFX_Matrix formMatrix = Obj.m_formMatrix; | 894 CFX_Matrix formMatrix = Obj.m_formMatrix; |
| 895 CFX_Matrix matrix; | 895 CFX_Matrix matrix; |
| 896 pTextObj->GetTextMatrix(&matrix); | 896 pTextObj->GetTextMatrix(&matrix); |
| 897 matrix.Concat(formMatrix); | 897 matrix.Concat(formMatrix); |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 info.m_OriginY); | 1537 info.m_OriginY); |
| 1538 return TRUE; | 1538 return TRUE; |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 FX_BOOL CPDF_TextPage::IsRectIntersect(const CFX_FloatRect& rect1, | 1541 FX_BOOL CPDF_TextPage::IsRectIntersect(const CFX_FloatRect& rect1, |
| 1542 const CFX_FloatRect& rect2) { | 1542 const CFX_FloatRect& rect2) { |
| 1543 CFX_FloatRect rect = rect1; | 1543 CFX_FloatRect rect = rect1; |
| 1544 rect.Intersect(rect2); | 1544 rect.Intersect(rect2); |
| 1545 return !rect.IsEmpty(); | 1545 return !rect.IsEmpty(); |
| 1546 } | 1546 } |
| OLD | NEW |