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/fpdfdoc.h" | 8 #include "../include/fpdfdoc.h" |
9 | 9 |
10 static int THISMODULE = 0; | 10 static int THISMODULE = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
22 CPDF_Bookmark found = FindBookmark(tree, child, title); | 22 CPDF_Bookmark found = FindBookmark(tree, child, title); |
23 if (found) | 23 if (found) |
24 return found; | 24 return found; |
25 child = tree.GetNextSibling(child); | 25 child = tree.GetNextSibling(child); |
26 } | 26 } |
27 return CPDF_Bookmark(); | 27 return CPDF_Bookmark(); |
28 } | 28 } |
29 | 29 |
30 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetFirstChild(FPDF_DOCUMENT documen
t, FPDF_BOOKMARK pDict) | 30 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetFirstChild(FPDF_DOCUMENT documen
t, FPDF_BOOKMARK pDict) |
31 { | 31 { |
32 if (!document || !pDict) | 32 if (!document) |
33 return NULL; | 33 return NULL; |
34 CPDF_Document* pDoc = (CPDF_Document*)document; | 34 CPDF_Document* pDoc = (CPDF_Document*)document; |
35 CPDF_BookmarkTree tree(pDoc); | 35 CPDF_BookmarkTree tree(pDoc); |
36 CPDF_Bookmark bookmark = CPDF_Bookmark((CPDF_Dictionary*)pDict); | 36 CPDF_Bookmark bookmark = CPDF_Bookmark((CPDF_Dictionary*)pDict); |
37 return tree.GetFirstChild(bookmark).GetDict(); | 37 return tree.GetFirstChild(bookmark).GetDict(); |
38 } | 38 } |
39 | 39 |
40 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetNextSibling(FPDF_DOCUMENT docume
nt, FPDF_BOOKMARK pDict) | 40 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetNextSibling(FPDF_DOCUMENT docume
nt, FPDF_BOOKMARK pDict) |
41 { | 41 { |
42 if (!document || !pDict) | 42 if (!document || !pDict) |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 CFX_ByteString encodedText = text.UTF16LE_Encode(); | 293 CFX_ByteString encodedText = text.UTF16LE_Encode(); |
294 unsigned long len = encodedText.GetLength(); | 294 unsigned long len = encodedText.GetLength(); |
295 if (buffer && buflen >= len + 2) { | 295 if (buffer && buflen >= len + 2) { |
296 FXSYS_memcpy(buffer, encodedText.c_str(), len); | 296 FXSYS_memcpy(buffer, encodedText.c_str(), len); |
297 // use double zero as trailer | 297 // use double zero as trailer |
298 ((FX_BYTE*)buffer)[len] = 0; | 298 ((FX_BYTE*)buffer)[len] = 0; |
299 ((FX_BYTE*)buffer)[len + 1] = 0; | 299 ((FX_BYTE*)buffer)[len + 1] = 0; |
300 } | 300 } |
301 return len+2; | 301 return len+2; |
302 } | 302 } |
OLD | NEW |