diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-25 21:17:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-25 21:17:49 +0000 |
commit | 0d86f765b8361b7f9f3a5fcc659de2f52c806bd0 (patch) | |
tree | 5f59c428d1bed3269292625d7e26ab4462510b85 /core/fpdfapi/parser | |
parent | 2d3a78547ae2a0c084dc312ca4b3e03ff3427a9f (diff) | |
download | pdfium-0d86f765b8361b7f9f3a5fcc659de2f52c806bd0.tar.xz |
Add proper const/non-const versions of CPDF_Dictionary::GetStreamFor().chromium/3441
BUG=pdfium:234
Change-Id: Ia3e758bbe5c445c3856f5215e900e02a16b4d7d7
Reviewed-on: https://pdfium-review.googlesource.com/32910
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r-- | core/fpdfapi/parser/cpdf_dictionary.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_dictionary.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp index 29571d6c51..0bdb8a8b16 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/parser/cpdf_dictionary.cpp @@ -145,7 +145,11 @@ CPDF_Array* CPDF_Dictionary::GetArrayFor(const ByteString& key) const { return ToArray(GetDirectObjectFor(key)); } -CPDF_Stream* CPDF_Dictionary::GetStreamFor(const ByteString& key) const { +const CPDF_Stream* CPDF_Dictionary::GetStreamFor(const ByteString& key) const { + return ToStream(GetDirectObjectFor(key)); +} + +CPDF_Stream* CPDF_Dictionary::GetStreamFor(const ByteString& key) { return ToStream(GetDirectObjectFor(key)); } diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h index 8ecbe2d6fc..f2ee588dab 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.h +++ b/core/fpdfapi/parser/cpdf_dictionary.h @@ -52,7 +52,8 @@ class CPDF_Dictionary : public CPDF_Object { bool GetBooleanFor(const ByteString& key, bool bDefault = false) const; float GetNumberFor(const ByteString& key) const; CPDF_Dictionary* GetDictFor(const ByteString& key) const; - CPDF_Stream* GetStreamFor(const ByteString& key) const; + const CPDF_Stream* GetStreamFor(const ByteString& key) const; + CPDF_Stream* GetStreamFor(const ByteString& key); CPDF_Array* GetArrayFor(const ByteString& key) const; CFX_FloatRect GetRectFor(const ByteString& key) const; CFX_Matrix GetMatrixFor(const ByteString& key) const; |