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.h | |
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.h')
-rw-r--r-- | fpdfsdk/cpdfsdk_helpers.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_helpers.h b/fpdfsdk/cpdfsdk_helpers.h index d93ecfc89b..10f44e409a 100644 --- a/fpdfsdk/cpdfsdk_helpers.h +++ b/fpdfsdk/cpdfsdk_helpers.h @@ -64,11 +64,11 @@ FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc); // Conversions to/from incomplete FPDF_ API types. -inline FPDF_ACTION FPDFActionFromCPDFDictionary(CPDF_Dictionary* action) { +inline FPDF_ACTION FPDFActionFromCPDFDictionary(const CPDF_Dictionary* action) { return reinterpret_cast<FPDF_ACTION>(action); } -inline CPDF_Dictionary* CPDFDictionaryFromFPDFAction(FPDF_ACTION action) { - return reinterpret_cast<CPDF_Dictionary*>(action); +inline const CPDF_Dictionary* CPDFDictionaryFromFPDFAction(FPDF_ACTION action) { + return reinterpret_cast<const CPDF_Dictionary*>(action); } inline FPDF_ANNOTATION FPDFAnnotationFromCPDFAnnotContext( @@ -94,11 +94,13 @@ inline CFX_DIBitmap* CFXDIBitmapFromFPDFBitmap(FPDF_BITMAP bitmap) { return reinterpret_cast<CFX_DIBitmap*>(bitmap); } -inline FPDF_BOOKMARK FPDFBookmarkFromCPDFDictionary(CPDF_Dictionary* bookmark) { +inline FPDF_BOOKMARK FPDFBookmarkFromCPDFDictionary( + const CPDF_Dictionary* bookmark) { return reinterpret_cast<FPDF_BOOKMARK>(bookmark); } -inline CPDF_Dictionary* CPDFDictionaryFromFPDFBookmark(FPDF_BOOKMARK bookmark) { - return reinterpret_cast<CPDF_Dictionary*>(bookmark); +inline const CPDF_Dictionary* CPDFDictionaryFromFPDFBookmark( + FPDF_BOOKMARK bookmark) { + return reinterpret_cast<const CPDF_Dictionary*>(bookmark); } inline FPDF_CLIPPATH FPDFClipPathFromCPDFClipPath(CPDF_ClipPath* path) { @@ -220,7 +222,8 @@ RetainPtr<IFX_SeekableStream> MakeSeekableStream( FPDF_FILEHANDLER* pFileHandler); #endif // PDF_ENABLE_XFA -CPDF_Array* GetQuadPointsArrayFromDictionary(const CPDF_Dictionary* dict); +const CPDF_Array* GetQuadPointsArrayFromDictionary(const CPDF_Dictionary* dict); +CPDF_Array* GetQuadPointsArrayFromDictionary(CPDF_Dictionary* dict); CPDF_Array* AddQuadPointsArrayToDictionary(CPDF_Dictionary* dict); bool IsValidQuadPointsIndex(const CPDF_Array* array, size_t index); bool GetQuadPointsAtIndex(const CPDF_Array* array, |