Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: fpdfsdk/src/fpdftext.cpp

Issue 878333003: Cover fpdftext.h API with embeddertests. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Non-zero initial paramenters in another place. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/fpdftext.h ('k') | fpdfsdk/src/fpdftext_embeddertest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « fpdfsdk/include/fpdftext.h ('k') | fpdfsdk/src/fpdftext_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698