diff options
Diffstat (limited to 'core/fpdfapi/parser/cpdf_dictionary.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_dictionary.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp index 0bdb8a8b16..1ede5e707a 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/parser/cpdf_dictionary.cpp @@ -141,7 +141,11 @@ CPDF_Dictionary* CPDF_Dictionary::GetDictFor(const ByteString& key) const { return nullptr; } -CPDF_Array* CPDF_Dictionary::GetArrayFor(const ByteString& key) const { +const CPDF_Array* CPDF_Dictionary::GetArrayFor(const ByteString& key) const { + return ToArray(GetDirectObjectFor(key)); +} + +CPDF_Array* CPDF_Dictionary::GetArrayFor(const ByteString& key) { return ToArray(GetDirectObjectFor(key)); } @@ -155,7 +159,7 @@ CPDF_Stream* CPDF_Dictionary::GetStreamFor(const ByteString& key) { CFX_FloatRect CPDF_Dictionary::GetRectFor(const ByteString& key) const { CFX_FloatRect rect; - CPDF_Array* pArray = GetArrayFor(key); + const CPDF_Array* pArray = GetArrayFor(key); if (pArray) rect = pArray->GetRect(); return rect; @@ -163,7 +167,7 @@ CFX_FloatRect CPDF_Dictionary::GetRectFor(const ByteString& key) const { CFX_Matrix CPDF_Dictionary::GetMatrixFor(const ByteString& key) const { CFX_Matrix matrix; - CPDF_Array* pArray = GetArrayFor(key); + const CPDF_Array* pArray = GetArrayFor(key); if (pArray) matrix = pArray->GetMatrix(); return matrix; |