summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_annot.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-25 21:48:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 21:48:49 +0000
commit5cee3f28ead05cb336377483e24664c004af8b0a (patch)
tree8fb5db3232e1359831682c809be3ec10de1ce1e0 /core/fpdfdoc/cpdf_annot.cpp
parent1f17bd73afa6b1b79ec4a2f81c995b43d15a9814 (diff)
downloadpdfium-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 'core/fpdfdoc/cpdf_annot.cpp')
-rw-r--r--core/fpdfdoc/cpdf_annot.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index dc2e8acfdf..5734e192e3 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -64,7 +64,7 @@ CPDF_Form* AnnotGetMatrix(const CPDF_Page* pPage,
CPDF_Stream* FPDFDOC_GetAnnotAPInternal(const CPDF_Dictionary* pAnnotDict,
CPDF_Annot::AppearanceMode eMode,
bool bFallbackToNormal) {
- CPDF_Dictionary* pAP = pAnnotDict->GetDictFor("AP");
+ const CPDF_Dictionary* pAP = pAnnotDict->GetDictFor("AP");
if (!pAP)
return nullptr;
@@ -90,7 +90,7 @@ CPDF_Stream* FPDFDOC_GetAnnotAPInternal(const CPDF_Dictionary* pAnnotDict,
if (as.IsEmpty()) {
ByteString value = pAnnotDict->GetStringFor("V");
if (value.IsEmpty()) {
- CPDF_Dictionary* pParentDict = pAnnotDict->GetDictFor("Parent");
+ const CPDF_Dictionary* pParentDict = pAnnotDict->GetDictFor("Parent");
value = pParentDict ? pParentDict->GetStringFor("V") : ByteString();
}
as = (!value.IsEmpty() && pDict->KeyExist(value)) ? value : "Off";
@@ -230,11 +230,12 @@ CFX_FloatRect CPDF_Annot::RectFromQuadPointsArray(const CPDF_Array* pArray,
// static
CFX_FloatRect CPDF_Annot::BoundingRectFromQuadPoints(
const CPDF_Dictionary* pAnnotDict) {
- CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
+ CFX_FloatRect ret;
+ const CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
if (!pArray)
- return CFX_FloatRect();
+ return ret;
- CFX_FloatRect ret = RectFromQuadPointsArray(pArray, 0);
+ ret = RectFromQuadPointsArray(pArray, 0);
size_t nQuadPointCount = QuadPointCount(pArray);
for (size_t i = 1; i < nQuadPointCount; ++i) {
CFX_FloatRect rect = RectFromQuadPointsArray(pArray, i);