diff options
author | Lei Zhang <thestig@chromium.org> | 2018-07-18 04:52:18 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-18 04:52:18 +0000 |
commit | beb56d69a7a57317d521bab927a651fb260f5404 (patch) | |
tree | b2f0ba0b35af67635ff3e72a57b802ca5b5cfa2b /core/fpdfapi/parser/cpdf_document.cpp | |
parent | 084c31d93439d5166c60dbfb0ccee6db1406d09c (diff) | |
download | pdfium-beb56d69a7a57317d521bab927a651fb260f5404.tar.xz |
Avoid writing const/non-const versions of the same function.
Use const_cast for the non-const version to call the const version.
Change-Id: Ibdf5fe53255ee6e983555080336f5d63e683afd1
Reviewed-on: https://pdfium-review.googlesource.com/37490
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index 2a825d7a9e..7641dbd702 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -329,8 +329,8 @@ const CPDF_Dictionary* CPDF_Document::GetPagesDict() const { } CPDF_Dictionary* CPDF_Document::GetPagesDict() { - CPDF_Dictionary* pRoot = GetRoot(); - return pRoot ? pRoot->GetDictFor("Pages") : nullptr; + return const_cast<CPDF_Dictionary*>( + static_cast<const CPDF_Document*>(this)->GetPagesDict()); } bool CPDF_Document::IsPageLoaded(int iPage) const { |