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

Side by Side Diff: core/fpdfdoc/doc_action.cpp

Issue 1853233002: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix CPDF_Name::GetConstString() Created 4 years, 8 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
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | core/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 20 matching lines...) Expand all
31 CFX_ByteString type = m_pDict->GetStringBy("S"); 31 CFX_ByteString type = m_pDict->GetStringBy("S");
32 if (type != "GoTo" && type != "GoToR") { 32 if (type != "GoTo" && type != "GoToR") {
33 return CPDF_Dest(); 33 return CPDF_Dest();
34 } 34 }
35 CPDF_Object* pDest = m_pDict->GetDirectObjectBy("D"); 35 CPDF_Object* pDest = m_pDict->GetDirectObjectBy("D");
36 if (!pDest) { 36 if (!pDest) {
37 return CPDF_Dest(); 37 return CPDF_Dest();
38 } 38 }
39 if (pDest->IsString() || pDest->IsName()) { 39 if (pDest->IsString() || pDest->IsName()) {
40 CPDF_NameTree name_tree(pDoc, "Dests"); 40 CPDF_NameTree name_tree(pDoc, "Dests");
41 CFX_ByteStringC name = pDest->GetString(); 41 return CPDF_Dest(
42 return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name)); 42 name_tree.LookupNamedDest(pDoc, pDest->GetString().AsByteStringC()));
43 } 43 }
44 if (CPDF_Array* pArray = pDest->AsArray()) 44 if (CPDF_Array* pArray = pDest->AsArray())
45 return CPDF_Dest(pArray); 45 return CPDF_Dest(pArray);
46 return CPDF_Dest(); 46 return CPDF_Dest();
47 } 47 }
48 48
49 CPDF_Action::ActionType CPDF_Action::GetType() const { 49 CPDF_Action::ActionType CPDF_Action::GetType() const {
50 if (!m_pDict) 50 if (!m_pDict)
51 return Unknown; 51 return Unknown;
52 52
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (!ToDictionary(pAction)) { 294 if (!ToDictionary(pAction)) {
295 return CPDF_Action(); 295 return CPDF_Action();
296 } 296 }
297 return CPDF_Action(pAction->GetDict()); 297 return CPDF_Action(pAction->GetDict());
298 } 298 }
299 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { 299 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const {
300 ASSERT(m_pDocument); 300 ASSERT(m_pDocument);
301 CPDF_NameTree name_tree(m_pDocument, "JavaScript"); 301 CPDF_NameTree name_tree(m_pDocument, "JavaScript");
302 return name_tree.GetIndex(csName); 302 return name_tree.GetIndex(csName);
303 } 303 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | core/fpdfdoc/doc_annot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698