diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-25 21:48:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-25 21:48:49 +0000 |
commit | 5cee3f28ead05cb336377483e24664c004af8b0a (patch) | |
tree | 8fb5db3232e1359831682c809be3ec10de1ce1e0 /fpdfsdk/cpdfsdk_helpers.cpp | |
parent | 1f17bd73afa6b1b79ec4a2f81c995b43d15a9814 (diff) | |
download | pdfium-5cee3f28ead05cb336377483e24664c004af8b0a.tar.xz |
Mark more CPDF_Objects as const in action and bookmark code.
Change-Id: Ib5f4cdb9c7f9c33561028a85029649ba68f4a6e5
Reviewed-on: https://pdfium-review.googlesource.com/32912
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_helpers.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_helpers.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp index 87ba9e2ec2..eb91bcf9ba 100644 --- a/fpdfsdk/cpdfsdk_helpers.cpp +++ b/fpdfsdk/cpdfsdk_helpers.cpp @@ -224,14 +224,15 @@ void CheckUnSupportError(CPDF_Document* pDoc, uint32_t err_code) { return; } if (pRootDict->KeyExist("Names")) { - CPDF_Dictionary* pNameDict = pRootDict->GetDictFor("Names"); + const CPDF_Dictionary* pNameDict = pRootDict->GetDictFor("Names"); if (pNameDict && pNameDict->KeyExist("EmbeddedFiles")) { RaiseUnSupportError(FPDF_UNSP_DOC_ATTACHMENT); return; } if (pNameDict && pNameDict->KeyExist("JavaScript")) { - CPDF_Dictionary* pJSDict = pNameDict->GetDictFor("JavaScript"); - CPDF_Array* pArray = pJSDict ? pJSDict->GetArrayFor("Names") : nullptr; + const CPDF_Dictionary* pJSDict = pNameDict->GetDictFor("JavaScript"); + const CPDF_Array* pArray = + pJSDict ? pJSDict->GetArrayFor("Names") : nullptr; if (pArray) { for (size_t i = 0; i < pArray->GetCount(); i++) { ByteString cbStr = pArray->GetStringAt(i); @@ -384,7 +385,12 @@ CFX_FloatRect CFXFloatRectFromFSRECTF(const FS_RECTF& rect) { return CFX_FloatRect(rect.left, rect.bottom, rect.right, rect.top); } -CPDF_Array* GetQuadPointsArrayFromDictionary(const CPDF_Dictionary* dict) { +const CPDF_Array* GetQuadPointsArrayFromDictionary( + const CPDF_Dictionary* dict) { + return dict ? dict->GetArrayFor("QuadPoints") : nullptr; +} + +CPDF_Array* GetQuadPointsArrayFromDictionary(CPDF_Dictionary* dict) { return dict ? dict->GetArrayFor("QuadPoints") : nullptr; } |