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

Side by Side Diff: core/src/fxcrt/fx_basic_wstring.cpp

Issue 1053613004: Make CFX_WideString::LockBuffer() completely unused. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Reland Created 5 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 | « core/src/fxcrt/fx_basic_bstring.cpp ('k') | no next file » | 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/fxcrt/fx_basic.h" 7 #include "../../include/fxcrt/fx_basic.h"
8 #include "../../../third_party/base/numerics/safe_math.h" 8 #include "../../../third_party/base/numerics/safe_math.h"
9 9
10 static CFX_StringDataW* FX_AllocStringW(int nLen) 10 static CFX_StringDataW* FX_AllocStringW(int nLen)
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 return 1; 528 return 1;
529 } 529 }
530 } 530 }
531 if (this_len < that_len) { 531 if (this_len < that_len) {
532 return -1; 532 return -1;
533 } else if (this_len > that_len) { 533 } else if (this_len > that_len) {
534 return 1; 534 return 1;
535 } 535 }
536 return 0; 536 return 0;
537 } 537 }
538 FX_LPWSTR CFX_WideString::LockBuffer()
539 {
540 if (m_pData == NULL) {
541 return NULL;
542 }
543 FX_LPWSTR lpsz = GetBuffer(0);
544 m_pData->m_nRefs = -1;
545 return lpsz;
546 }
547 void CFX_WideString::SetAt(FX_STRSIZE nIndex, FX_WCHAR ch) 538 void CFX_WideString::SetAt(FX_STRSIZE nIndex, FX_WCHAR ch)
548 { 539 {
549 if (m_pData == NULL) { 540 if (m_pData == NULL) {
550 return; 541 return;
551 } 542 }
552 ASSERT(nIndex >= 0); 543 ASSERT(nIndex >= 0);
553 ASSERT(nIndex < m_pData->m_nDataLength); 544 ASSERT(nIndex < m_pData->m_nDataLength);
554 CopyBeforeWrite(); 545 CopyBeforeWrite();
555 m_pData->m_String[nIndex] = ch; 546 m_pData->m_String[nIndex] = ch;
556 } 547 }
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 return (CFX_CharMap*)&g_DefaultJISMapper; 1107 return (CFX_CharMap*)&g_DefaultJISMapper;
1117 case 936: 1108 case 936:
1118 return (CFX_CharMap*)&g_DefaultGBKMapper; 1109 return (CFX_CharMap*)&g_DefaultGBKMapper;
1119 case 949: 1110 case 949:
1120 return (CFX_CharMap*)&g_DefaultUHCMapper; 1111 return (CFX_CharMap*)&g_DefaultUHCMapper;
1121 case 950: 1112 case 950:
1122 return (CFX_CharMap*)&g_DefaultBig5Mapper; 1113 return (CFX_CharMap*)&g_DefaultBig5Mapper;
1123 } 1114 }
1124 return NULL; 1115 return NULL;
1125 } 1116 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_bstring.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698