diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-28 17:51:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-28 17:51:28 +0000 |
commit | fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac (patch) | |
tree | 7461043e508179a7d33b850486f312c58048e4a8 /fpdfsdk | |
parent | 45a55241d315d25067582d29fcdc1ff8b818965f (diff) | |
download | pdfium-fffdeebfd0ed9806d32eb5609e0fdd015c25c5ac.tar.xz |
Add const/non-const versions of remaining CPDF_Dictionary methods.
GetObjectFor() and GetDirectObjectFor().
Change-Id: I588cd994dfccf0ffd4c8f91362a4806dc109251e
Reviewed-on: https://pdfium-review.googlesource.com/32991
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/cpdfsdk_helpers.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_helpers.h | 6 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cba_fontmap.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdf_annot.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/fpdf_ext.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdf_structtree.cpp | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp index 5773a8b512..76e544961b 100644 --- a/fpdfsdk/cpdfsdk_helpers.cpp +++ b/fpdfsdk/cpdfsdk_helpers.cpp @@ -333,7 +333,7 @@ unsigned long DecodeStreamMaybeCopyAndReturnLength(const CPDF_Stream* stream, uint8_t* decoded_data = nullptr; uint32_t decoded_len = 0; ByteString dummy_last_decoder; - CPDF_Dictionary* dummy_last_param; + const CPDF_Dictionary* dummy_last_param; if (PDF_DataDecode(data, len, dict, dict->GetIntegerFor(pdfium::stream::kDL), false, &decoded_data, &decoded_len, &dummy_last_decoder, diff --git a/fpdfsdk/cpdfsdk_helpers.h b/fpdfsdk/cpdfsdk_helpers.h index ba54645de8..fae7ef0782 100644 --- a/fpdfsdk/cpdfsdk_helpers.h +++ b/fpdfsdk/cpdfsdk_helpers.h @@ -110,11 +110,11 @@ inline CPDF_ClipPath* CPDFClipPathFromFPDFClipPath(FPDF_CLIPPATH path) { return reinterpret_cast<CPDF_ClipPath*>(path); } -inline FPDF_DEST FPDFDestFromCPDFArray(CPDF_Array* dest) { +inline FPDF_DEST FPDFDestFromCPDFArray(const CPDF_Array* dest) { return reinterpret_cast<FPDF_DEST>(dest); } -inline CPDF_Array* CPDFArrayFromFPDFDest(FPDF_DEST dest) { - return reinterpret_cast<CPDF_Array*>(dest); +inline const CPDF_Array* CPDFArrayFromFPDFDest(FPDF_DEST dest) { + return reinterpret_cast<const CPDF_Array*>(dest); } inline FPDF_FONT FPDFFontFromCPDFFont(CPDF_Font* font) { diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index d219ca40b7..671ba92282 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -203,7 +203,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(ByteString* sAlias) { } ByteString sDA; - CPDF_Object* pObj = FPDF_GetFieldAttr(m_pAnnotDict.Get(), "DA"); + const CPDF_Object* pObj = FPDF_GetFieldAttr(m_pAnnotDict.Get(), "DA"); if (pObj) sDA = pObj->GetString(); diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index d3bf38d315..1fa71f288e 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp @@ -142,7 +142,7 @@ static_assert(static_cast<int>(CPDF_Object::Type::REFERENCE) == FPDF_OBJECT_REFERENCE, "CPDF_Object::REFERENCE value mismatch"); -bool HasAPStream(const CPDF_Dictionary* pAnnotDict) { +bool HasAPStream(CPDF_Dictionary* pAnnotDict) { return !!FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); } @@ -188,7 +188,7 @@ void AppendQuadPoints(CPDF_Array* array, const FS_QUADPOINTSF* quad_points) { array->AddNew<CPDF_Number>(quad_points->y4); } -void UpdateBBox(const CPDF_Dictionary* annot_dict) { +void UpdateBBox(CPDF_Dictionary* annot_dict) { // Update BBox entry in appearance stream based on the bounding rectangle // of the annotation's quadpoints. CPDF_Stream* pStream = diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp index 509cfe818b..6a2ab061fd 100644 --- a/fpdfsdk/fpdf_ext.cpp +++ b/fpdfsdk/fpdf_ext.cpp @@ -85,7 +85,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { if (!pRoot) return PAGEMODE_UNKNOWN; - CPDF_Object* pName = pRoot->GetObjectFor("PageMode"); + const CPDF_Object* pName = pRoot->GetObjectFor("PageMode"); if (!pName) return PAGEMODE_USENONE; diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp index d39f8084c2..206a08e921 100644 --- a/fpdfsdk/fpdf_structtree.cpp +++ b/fpdfsdk/fpdf_structtree.cpp @@ -84,7 +84,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDF_StructElement_GetMarkedContentID(FPDF_STRUCTELEMENT struct_element) { CPDF_StructElement* elem = CPDFStructElementFromFPDFStructElement(struct_element); - CPDF_Object* p = + const CPDF_Object* p = (elem && elem->GetDict()) ? elem->GetDict()->GetObjectFor("K") : nullptr; return p && p->IsNumber() ? p->GetInteger() : -1; } |