| 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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2372 nResultPos = nStartPos + 1; | 2372 nResultPos = nStartPos + 1; |
| 2373 break; | 2373 break; |
| 2374 } | 2374 } |
| 2375 iWord = -1; | 2375 iWord = -1; |
| 2376 } else if(iWord == 0) { | 2376 } else if(iWord == 0) { |
| 2377 bSpaceStart = TRUE; | 2377 bSpaceStart = TRUE; |
| 2378 } | 2378 } |
| 2379 continue; | 2379 continue; |
| 2380 } | 2380 } |
| 2381 int endIndex; | 2381 int endIndex; |
| 2382 nResultPos = m_strText.Find(csWord, nStartPos); | 2382 nResultPos = m_strText.Find(csWord.c_str(), nStartPos); |
| 2383 if (nResultPos == -1) { | 2383 if (nResultPos == -1) { |
| 2384 m_IsFind = FALSE; | 2384 m_IsFind = FALSE; |
| 2385 return m_IsFind; | 2385 return m_IsFind; |
| 2386 } | 2386 } |
| 2387 endIndex = nResultPos + csWord.GetLength() - 1; | 2387 endIndex = nResultPos + csWord.GetLength() - 1; |
| 2388 if(iWord == 0) { | 2388 if(iWord == 0) { |
| 2389 m_resStart = nResultPos; | 2389 m_resStart = nResultPos; |
| 2390 } | 2390 } |
| 2391 FX_BOOL bMatch = TRUE; | 2391 FX_BOOL bMatch = TRUE; |
| 2392 if(iWord != 0 && !bSpaceStart) { | 2392 if(iWord != 0 && !bSpaceStart) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 return m_IsFind; | 2489 return m_IsFind; |
| 2490 } | 2490 } |
| 2491 void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) | 2491 void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) |
| 2492 { | 2492 { |
| 2493 if(findwhat.IsEmpty()) { | 2493 if(findwhat.IsEmpty()) { |
| 2494 return ; | 2494 return ; |
| 2495 } | 2495 } |
| 2496 int index = 0; | 2496 int index = 0; |
| 2497 while(1) { | 2497 while(1) { |
| 2498 CFX_WideString csWord = TEXT_EMPTY; | 2498 CFX_WideString csWord = TEXT_EMPTY; |
| 2499 int ret = ExtractSubString(csWord, findwhat, index, TEXT_BLANK_CHAR); | 2499 int ret = ExtractSubString(csWord, findwhat.c_str(), index, TEXT_BLANK_C
HAR); |
| 2500 if(csWord.IsEmpty()) { | 2500 if(csWord.IsEmpty()) { |
| 2501 if(ret) { | 2501 if(ret) { |
| 2502 m_csFindWhatArray.Add(CFX_WideString(L"")); | 2502 m_csFindWhatArray.Add(CFX_WideString(L"")); |
| 2503 index++; | 2503 index++; |
| 2504 continue; | 2504 continue; |
| 2505 } else { | 2505 } else { |
| 2506 break; | 2506 break; |
| 2507 } | 2507 } |
| 2508 } | 2508 } |
| 2509 int pos = 0; | 2509 int pos = 0; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { | 2843 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { |
| 2844 return; | 2844 return; |
| 2845 } | 2845 } |
| 2846 CPDF_LinkExt* link = NULL; | 2846 CPDF_LinkExt* link = NULL; |
| 2847 link = m_LinkList.GetAt(index); | 2847 link = m_LinkList.GetAt(index); |
| 2848 if (!link) { | 2848 if (!link) { |
| 2849 return ; | 2849 return ; |
| 2850 } | 2850 } |
| 2851 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); | 2851 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); |
| 2852 } | 2852 } |
| OLD | NEW |