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

Side by Side Diff: core/src/fpdfdoc/doc_bookmark.cpp

Issue 1417033004: Merge to XFA: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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
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 <vector> 7 #include <vector>
8 8
9 #include "../../../third_party/base/nonstd_unique_ptr.h" 9 #include "../../../third_party/base/nonstd_unique_ptr.h"
10 #include "../../include/fpdfdoc/fpdf_doc.h" 10 #include "../../include/fpdfdoc/fpdf_doc.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 FX_WCHAR w = title[i]; 65 FX_WCHAR w = title[i];
66 buf[i] = w > 0x20 ? w : 0x20; 66 buf[i] = w > 0x20 ? w : 0x20;
67 } 67 }
68 return CFX_WideString(buf.get(), len); 68 return CFX_WideString(buf.get(), len);
69 } 69 }
70 CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const { 70 CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const {
71 if (!m_pDict) { 71 if (!m_pDict) {
72 return CPDF_Dest(); 72 return CPDF_Dest();
73 } 73 }
74 CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); 74 CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
75 if (!pDest) { 75 if (!pDest)
76 return CPDF_Dest(); 76 return CPDF_Dest();
77 } 77
78 if (pDest->IsString() || pDest->GetType() == PDFOBJ_NAME) { 78 if (pDest->IsString() || pDest->IsName()) {
79 CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests")); 79 CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests"));
80 CFX_ByteStringC name = pDest->GetString(); 80 CFX_ByteStringC name = pDest->GetString();
81 return CPDF_Dest(name_tree.LookupNamedDest(pDocument, name)); 81 return CPDF_Dest(name_tree.LookupNamedDest(pDocument, name));
82 } 82 }
83 if (pDest->GetType() == PDFOBJ_ARRAY) { 83 if (pDest->GetType() == PDFOBJ_ARRAY) {
84 return CPDF_Dest((CPDF_Array*)pDest); 84 return CPDF_Dest((CPDF_Array*)pDest);
85 } 85 }
86 return CPDF_Dest(); 86 return CPDF_Dest();
87 } 87 }
88 CPDF_Action CPDF_Bookmark::GetAction() const { 88 CPDF_Action CPDF_Bookmark::GetAction() const {
89 if (!m_pDict) { 89 if (!m_pDict) {
90 return CPDF_Action(); 90 return CPDF_Action();
91 } 91 }
92 return CPDF_Action(m_pDict->GetDict("A")); 92 return CPDF_Action(m_pDict->GetDict("A"));
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698