summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_doc.cpp
diff options
context:
space:
mode:
authorRalf Sippl <ralf.sippl@gmail.com>2018-04-12 21:20:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 21:20:26 +0000
commit1638179e85863b5045fcea2282fd3e0622aeac13 (patch)
treee21cc4c409ed04ccb4496f17c4edcc0d8f586cdc /fpdfsdk/fpdf_doc.cpp
parentc9f4f0dbcaaf9e86ef2b64c844b094bd2f6b1a92 (diff)
downloadpdfium-1638179e85863b5045fcea2282fd3e0622aeac13.tar.xz
Add index parameter to quadpoints getter and setter.
This is needed for working with multiline text markup annotations. Based on https://pdfium-review.googlesource.com/12012. Bug: pdfium:1045 Change-Id: Ifb105996b8b950bb2d5fceaf754b4f571155aef4 Reviewed-on: https://pdfium-review.googlesource.com/29150 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_doc.cpp')
-rw-r--r--fpdfsdk/fpdf_doc.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index d8be12066a..54718a9409 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -12,6 +12,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_document.h"
+#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfdoc/cpdf_bookmark.h"
#include "core/fpdfdoc/cpdf_bookmarktree.h"
#include "core/fpdfdoc/cpdf_dest.h"
@@ -390,9 +391,17 @@ FPDFLink_GetQuadPoints(FPDF_LINK link_annot,
FS_QUADPOINTSF* quad_points) {
if (!quad_points || quad_index < 0)
return false;
- return GetQuadPointsFromDictionary(CPDFDictionaryFromFPDFLink(link_annot),
- static_cast<size_t>(quad_index),
- quad_points);
+
+ CPDF_Dictionary* pLinkDict = CPDFDictionaryFromFPDFLink(link_annot);
+ if (!pLinkDict)
+ return false;
+
+ const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(pLinkDict);
+ if (!pArray)
+ return false;
+
+ return GetQuadPointsAtIndex(pArray, static_cast<size_t>(quad_index),
+ quad_points);
}
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document,