diff options
author | Lei Zhang <thestig@chromium.org> | 2018-03-22 18:39:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-22 18:39:05 +0000 |
commit | aaed698534284ca45a986ae7344246cffbc6faa9 (patch) | |
tree | 196ef8371b5b63ef8cccd3869424e25690f823d6 /fpdfsdk/fpdfannot.cpp | |
parent | f9f0e511c4a8a4b7f29624012ddcc00fb7cc8ba9 (diff) | |
download | pdfium-aaed698534284ca45a986ae7344246cffbc6faa9.tar.xz |
Consolidate QuadPoints reading code in fpdfsdk.chromium/3380chromium/3379
Also fix nits in QuadPoints code in cpdf_annot.cpp.
Change-Id: I7852b673d3dca906e6d250cb3cfa305f8ea7e742
Reviewed-on: https://pdfium-review.googlesource.com/28893
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfannot.cpp')
-rw-r--r-- | fpdfsdk/fpdfannot.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp index d2a15ce8c0..b5dccaade1 100644 --- a/fpdfsdk/fpdfannot.cpp +++ b/fpdfsdk/fpdfannot.cpp @@ -627,24 +627,9 @@ FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, if (!annot || !quad_points || !FPDFAnnot_HasAttachmentPoints(annot)) return false; - CPDF_Dictionary* pAnnotDict = - CPDFAnnotContextFromFPDFAnnotation(annot)->GetAnnotDict(); - if (!pAnnotDict) - return false; - - CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints"); - if (!pArray) - return false; - - quad_points->x1 = pArray->GetNumberAt(0); - quad_points->y1 = pArray->GetNumberAt(1); - quad_points->x2 = pArray->GetNumberAt(2); - quad_points->y2 = pArray->GetNumberAt(3); - quad_points->x3 = pArray->GetNumberAt(4); - quad_points->y3 = pArray->GetNumberAt(5); - quad_points->x4 = pArray->GetNumberAt(6); - quad_points->y4 = pArray->GetNumberAt(7); - return true; + return GetQuadPointsFromDictionary( + CPDFAnnotContextFromFPDFAnnotation(annot)->GetAnnotDict(), 0, + quad_points); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, |