Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: core/fpdftext/fpdf_text_int.cpp

Issue 1938163002: More define cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdftext/include/cpdf_textpage.h » ('j') | xfa/fwl/core/fwl_noteimp.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <cctype> 8 #include <cctype>
9 #include <cwctype> 9 #include <cwctype>
10 #include <memory> 10 #include <memory>
(...skipping 10 matching lines...) Expand all
21 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" 21 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h"
22 #include "core/fpdftext/include/cpdf_linkextract.h" 22 #include "core/fpdftext/include/cpdf_linkextract.h"
23 #include "core/fpdftext/include/cpdf_textpage.h" 23 #include "core/fpdftext/include/cpdf_textpage.h"
24 #include "core/fpdftext/include/cpdf_textpagefind.h" 24 #include "core/fpdftext/include/cpdf_textpagefind.h"
25 #include "core/fpdftext/unicodenormalizationdata.h" 25 #include "core/fpdftext/unicodenormalizationdata.h"
26 #include "core/fxcrt/fx_bidi.h" 26 #include "core/fxcrt/fx_bidi.h"
27 #include "core/fxcrt/include/fx_ext.h" 27 #include "core/fxcrt/include/fx_ext.h"
28 #include "core/fxcrt/include/fx_ucd.h" 28 #include "core/fxcrt/include/fx_ucd.h"
29 #include "third_party/base/stl_util.h" 29 #include "third_party/base/stl_util.h"
30 30
31 #define FPDFTEXT_RLTB 1
32 #define FPDFTEXT_LEFT -1
33 #define FPDFTEXT_RIGHT 1
dsinclair 2016/05/02 20:59:55 RLTB and RIGHT were both the same value so I remov
Tom Sepez 2016/05/02 21:45:39 Acknowledged.
34
35 #define FPDFTEXT_MATCHCASE 0x00000001 31 #define FPDFTEXT_MATCHCASE 0x00000001
36 #define FPDFTEXT_MATCHWHOLEWORD 0x00000002 32 #define FPDFTEXT_MATCHWHOLEWORD 0x00000002
37 #define FPDFTEXT_CONSECUTIVE 0x00000004 33 #define FPDFTEXT_CONSECUTIVE 0x00000004
38 34
39 #define FPDFTEXT_CHAR_ERROR -1 35 #define FPDFTEXT_CHAR_ERROR -1
40 #define FPDFTEXT_CHAR_NORMAL 0 36 #define FPDFTEXT_CHAR_NORMAL 0
41 #define FPDFTEXT_CHAR_GENERATED 1 37 #define FPDFTEXT_CHAR_GENERATED 1
42 #define FPDFTEXT_CHAR_UNUNICODE 2 38 #define FPDFTEXT_CHAR_UNUNICODE 2
43 #define FPDFTEXT_CHAR_HYPHEN 3 39 #define FPDFTEXT_CHAR_HYPHEN 3
44 #define FPDFTEXT_CHAR_PIECE 4 40 #define FPDFTEXT_CHAR_PIECE 4
45 #define FPDFTEXT_MC_PASS 0 41
46 #define FPDFTEXT_MC_DONE 1 42 #define TEXT_BLANK_CHAR L' '
47 #define FPDFTEXT_MC_DELAY 2 43 #define TEXT_LINEFEED_CHAR L'\n'
44 #define TEXT_RETURN_CHAR L'\r'
45 #define TEXT_EMPTY L""
46 #define TEXT_BLANK L" "
47 #define TEXT_RETURN_LINEFEED L"\r\n"
48 #define TEXT_LINEFEED L"\n"
49 #define TEXT_CHARRATIO_GAPDELTA 0.070
48 50
49 namespace { 51 namespace {
50 52
51 const FX_FLOAT kDefaultFontSize = 1.0f; 53 const FX_FLOAT kDefaultFontSize = 1.0f;
52 const uint16_t* const g_UnicodeData_Normalization_Maps[5] = { 54 const uint16_t* const g_UnicodeData_Normalization_Maps[5] = {
53 nullptr, g_UnicodeData_Normalization_Map1, g_UnicodeData_Normalization_Map2, 55 nullptr, g_UnicodeData_Normalization_Map1, g_UnicodeData_Normalization_Map2,
54 g_UnicodeData_Normalization_Map3, g_UnicodeData_Normalization_Map4}; 56 g_UnicodeData_Normalization_Map3, g_UnicodeData_Normalization_Map4};
55 57
56 FX_BOOL IsIgnoreSpaceCharacter(FX_WCHAR curChar) { 58 FX_BOOL IsIgnoreSpaceCharacter(FX_WCHAR curChar) {
57 if (curChar < 255) { 59 if (curChar < 255) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 FX_WCHAR n = wFind; 138 FX_WCHAR n = wFind;
137 while (n--) { 139 while (n--) {
138 *pDst++ = *pMap++; 140 *pDst++ = *pMap++;
139 } 141 }
140 } 142 }
141 return (FX_STRSIZE)wFind; 143 return (FX_STRSIZE)wFind;
142 } 144 }
143 145
144 } // namespace 146 } // namespace
145 147
146 #define TEXT_BLANK_CHAR L' ' 148 CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, FPDFText_Direction flags)
147 #define TEXT_LINEFEED_CHAR L'\n'
148 #define TEXT_RETURN_CHAR L'\r'
149 #define TEXT_EMPTY L""
150 #define TEXT_BLANK L" "
151 #define TEXT_RETURN_LINEFEED L"\r\n"
152 #define TEXT_LINEFEED L"\n"
153 #define TEXT_CHARRATIO_GAPDELTA 0.070
154
155 CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, int flags)
156 : m_pPage(pPage), 149 : m_pPage(pPage),
157 m_parserflag(flags), 150 m_parserflag(flags),
158 m_pPreTextObj(nullptr), 151 m_pPreTextObj(nullptr),
159 m_bIsParsed(false), 152 m_bIsParsed(false),
160 m_TextlineDir(-1), 153 m_TextlineDir(-1),
161 m_CurlineRect(0, 0, 0, 0) { 154 m_CurlineRect(0, 0, 0, 0) {
162 m_TextBuf.EstimateSize(0, 10240); 155 m_TextBuf.EstimateSize(0, 10240);
163 pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int)pPage->GetPageWidth(), 156 pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int)pPage->GetPageWidth(),
164 (int)pPage->GetPageHeight(), 0); 157 (int)pPage->GetPageHeight(), 0);
165 } 158 }
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 } 713 }
721 if (segmentStatus == 1) { 714 if (segmentStatus == 1) {
722 segmentStatus = 2; 715 segmentStatus = 2;
723 m_Segments.Add(segment); 716 m_Segments.Add(segment);
724 segment.m_Start = 0; 717 segment.m_Start = 0;
725 segment.m_nCount = 0; 718 segment.m_nCount = 0;
726 } 719 }
727 return m_Segments.GetSize(); 720 return m_Segments.GetSize();
728 } 721 }
729 722
730 int CPDF_TextPage::GetWordBreak(int index, int direction) const { 723 int CPDF_TextPage::GetWordBreak(int index, FPDFText_Direction direction) const {
731 if (!m_bIsParsed) 724 if (!m_bIsParsed)
732 return -1; 725 return -1;
733 726
734 if (direction != FPDFTEXT_LEFT && direction != FPDFTEXT_RIGHT)
Tom Sepez 2016/05/02 21:45:39 given values of -1 and 1, is it possible that they
dsinclair 2016/05/03 13:58:16 Turns out, GetWordBreak is never called. Removed.
735 return -1;
736
737 if (index < 0 || index >= pdfium::CollectionSize<int>(m_CharList)) 727 if (index < 0 || index >= pdfium::CollectionSize<int>(m_CharList))
738 return -1; 728 return -1;
739 729
740 const PAGECHAR_INFO& charinfo = m_CharList[index]; 730 const PAGECHAR_INFO& charinfo = m_CharList[index];
741 if (charinfo.m_Index == -1 || charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) { 731 if (charinfo.m_Index == -1 || charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
742 return index; 732 return index;
743 } 733 }
744 if (!IsLetter(charinfo.m_Unicode)) { 734 if (!IsLetter(charinfo.m_Unicode)) {
745 return index; 735 return index;
746 } 736 }
747 int breakPos = index; 737 int breakPos = index;
748 if (direction == FPDFTEXT_LEFT) { 738 if (direction == FPDFText_Direction::Left) {
749 while (--breakPos > 0) { 739 while (--breakPos > 0) {
750 if (!IsLetter(m_CharList[breakPos].m_Unicode)) 740 if (!IsLetter(m_CharList[breakPos].m_Unicode))
751 break; 741 break;
752 } 742 }
753 } else if (direction == FPDFTEXT_RIGHT) { 743 } else if (direction == FPDFText_Direction::Right) {
754 while (++breakPos < pdfium::CollectionSize<int>(m_CharList)) { 744 while (++breakPos < pdfium::CollectionSize<int>(m_CharList)) {
755 if (!IsLetter(m_CharList[breakPos].m_Unicode)) 745 if (!IsLetter(m_CharList[breakPos].m_Unicode))
756 break; 746 break;
757 } 747 }
758 } 748 }
759 return breakPos; 749 return breakPos;
760 } 750 }
761 751
762 int32_t CPDF_TextPage::FindTextlineFlowDirection() { 752 int32_t CPDF_TextPage::FindTextlineFlowDirection() {
763 const int32_t nPageWidth = static_cast<int32_t>(m_pPage->GetPageWidth()); 753 const int32_t nPageWidth = static_cast<int32_t>(m_pPage->GetPageWidth());
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 } 979 }
990 if (bPrevSpace) { 980 if (bPrevSpace) {
991 m_TempTextBuf.Delete(i, 1); 981 m_TempTextBuf.Delete(i, 1);
992 m_TempCharList.erase(m_TempCharList.begin() + i); 982 m_TempCharList.erase(m_TempCharList.begin() + i);
993 str.Delete(i); 983 str.Delete(i);
994 i--; 984 i--;
995 } 985 }
996 bPrevSpace = TRUE; 986 bPrevSpace = TRUE;
997 } 987 }
998 CFX_BidiString bidi(str); 988 CFX_BidiString bidi(str);
999 if (m_parserflag == FPDFTEXT_RLTB) 989 if (m_parserflag == FPDFText_Direction::Right)
1000 bidi.SetOverallDirectionRight(); 990 bidi.SetOverallDirectionRight();
1001 CFX_BidiChar::Direction eCurrentDirection = bidi.OverallDirection(); 991 CFX_BidiChar::Direction eCurrentDirection = bidi.OverallDirection();
1002 for (const auto& segment : bidi) { 992 for (const auto& segment : bidi) {
1003 if (segment.direction == CFX_BidiChar::RIGHT || 993 if (segment.direction == CFX_BidiChar::RIGHT ||
1004 (segment.direction == CFX_BidiChar::NEUTRAL && 994 (segment.direction == CFX_BidiChar::NEUTRAL &&
1005 eCurrentDirection == CFX_BidiChar::RIGHT)) { 995 eCurrentDirection == CFX_BidiChar::RIGHT)) {
1006 eCurrentDirection = CFX_BidiChar::RIGHT; 996 eCurrentDirection = CFX_BidiChar::RIGHT;
1007 for (int m = segment.start + segment.count; m > segment.start; --m) 997 for (int m = segment.start + segment.count; m > segment.start; --m)
1008 AddCharInfoByRLDirection(bidi.CharAt(m - 1), m_TempCharList[m - 1]); 998 AddCharInfoByRLDirection(bidi.CharAt(m - 1), m_TempCharList[m - 1]);
1009 } else { 999 } else {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 m_LineObj.InsertAt(i + 1, Obj); 1081 m_LineObj.InsertAt(i + 1, Obj);
1092 } 1082 }
1093 break; 1083 break;
1094 } 1084 }
1095 } 1085 }
1096 if (i < 0) { 1086 if (i < 0) {
1097 m_LineObj.InsertAt(0, Obj); 1087 m_LineObj.InsertAt(0, Obj);
1098 } 1088 }
1099 } 1089 }
1100 1090
1101 int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) { 1091 FPDFText_MarkedContent CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) {
1102 CPDF_TextObject* pTextObj = Obj.m_pTextObj; 1092 CPDF_TextObject* pTextObj = Obj.m_pTextObj;
1103 CPDF_ContentMarkData* pMarkData = 1093 CPDF_ContentMarkData* pMarkData =
1104 (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject(); 1094 (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
1105 if (!pMarkData) 1095 if (!pMarkData)
1106 return FPDFTEXT_MC_PASS; 1096 return FPDFText_MarkedContent::Pass;
1107 1097
1108 int nContentMark = pMarkData->CountItems(); 1098 int nContentMark = pMarkData->CountItems();
1109 if (nContentMark < 1) 1099 if (nContentMark < 1)
1110 return FPDFTEXT_MC_PASS; 1100 return FPDFText_MarkedContent::Pass;
1101
1111 CFX_WideString actText; 1102 CFX_WideString actText;
1112 FX_BOOL bExist = FALSE; 1103 FX_BOOL bExist = FALSE;
1113 CPDF_Dictionary* pDict = NULL; 1104 CPDF_Dictionary* pDict = NULL;
1114 int n = 0; 1105 int n = 0;
1115 for (n = 0; n < nContentMark; n++) { 1106 for (n = 0; n < nContentMark; n++) {
1116 CPDF_ContentMarkItem& item = pMarkData->GetItem(n); 1107 CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
1117 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None) 1108 if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None)
1118 continue; 1109 continue;
1119 pDict = item.GetParam(); 1110 pDict = item.GetParam();
1120 CPDF_String* temp = 1111 CPDF_String* temp =
1121 ToString(pDict ? pDict->GetObjectBy("ActualText") : nullptr); 1112 ToString(pDict ? pDict->GetObjectBy("ActualText") : nullptr);
1122 if (temp) { 1113 if (temp) {
1123 bExist = TRUE; 1114 bExist = TRUE;
1124 actText = temp->GetUnicodeText(); 1115 actText = temp->GetUnicodeText();
1125 } 1116 }
1126 } 1117 }
1127 if (!bExist) 1118 if (!bExist)
1128 return FPDFTEXT_MC_PASS; 1119 return FPDFText_MarkedContent::Pass;
1129 1120
1130 if (m_pPreTextObj) { 1121 if (m_pPreTextObj) {
1131 CPDF_ContentMarkData* pPreMarkData = 1122 CPDF_ContentMarkData* pPreMarkData =
1132 (CPDF_ContentMarkData*)m_pPreTextObj->m_ContentMark.GetObject(); 1123 (CPDF_ContentMarkData*)m_pPreTextObj->m_ContentMark.GetObject();
1133 if (pPreMarkData && pPreMarkData->CountItems() == n && 1124 if (pPreMarkData && pPreMarkData->CountItems() == n &&
1134 pDict == pPreMarkData->GetItem(n - 1).GetParam()) { 1125 pDict == pPreMarkData->GetItem(n - 1).GetParam()) {
1135 return FPDFTEXT_MC_DONE; 1126 return FPDFText_MarkedContent::Done;
1136 } 1127 }
1137 } 1128 }
1138 FX_STRSIZE nItems = actText.GetLength(); 1129 FX_STRSIZE nItems = actText.GetLength();
1139 if (nItems < 1) 1130 if (nItems < 1)
1140 return FPDFTEXT_MC_PASS; 1131 return FPDFText_MarkedContent::Pass;
1141 1132
1142 CPDF_Font* pFont = pTextObj->GetFont(); 1133 CPDF_Font* pFont = pTextObj->GetFont();
1143 bExist = FALSE; 1134 bExist = FALSE;
1144 for (FX_STRSIZE i = 0; i < nItems; i++) { 1135 for (FX_STRSIZE i = 0; i < nItems; i++) {
1145 if (pFont->CharCodeFromUnicode(actText.GetAt(i)) != 1136 if (pFont->CharCodeFromUnicode(actText.GetAt(i)) !=
1146 CPDF_Font::kInvalidCharCode) { 1137 CPDF_Font::kInvalidCharCode) {
1147 bExist = TRUE; 1138 bExist = TRUE;
1148 break; 1139 break;
1149 } 1140 }
1150 } 1141 }
1151 if (!bExist) 1142 if (!bExist)
1152 return FPDFTEXT_MC_PASS; 1143 return FPDFText_MarkedContent::Pass;
1153 1144
1154 bExist = FALSE; 1145 bExist = FALSE;
1155 for (FX_STRSIZE i = 0; i < nItems; i++) { 1146 for (FX_STRSIZE i = 0; i < nItems; i++) {
1156 FX_WCHAR wChar = actText.GetAt(i); 1147 FX_WCHAR wChar = actText.GetAt(i);
1157 if ((wChar > 0x80 && wChar < 0xFFFD) || (wChar <= 0x80 && isprint(wChar))) { 1148 if ((wChar > 0x80 && wChar < 0xFFFD) || (wChar <= 0x80 && isprint(wChar))) {
1158 bExist = TRUE; 1149 bExist = TRUE;
1159 break; 1150 break;
1160 } 1151 }
1161 } 1152 }
1162 if (!bExist) 1153 if (!bExist)
1163 return FPDFTEXT_MC_DONE; 1154 return FPDFText_MarkedContent::Done;
1164 1155
1165 return FPDFTEXT_MC_DELAY; 1156 return FPDFText_MarkedContent::Delay;
1166 } 1157 }
1167 1158
1168 void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) { 1159 void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) {
1169 CPDF_TextObject* pTextObj = Obj.m_pTextObj; 1160 CPDF_TextObject* pTextObj = Obj.m_pTextObj;
1170 CPDF_ContentMarkData* pMarkData = 1161 CPDF_ContentMarkData* pMarkData =
1171 (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject(); 1162 (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
1172 if (!pMarkData) 1163 if (!pMarkData)
1173 return; 1164 return;
1174 1165
1175 int nContentMark = pMarkData->CountItems(); 1166 int nContentMark = pMarkData->CountItems();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) { 1269 void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj) {
1279 CPDF_TextObject* pTextObj = Obj.m_pTextObj; 1270 CPDF_TextObject* pTextObj = Obj.m_pTextObj;
1280 if (FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f) { 1271 if (FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f) {
1281 return; 1272 return;
1282 } 1273 }
1283 CFX_Matrix formMatrix = Obj.m_formMatrix; 1274 CFX_Matrix formMatrix = Obj.m_formMatrix;
1284 CPDF_Font* pFont = pTextObj->GetFont(); 1275 CPDF_Font* pFont = pTextObj->GetFont();
1285 CFX_Matrix matrix; 1276 CFX_Matrix matrix;
1286 pTextObj->GetTextMatrix(&matrix); 1277 pTextObj->GetTextMatrix(&matrix);
1287 matrix.Concat(formMatrix); 1278 matrix.Concat(formMatrix);
1288 int32_t bPreMKC = PreMarkedContent(Obj); 1279 FPDFText_MarkedContent bPreMKC = PreMarkedContent(Obj);
Tom Sepez 2016/05/02 21:45:39 prolly shoujld be ePreMKC since its an enum not a
dsinclair 2016/05/03 13:58:16 Sigh, hungarian notation, so verbose.
Tom Sepez 2016/05/04 20:31:13 Actually, it points out a problem that when the ty
1289 if (FPDFTEXT_MC_DONE == bPreMKC) { 1280 if (bPreMKC == FPDFText_MarkedContent::Done) {
1290 m_pPreTextObj = pTextObj; 1281 m_pPreTextObj = pTextObj;
1291 m_perMatrix.Copy(formMatrix); 1282 m_perMatrix.Copy(formMatrix);
1292 return; 1283 return;
1293 } 1284 }
1294 int result = 0; 1285 int result = 0;
1295 if (m_pPreTextObj) { 1286 if (m_pPreTextObj) {
1296 result = ProcessInsertObject(pTextObj, formMatrix); 1287 result = ProcessInsertObject(pTextObj, formMatrix);
1297 if (2 == result) { 1288 if (2 == result) {
1298 m_CurlineRect = 1289 m_CurlineRect =
1299 CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, 1290 CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1); 1346 m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
1356 charinfo->m_Unicode = 0x2; 1347 charinfo->m_Unicode = 0x2;
1357 charinfo->m_Flag = FPDFTEXT_CHAR_HYPHEN; 1348 charinfo->m_Flag = FPDFTEXT_CHAR_HYPHEN;
1358 m_TempTextBuf.AppendChar(0xfffe); 1349 m_TempTextBuf.AppendChar(0xfffe);
1359 } 1350 }
1360 } else { 1351 } else {
1361 m_CurlineRect = 1352 m_CurlineRect =
1362 CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, 1353 CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom,
1363 Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top); 1354 Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top);
1364 } 1355 }
1365 if (FPDFTEXT_MC_DELAY == bPreMKC) { 1356 if (bPreMKC == FPDFText_MarkedContent::Delay) {
1366 ProcessMarkedContent(Obj); 1357 ProcessMarkedContent(Obj);
1367 m_pPreTextObj = pTextObj; 1358 m_pPreTextObj = pTextObj;
1368 m_perMatrix.Copy(formMatrix); 1359 m_perMatrix.Copy(formMatrix);
1369 return; 1360 return;
1370 } 1361 }
1371 m_pPreTextObj = pTextObj; 1362 m_pPreTextObj = pTextObj;
1372 m_perMatrix.Copy(formMatrix); 1363 m_perMatrix.Copy(formMatrix);
1373 int nItems = pTextObj->CountItems(); 1364 int nItems = pTextObj->CountItems();
1374 FX_FLOAT baseSpace = CalculateBaseSpace(pTextObj, matrix); 1365 FX_FLOAT baseSpace = CalculateBaseSpace(pTextObj, matrix);
1375 1366
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 return index < m_LinkArray.size() ? m_LinkArray[index].m_strUrl : L""; 2433 return index < m_LinkArray.size() ? m_LinkArray[index].m_strUrl : L"";
2443 } 2434 }
2444 2435
2445 std::vector<CFX_FloatRect> CPDF_LinkExtract::GetRects(size_t index) const { 2436 std::vector<CFX_FloatRect> CPDF_LinkExtract::GetRects(size_t index) const {
2446 if (index >= m_LinkArray.size()) 2437 if (index >= m_LinkArray.size())
2447 return std::vector<CFX_FloatRect>(); 2438 return std::vector<CFX_FloatRect>();
2448 2439
2449 return m_pTextPage->GetRectArray(m_LinkArray[index].m_Start, 2440 return m_pTextPage->GetRectArray(m_LinkArray[index].m_Start,
2450 m_LinkArray[index].m_Count); 2441 m_LinkArray[index].m_Count);
2451 } 2442 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdftext/include/cpdf_textpage.h » ('j') | xfa/fwl/core/fwl_noteimp.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698