| 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 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_page.h" | 10 #include "../include/fpdfxfa/fpdfxfa_page.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 pageLink->GetRects(link_index,rectArray); | 234 pageLink->GetRects(link_index,rectArray); |
| 235 return rectArray.GetSize(); | 235 return rectArray.GetSize(); |
| 236 } | 236 } |
| 237 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index,
int rect_index, double* left, | 237 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index,
int rect_index, double* left, |
| 238
double* top,double* right, double* bottom) | 238
double* top,double* right, double* bottom) |
| 239 { | 239 { |
| 240 if (!link_page) return; | 240 if (!link_page) return; |
| 241 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; | 241 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; |
| 242 CFX_RectArray rectArray; | 242 CFX_RectArray rectArray; |
| 243 pageLink->GetRects(link_index,rectArray); | 243 pageLink->GetRects(link_index,rectArray); |
| 244 » CFX_FloatRect rect; | 244 » if (rect_index >= 0 && rect_index < rectArray.GetSize()) { |
| 245 » rect=rectArray.GetAt(rect_index); | 245 » » CFX_FloatRect rect=rectArray.GetAt(rect_index); |
| 246 » *left=rect.left; | 246 » » *left=rect.left; |
| 247 » *right=rect.right; | 247 » » *right=rect.right; |
| 248 » *top=rect.top; | 248 » » *top=rect.top; |
| 249 » *bottom=rect.bottom; | 249 » » *bottom=rect.bottom; |
| 250 » } |
| 250 } | 251 } |
| 251 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) | 252 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) |
| 252 { | 253 { |
| 253 if (!link_page) return; | 254 if (!link_page) return; |
| 254 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; | 255 IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; |
| 255 delete pageLink; | 256 delete pageLink; |
| 256 pageLink =NULL; | 257 pageLink =NULL; |
| 257 } | 258 } |
| 258 | 259 |
| OLD | NEW |