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 "../../public/fpdf_doc.h" | 8 #include "../../public/fpdf_doc.h" |
9 | 9 |
10 static int THISMODULE = 0; | 10 static int THISMODULE = 0; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 CPDF_Page* pPage = (CPDF_Page*)page; | 212 CPDF_Page* pPage = (CPDF_Page*)page; |
213 if(!pPage->m_pFormDict) | 213 if(!pPage->m_pFormDict) |
214 return FALSE; | 214 return FALSE; |
215 CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots"); | 215 CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots"); |
216 if(!pAnnots) | 216 if(!pAnnots) |
217 return FALSE; | 217 return FALSE; |
218 for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) { | 218 for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) { |
219 CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementVa
lue(i); | 219 CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementVa
lue(i); |
220 if (!pDict || pDict->GetType() != PDFOBJ_DICTIONARY) | 220 if (!pDict || pDict->GetType() != PDFOBJ_DICTIONARY) |
221 continue; | 221 continue; |
222 » » if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))
) { | 222 » » if(pDict->GetStringAt("Subtype").Equal(FX_BSTRC("Link"))) { |
223 *startPos = i + 1; | 223 *startPos = i + 1; |
224 *linkAnnot = (FPDF_LINK)pDict; | 224 *linkAnnot = (FPDF_LINK)pDict; |
225 return TRUE; | 225 return TRUE; |
226 } | 226 } |
227 } | 227 } |
228 return FALSE; | 228 return FALSE; |
229 } | 229 } |
230 | 230 |
231 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF*
rect) | 231 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF*
rect) |
232 { | 232 { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 return 0; | 287 return 0; |
288 CFX_WideString text = pInfo->GetUnicodeText(tag); | 288 CFX_WideString text = pInfo->GetUnicodeText(tag); |
289 // Use UTF-16LE encoding | 289 // Use UTF-16LE encoding |
290 CFX_ByteString encodedText = text.UTF16LE_Encode(); | 290 CFX_ByteString encodedText = text.UTF16LE_Encode(); |
291 unsigned long len = encodedText.GetLength(); | 291 unsigned long len = encodedText.GetLength(); |
292 if (buffer && buflen >= len) { | 292 if (buffer && buflen >= len) { |
293 FXSYS_memcpy(buffer, encodedText.c_str(), len); | 293 FXSYS_memcpy(buffer, encodedText.c_str(), len); |
294 } | 294 } |
295 return len; | 295 return len; |
296 } | 296 } |
OLD | NEW |