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 "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
8 #include "../../public/fpdf_doc.h" | |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 int THISMODULE = 0; | 12 int THISMODULE = 0; |
13 | 13 |
14 CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree, | 14 CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree, |
15 CPDF_Bookmark bookmark, | 15 CPDF_Bookmark bookmark, |
16 const CFX_WideString& title) { | 16 const CFX_WideString& title) { |
17 if (bookmark && bookmark.GetTitle().CompareNoCase(title.c_str()) == 0) { | 17 if (bookmark && bookmark.GetTitle().CompareNoCase(title.c_str()) == 0) { |
18 // First check this item | 18 // First check this item |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 return 0; | 326 return 0; |
327 CFX_WideString text = pInfo->GetUnicodeText(tag); | 327 CFX_WideString text = pInfo->GetUnicodeText(tag); |
328 // Use UTF-16LE encoding | 328 // Use UTF-16LE encoding |
329 CFX_ByteString encodedText = text.UTF16LE_Encode(); | 329 CFX_ByteString encodedText = text.UTF16LE_Encode(); |
330 unsigned long len = encodedText.GetLength(); | 330 unsigned long len = encodedText.GetLength(); |
331 if (buffer && buflen >= len) { | 331 if (buffer && buflen >= len) { |
332 FXSYS_memcpy(buffer, encodedText.c_str(), len); | 332 FXSYS_memcpy(buffer, encodedText.c_str(), len); |
333 } | 333 } |
334 return len; | 334 return len; |
335 } | 335 } |
OLD | NEW |