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

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

Issue 1862123003: Rename both As{Byte,Wide}StringC() helpers to AsStringC(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, fix new usage. 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 21 matching lines...) Expand all
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 return CPDF_Dest( 41 return CPDF_Dest(
42 name_tree.LookupNamedDest(pDoc, pDest->GetString().AsByteStringC())); 42 name_tree.LookupNamedDest(pDoc, pDest->GetString().AsStringC()));
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 14 matching lines...) Expand all
67 type != "ImportData") { 67 type != "ImportData") {
68 return CFX_WideString(); 68 return CFX_WideString();
69 } 69 }
70 CPDF_Object* pFile = m_pDict->GetDirectObjectBy("F"); 70 CPDF_Object* pFile = m_pDict->GetDirectObjectBy("F");
71 CFX_WideString path; 71 CFX_WideString path;
72 if (!pFile) { 72 if (!pFile) {
73 if (type == "Launch") { 73 if (type == "Launch") {
74 CPDF_Dictionary* pWinDict = m_pDict->GetDictBy("Win"); 74 CPDF_Dictionary* pWinDict = m_pDict->GetDictBy("Win");
75 if (pWinDict) { 75 if (pWinDict) {
76 return CFX_WideString::FromLocal( 76 return CFX_WideString::FromLocal(
77 pWinDict->GetStringBy("F").AsByteStringC()); 77 pWinDict->GetStringBy("F").AsStringC());
78 } 78 }
79 } 79 }
80 return path; 80 return path;
81 } 81 }
82 CPDF_FileSpec filespec(pFile); 82 CPDF_FileSpec filespec(pFile);
83 filespec.GetFileName(&path); 83 filespec.GetFileName(&path);
84 return path; 84 return path;
85 } 85 }
86 CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const { 86 CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const {
87 CFX_ByteString csURI; 87 CFX_ByteString csURI;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 if (!ToDictionary(pAction)) { 295 if (!ToDictionary(pAction)) {
296 return CPDF_Action(); 296 return CPDF_Action();
297 } 297 }
298 return CPDF_Action(pAction->GetDict()); 298 return CPDF_Action(pAction->GetDict());
299 } 299 }
300 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { 300 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const {
301 ASSERT(m_pDocument); 301 ASSERT(m_pDocument);
302 CPDF_NameTree name_tree(m_pDocument, "JavaScript"); 302 CPDF_NameTree name_tree(m_pDocument, "JavaScript");
303 return name_tree.GetIndex(csName); 303 return name_tree.GetIndex(csName);
304 } 304 }
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