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

Side by Side Diff: fpdfsdk/fpdfppo.cpp

Issue 2354933002: Rename CPDFXFA_Document::GetPageCount (Closed)
Patch Set: Created 4 years, 3 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 "public/fpdf_ppo.h" 7 #include "public/fpdf_ppo.h"
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 int index) { 362 int index) {
363 CPDF_Document* pDestDoc = CPDFDocumentFromFPDFDocument(dest_doc); 363 CPDF_Document* pDestDoc = CPDFDocumentFromFPDFDocument(dest_doc);
364 if (!dest_doc) 364 if (!dest_doc)
365 return FALSE; 365 return FALSE;
366 366
367 CPDF_Document* pSrcDoc = CPDFDocumentFromFPDFDocument(src_doc); 367 CPDF_Document* pSrcDoc = CPDFDocumentFromFPDFDocument(src_doc);
368 if (!pSrcDoc) 368 if (!pSrcDoc)
369 return FALSE; 369 return FALSE;
370 370
371 std::vector<uint16_t> pageArray; 371 std::vector<uint16_t> pageArray;
372 // TODO(dsinclair): Verify this works for XFA documents.
372 int nCount = pSrcDoc->GetPageCount(); 373 int nCount = pSrcDoc->GetPageCount();
373 if (pagerange) { 374 if (pagerange) {
374 if (!ParserPageRangeString(pagerange, &pageArray, nCount)) 375 if (!ParserPageRangeString(pagerange, &pageArray, nCount))
375 return FALSE; 376 return FALSE;
376 } else { 377 } else {
377 for (int i = 1; i <= nCount; ++i) { 378 for (int i = 1; i <= nCount; ++i) {
378 pageArray.push_back(i); 379 pageArray.push_back(i);
379 } 380 }
380 } 381 }
381 382
(...skipping 17 matching lines...) Expand all
399 if (!pSrcDict) 400 if (!pSrcDict)
400 return FALSE; 401 return FALSE;
401 402
402 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); 403 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
403 if (!pDstDict) 404 if (!pDstDict)
404 return FALSE; 405 return FALSE;
405 406
406 pDstDict->SetFor("ViewerPreferences", pSrcDict->CloneDirectObject()); 407 pDstDict->SetFor("ViewerPreferences", pSrcDict->CloneDirectObject());
407 return TRUE; 408 return TRUE;
408 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698