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 "../../public/fpdf_doc.h" | 7 #include "../../public/fpdf_doc.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return len; | 190 return len; |
191 } | 191 } |
192 | 192 |
193 DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, | 193 DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, |
194 FPDF_DEST pDict) { | 194 FPDF_DEST pDict) { |
195 if (!pDict) | 195 if (!pDict) |
196 return 0; | 196 return 0; |
197 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 197 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
198 if (!pDoc) | 198 if (!pDoc) |
199 return 0; | 199 return 0; |
200 CPDF_Dest dest((CPDF_Array*)pDict); | 200 CPDF_Dest dest(static_cast<CPDF_Array*>(pDict)); |
201 return dest.GetPageIndex(pDoc); | 201 return dest.GetPageIndex(pDoc); |
202 } | 202 } |
203 | 203 |
204 DLLEXPORT FPDF_LINK STDCALL | 204 DLLEXPORT FPDF_LINK STDCALL |
205 FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y) { | 205 FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y) { |
206 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 206 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
207 if (!pPage) | 207 if (!pPage) |
208 return nullptr; | 208 return nullptr; |
209 | 209 |
210 CPDF_LinkList* pLinkList = GetLinkList(pPage); | 210 CPDF_LinkList* pLinkList = GetLinkList(pPage); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return 0; | 345 return 0; |
346 CFX_WideString text = pInfo->GetUnicodeText(tag); | 346 CFX_WideString text = pInfo->GetUnicodeText(tag); |
347 // Use UTF-16LE encoding | 347 // Use UTF-16LE encoding |
348 CFX_ByteString encodedText = text.UTF16LE_Encode(); | 348 CFX_ByteString encodedText = text.UTF16LE_Encode(); |
349 unsigned long len = encodedText.GetLength(); | 349 unsigned long len = encodedText.GetLength(); |
350 if (buffer && buflen >= len) { | 350 if (buffer && buflen >= len) { |
351 FXSYS_memcpy(buffer, encodedText.c_str(), len); | 351 FXSYS_memcpy(buffer, encodedText.c_str(), len); |
352 } | 352 } |
353 return len; | 353 return len; |
354 } | 354 } |
OLD | NEW |