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

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

Issue 1540693002: Get rid of a few CPDF_Object Create() methods and just use new instead. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 5 years 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/src/fpdfdoc/doc_ap.cpp ('k') | core/src/fpdfdoc/doc_form.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 "core/include/fpdfdoc/fpdf_doc.h" 7 #include "core/include/fpdfdoc/fpdf_doc.h"
8 8
9 const int nMaxRecursion = 32; 9 const int nMaxRecursion = 32;
10 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { 10 int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 return FALSE; 322 return FALSE;
323 } 323 }
324 } 324 }
325 } else { 325 } else {
326 csFileName = CFX_WideString::FromLocal(m_pObj->GetString()); 326 csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
327 } 327 }
328 csFileName = FILESPEC_DecodeFileName(csFileName); 328 csFileName = FILESPEC_DecodeFileName(csFileName);
329 return TRUE; 329 return TRUE;
330 } 330 }
331 CPDF_FileSpec::CPDF_FileSpec() { 331 CPDF_FileSpec::CPDF_FileSpec() {
332 m_pObj = CPDF_Dictionary::Create(); 332 m_pObj = new CPDF_Dictionary;
333 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { 333 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) {
334 pDict->SetAtName("Type", "Filespec"); 334 pDict->SetAtName("Type", "Filespec");
335 } 335 }
336 } 336 }
337 FX_BOOL CPDF_FileSpec::IsURL() const { 337 FX_BOOL CPDF_FileSpec::IsURL() const {
338 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) { 338 if (CPDF_Dictionary* pDict = ToDictionary(m_pObj)) {
339 return pDict->GetString("FS") == "URL"; 339 return pDict->GetString("FS") == "URL";
340 } 340 }
341 return FALSE; 341 return FALSE;
342 } 342 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 int nPage = FXSYS_atoi(bsLbl); 524 int nPage = FXSYS_atoi(bsLbl);
525 if (nPage > 0 && nPage <= nPages) { 525 if (nPage > 0 && nPage <= nPages) {
526 return nPage; 526 return nPage;
527 } 527 }
528 return -1; 528 return -1;
529 } 529 }
530 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { 530 int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const {
531 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr()); 531 CFX_ByteString bsLabel = PDF_EncodeText(wsLabel.GetPtr());
532 return GetPageByLabel(bsLabel); 532 return GetPageByLabel(bsLabel);
533 } 533 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_ap.cpp ('k') | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698