OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
8 #include "../include/fpdftext.h" | 8 #include "../include/fpdftext.h" |
9 | 9 |
10 #ifdef _WIN32 | 10 #ifdef _WIN32 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 pageLink->GetRects(link_index,rectArray); | 228 pageLink->GetRects(link_index,rectArray); |
229 return rectArray.GetSize(); | 229 return rectArray.GetSize(); |
230 } | 230 } |
231 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index,
int rect_index, double* left, | 231 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index,
int rect_index, double* left, |
232
double* top,double* right, double* bottom) | 232
double* top,double* right, double* bottom) |
233 { | 233 { |
234 if (!link_page) return; | 234 if (!link_page) return; |
235 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; | 235 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; |
236 CFX_RectArray rectArray; | 236 CFX_RectArray rectArray; |
237 pageLink->GetRects(link_index,rectArray); | 237 pageLink->GetRects(link_index,rectArray); |
238 » CFX_FloatRect rect; | 238 » if (rect_index >= 0 && rect_index < rectArray.GetSize()) { |
239 » rect=rectArray.GetAt(rect_index); | 239 » » CFX_FloatRect rect=rectArray.GetAt(rect_index); |
240 » *left=rect.left; | 240 » » *left=rect.left; |
241 » *right=rect.right; | 241 » » *right=rect.right; |
242 » *top=rect.top; | 242 » » *top=rect.top; |
243 » *bottom=rect.bottom; | 243 » » *bottom=rect.bottom; |
| 244 » } |
244 } | 245 } |
245 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) | 246 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) |
246 { | 247 { |
247 if (!link_page) return; | 248 if (!link_page) return; |
248 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; | 249 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; |
249 delete pageLink; | 250 delete pageLink; |
250 pageLink =NULL; | 251 pageLink =NULL; |
251 } | 252 } |
252 | 253 |
OLD | NEW |