summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser/include
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-11 18:14:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-11 18:14:56 -0700
commit822484b5f88d92dbcd567b1c2da38af1e720b56f (patch)
treede1902c744cbe38023432cc3f860d99df90beb70 /core/fpdfapi/fpdf_parser/include
parente09c1e4db92e28a332f55aa3c80ceb44f4b74287 (diff)
downloadpdfium-822484b5f88d92dbcd567b1c2da38af1e720b56f.tar.xz
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
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_array.h1
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h3
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_name.h1
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_object.h3
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_reference.h1
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_string.h1
6 files changed, 0 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_array.h b/core/fpdfapi/fpdf_parser/include/cpdf_array.h
index 506a6bc338..ac3bf41b45 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_array.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_array.h
@@ -30,7 +30,6 @@ class CPDF_Array : public CPDF_Object {
CPDF_Object* GetObjectAt(size_t index) const;
CPDF_Object* GetDirectObjectAt(size_t index) const;
CFX_ByteString GetStringAt(size_t index) const;
- CFX_ByteStringC GetConstStringAt(size_t index) const;
int GetIntegerAt(size_t index) const;
FX_FLOAT GetNumberAt(size_t index) const;
CPDF_Dictionary* GetDictAt(size_t index) const;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
index 82abc35c02..c39370e6ec 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
@@ -34,11 +34,8 @@ class CPDF_Dictionary : public CPDF_Object {
CPDF_Object* GetObjectBy(const CFX_ByteStringC& key) const;
CPDF_Object* GetDirectObjectBy(const CFX_ByteStringC& key) const;
CFX_ByteString GetStringBy(const CFX_ByteStringC& key) const;
- CFX_ByteStringC GetConstStringBy(const CFX_ByteStringC& key) const;
CFX_ByteString GetStringBy(const CFX_ByteStringC& key,
const CFX_ByteStringC& default_str) const;
- CFX_ByteStringC GetConstStringBy(const CFX_ByteStringC& key,
- const CFX_ByteStringC& default_str) const;
CFX_WideString GetUnicodeTextBy(const CFX_ByteStringC& key) const;
int GetIntegerBy(const CFX_ByteStringC& key) const;
int GetIntegerBy(const CFX_ByteStringC& key, int default_int) const;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_name.h b/core/fpdfapi/fpdf_parser/include/cpdf_name.h
index 62fd5c14a8..bebccb5841 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_name.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_name.h
@@ -19,7 +19,6 @@ class CPDF_Name : public CPDF_Object {
Type GetType() const override;
CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override;
CFX_ByteString GetString() const override;
- CFX_ByteStringC GetConstString() const override;
CFX_WideString GetUnicodeText() const override;
void SetString(const CFX_ByteString& str) override;
bool IsName() const override;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h
index 6cdaaf58fd..c0c442157f 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h
@@ -46,9 +46,6 @@ class CPDF_Object {
void Release();
virtual CFX_ByteString GetString() const;
-
- // Note: |this| must outlive the use of |GetConstString|'s result.
- virtual CFX_ByteStringC GetConstString() const;
virtual CFX_WideString GetUnicodeText() const;
virtual FX_FLOAT GetNumber() const;
virtual int GetInteger() const;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_reference.h b/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
index b7d826902b..49b698eacb 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
@@ -20,7 +20,6 @@ class CPDF_Reference : public CPDF_Object {
CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override;
CPDF_Object* GetDirect() const override;
CFX_ByteString GetString() const override;
- CFX_ByteStringC GetConstString() const override;
FX_FLOAT GetNumber() const override;
int GetInteger() const override;
CPDF_Dictionary* GetDict() const override;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_string.h b/core/fpdfapi/fpdf_parser/include/cpdf_string.h
index 77e41ecd6a..c17cc182f7 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_string.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_string.h
@@ -21,7 +21,6 @@ class CPDF_String : public CPDF_Object {
Type GetType() const override;
CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const override;
CFX_ByteString GetString() const override;
- CFX_ByteStringC GetConstString() const override;
CFX_WideString GetUnicodeText() const override;
void SetString(const CFX_ByteString& str) override;
bool IsString() const override;