From 822484b5f88d92dbcd567b1c2da38af1e720b56f Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 11 Apr 2016 18:14:56 -0700 Subject: Remove CPDF_Object::GetConstString and overrides GetConstString() has sharp edges in that when applied to a CPDF_Number, it must return null whereas GetString() returns a the stringified number, because of the inability to control the lifetime of the underlying allocated string. Deleting this method showed several places where we actually wanted a *String, not a *StringC, so we were re-allocating a string we already had. Review URL: https://codereview.chromium.org/1879683002 --- core/fpdfapi/fpdf_parser/cpdf_array.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'core/fpdfapi/fpdf_parser/cpdf_array.cpp') diff --git a/core/fpdfapi/fpdf_parser/cpdf_array.cpp b/core/fpdfapi/fpdf_parser/cpdf_array.cpp index e2279c8e1d..d588f339a7 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_array.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_array.cpp @@ -92,12 +92,6 @@ CFX_ByteString CPDF_Array::GetStringAt(size_t i) const { return m_Objects.at(i)->GetString(); } -CFX_ByteStringC CPDF_Array::GetConstStringAt(size_t i) const { - if (i >= m_Objects.size()) - return CFX_ByteStringC(); - return m_Objects.at(i)->GetConstString(); -} - int CPDF_Array::GetIntegerAt(size_t i) const { if (i >= m_Objects.size()) return 0; -- cgit v1.2.3