From beb56d69a7a57317d521bab927a651fb260f5404 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 18 Jul 2018 04:52:18 +0000 Subject: 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 Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_document.cpp') 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( + static_cast(this)->GetPagesDict()); } bool CPDF_Document::IsPageLoaded(int iPage) const { -- cgit v1.2.3