From 774bdde253b8394aa2ac791e273508ff006d813a Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 14 Apr 2016 09:49:44 -0700 Subject: Replace calls to deprecated CFX_{Wide,Byte}String::Empty() Use the more standard name "clear()" instead. Review URL: https://codereview.chromium.org/1888103002 --- core/fpdftext/fpdf_text_int.cpp | 6 +++--- core/fxcodec/codec/fx_codec_gif.cpp | 2 +- core/fxcodec/lgif/fx_gif.cpp | 2 +- core/fxcrt/fx_basic_buffer.cpp | 2 +- core/fxcrt/include/fx_string.h | 4 ---- 5 files changed, 6 insertions(+), 10 deletions(-) (limited to 'core') diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp index a1e3fda7b1..8de65cb07a 100644 --- a/core/fpdftext/fpdf_text_int.cpp +++ b/core/fpdftext/fpdf_text_int.cpp @@ -2185,7 +2185,7 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) { } m_csFindWhatArray.push_back(curStr); if (pos == csWord.GetLength() - 1) { - csWord.Empty(); + csWord.clear(); break; } csWord = csWord.Right(csWord.GetLength() - pos - 1); @@ -2258,7 +2258,7 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, while (iSubString--) { lpszFullString = FXSYS_wcschr(lpszFullString, chSep); if (!lpszFullString) { - rString.Empty(); + rString.clear(); return FALSE; } lpszFullString++; @@ -2278,7 +2278,7 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, CFX_WideString CPDF_TextPageFind::MakeReverse(const CFX_WideString& str) { CFX_WideString str2; - str2.Empty(); + str2.clear(); int nlen = str.GetLength(); for (int i = nlen - 1; i >= 0; i--) { str2 += str.GetAt(i); diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp index b7362ca4b3..13576412c2 100644 --- a/core/fxcodec/codec/fx_codec_gif.cpp +++ b/core/fxcodec/codec/fx_codec_gif.cpp @@ -160,7 +160,7 @@ int32_t CCodec_GifModule::LoadFrame(FXGIF_Context* ctx, if (size) { pAttribute->m_strAuthor = CFX_ByteString(buf, size); } else { - pAttribute->m_strAuthor.Empty(); + pAttribute->m_strAuthor.clear(); } buf += size; size = *buf++; diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp index 059fa9a70b..53298c831a 100644 --- a/core/fxcodec/lgif/fx_gif.cpp +++ b/core/fxcodec/lgif/fx_gif.cpp @@ -647,7 +647,7 @@ int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) { gif_ptr->skip_size = skip_size_org; return 2; } - gif_ptr->cmt_data_ptr->Empty(); + gif_ptr->cmt_data_ptr->clear(); while (*data_size_ptr != GIF_BLOCK_TERMINAL) { uint8_t data_size = *data_size_ptr; if (gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL || diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 7f85c95d3f..1e5d0554d1 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -290,7 +290,7 @@ CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(CFX_ByteString& str) { } int len; operator>>(len); - str.Empty(); + str.clear(); if (len <= 0 || m_LoadingPos + len > m_LoadingSize) { return *this; } diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h index 9d7d66741b..7024691e35 100644 --- a/core/fxcrt/include/fx_string.h +++ b/core/fxcrt/include/fx_string.h @@ -159,8 +159,6 @@ class CFX_ByteString { ~CFX_ByteString(); - // Deprecated -- use clear(). - void Empty() { m_pData.Reset(); } void clear() { m_pData.Reset(); } static CFX_ByteString FromUnicode(const FX_WCHAR* ptr, FX_STRSIZE len = -1); @@ -503,8 +501,6 @@ class CFX_WideString { return CFX_WideStringC(c_str(), GetLength()); } - // Deprecated -- use clear(). - void Empty() { m_pData.Reset(); } void clear() { m_pData.Reset(); } FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; } -- cgit v1.2.3