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

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

Issue 1108903002: Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 8 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 | « core/src/fpdfdoc/doc_formfield.cpp ('k') | core/src/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »
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 "../../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 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 nResultPos = nStartPos + 1; 2365 nResultPos = nStartPos + 1;
2366 break; 2366 break;
2367 } 2367 }
2368 iWord = -1; 2368 iWord = -1;
2369 } else if(iWord == 0) { 2369 } else if(iWord == 0) {
2370 bSpaceStart = TRUE; 2370 bSpaceStart = TRUE;
2371 } 2371 }
2372 continue; 2372 continue;
2373 } 2373 }
2374 int endIndex; 2374 int endIndex;
2375 nResultPos = m_strText.Find(csWord, nStartPos); 2375 nResultPos = m_strText.Find(csWord.c_str(), nStartPos);
2376 if (nResultPos == -1) { 2376 if (nResultPos == -1) {
2377 m_IsFind = FALSE; 2377 m_IsFind = FALSE;
2378 return m_IsFind; 2378 return m_IsFind;
2379 } 2379 }
2380 endIndex = nResultPos + csWord.GetLength() - 1; 2380 endIndex = nResultPos + csWord.GetLength() - 1;
2381 if(iWord == 0) { 2381 if(iWord == 0) {
2382 m_resStart = nResultPos; 2382 m_resStart = nResultPos;
2383 } 2383 }
2384 FX_BOOL bMatch = TRUE; 2384 FX_BOOL bMatch = TRUE;
2385 if(iWord != 0 && !bSpaceStart) { 2385 if(iWord != 0 && !bSpaceStart) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 return m_IsFind; 2482 return m_IsFind;
2483 } 2483 }
2484 void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) 2484 void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat)
2485 { 2485 {
2486 if(findwhat.IsEmpty()) { 2486 if(findwhat.IsEmpty()) {
2487 return ; 2487 return ;
2488 } 2488 }
2489 int index = 0; 2489 int index = 0;
2490 while(1) { 2490 while(1) {
2491 CFX_WideString csWord = TEXT_EMPTY; 2491 CFX_WideString csWord = TEXT_EMPTY;
2492 int ret = ExtractSubString(csWord, findwhat, index, TEXT_BLANK_CHAR); 2492 int ret = ExtractSubString(csWord, findwhat.c_str(), index, TEXT_BLANK_C HAR);
2493 if(csWord.IsEmpty()) { 2493 if(csWord.IsEmpty()) {
2494 if(ret) { 2494 if(ret) {
2495 m_csFindWhatArray.Add(CFX_WideString(L"")); 2495 m_csFindWhatArray.Add(CFX_WideString(L""));
2496 index++; 2496 index++;
2497 continue; 2497 continue;
2498 } else { 2498 } else {
2499 break; 2499 break;
2500 } 2500 }
2501 } 2501 }
2502 int pos = 0; 2502 int pos = 0;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2840 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) { 2840 if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
2841 return; 2841 return;
2842 } 2842 }
2843 CPDF_LinkExt* link = NULL; 2843 CPDF_LinkExt* link = NULL;
2844 link = m_LinkList.GetAt(index); 2844 link = m_LinkList.GetAt(index);
2845 if (!link) { 2845 if (!link) {
2846 return ; 2846 return ;
2847 } 2847 }
2848 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects); 2848 m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects);
2849 } 2849 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_formfield.cpp ('k') | core/src/fxcrt/fx_basic_wstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698