From aaed698534284ca45a986ae7344246cffbc6faa9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 22 Mar 2018 18:39:05 +0000 Subject: Consolidate QuadPoints reading code in fpdfsdk. 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 Commit-Queue: Lei Zhang --- fpdfsdk/fpdfannot.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'fpdfsdk/fpdfannot.cpp') 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, -- cgit v1.2.3