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 "../../include/fpdfapi/fpdf_resource.h" | 7 #include "../../include/fpdfapi/fpdf_resource.h" |
8 #include "../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../include/fpdfapi/fpdf_pageobj.h" |
9 #include "../../include/fpdftext/fpdf_text.h" | 9 #include "../../include/fpdftext/fpdf_text.h" |
10 #include "../../include/fpdfapi/fpdf_page.h" | 10 #include "../../include/fpdfapi/fpdf_page.h" |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 AddCharInfoByRLDirection(str, n); | 1357 AddCharInfoByRLDirection(str, n); |
1358 } | 1358 } |
1359 } else { | 1359 } else { |
1360 int end = start + count1 ; | 1360 int end = start + count1 ; |
1361 for(int n = start; n < end; n++) { | 1361 for(int n = start; n < end; n++) { |
1362 AddCharInfoByLRDirection(str, n); | 1362 AddCharInfoByLRDirection(str, n); |
1363 } | 1363 } |
1364 } | 1364 } |
1365 } | 1365 } |
1366 } | 1366 } |
1367 int ntext = m_TextBuf.GetSize(); | |
1368 ntext = m_charList.GetSize(); | |
1369 order.RemoveAll(); | 1367 order.RemoveAll(); |
1370 m_TempCharList.RemoveAll(); | 1368 m_TempCharList.RemoveAll(); |
1371 m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength()); | 1369 m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength()); |
1372 BidiChar->Release(); | 1370 BidiChar->Release(); |
1373 } | 1371 } |
1374 void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, const CFX_Affi
neMatrix& formMatrix, FX_POSITION ObjPos) | 1372 void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, const CFX_Affi
neMatrix& formMatrix, FX_POSITION ObjPos) |
1375 { | 1373 { |
1376 CFX_FloatRect re(pTextObj->m_Left, pTextObj->m_Bottom, pTextObj->m_Right, pT
extObj->m_Top); | 1374 CFX_FloatRect re(pTextObj->m_Left, pTextObj->m_Bottom, pTextObj->m_Right, pT
extObj->m_Top); |
1377 if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) { | 1375 if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) { |
1378 return; | 1376 return; |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 if(csWord.IsEmpty()) { | 2501 if(csWord.IsEmpty()) { |
2504 if(ret) { | 2502 if(ret) { |
2505 m_csFindWhatArray.Add(CFX_WideString(L"")); | 2503 m_csFindWhatArray.Add(CFX_WideString(L"")); |
2506 index++; | 2504 index++; |
2507 continue; | 2505 continue; |
2508 } else { | 2506 } else { |
2509 break; | 2507 break; |
2510 } | 2508 } |
2511 } | 2509 } |
2512 int pos = 0; | 2510 int pos = 0; |
| 2511 // TODO(tsepez): unused bLastIgnore is suspicious. |
2513 FX_BOOL bLastIgnore = FALSE; | 2512 FX_BOOL bLastIgnore = FALSE; |
2514 while(pos < csWord.GetLength()) { | 2513 while(pos < csWord.GetLength()) { |
2515 CFX_WideString curStr = csWord.Mid(pos, 1); | 2514 CFX_WideString curStr = csWord.Mid(pos, 1); |
2516 FX_WCHAR curChar = csWord.GetAt(pos); | 2515 FX_WCHAR curChar = csWord.GetAt(pos); |
2517 if (_IsIgnoreSpaceCharacter(curChar)) { | 2516 if (_IsIgnoreSpaceCharacter(curChar)) { |
2518 if (pos > 0 && curChar == 0x2019) { | 2517 if (pos > 0 && curChar == 0x2019) { |
2519 pos++; | 2518 pos++; |
2520 continue; | 2519 continue; |
2521 } | 2520 } |
2522 if (pos > 0 ) { | 2521 if (pos > 0 ) { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2850 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2849 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
2851 return; | 2850 return; |
2852 } | 2851 } |
2853 CPDF_LinkExt* link = NULL; | 2852 CPDF_LinkExt* link = NULL; |
2854 link = m_LinkList.GetAt(index); | 2853 link = m_LinkList.GetAt(index); |
2855 if (!link) { | 2854 if (!link) { |
2856 return ; | 2855 return ; |
2857 } | 2856 } |
2858 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2857 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
2859 } | 2858 } |
OLD | NEW |