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

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 1601093009: Redo CPDF_PageObjects - part 1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase Created 4 years, 11 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 | « fpdfsdk/src/fpdfeditpage.cpp ('k') | fpdfsdk/src/javascript/Document.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 "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 return nullptr; 290 return nullptr;
291 291
292 if (page_index < 0 || page_index >= pDoc->GetPageCount()) 292 if (page_index < 0 || page_index >= pDoc->GetPageCount())
293 return nullptr; 293 return nullptr;
294 294
295 CPDF_Dictionary* pDict = pDoc->GetPage(page_index); 295 CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
296 if (!pDict) 296 if (!pDict)
297 return NULL; 297 return NULL;
298 CPDF_Page* pPage = new CPDF_Page; 298 CPDF_Page* pPage = new CPDF_Page;
299 pPage->Load(pDoc, pDict); 299 pPage->Load(pDoc, pDict);
300 pPage->ParseContent(); 300 pPage->ParseContent(nullptr);
301 return pPage; 301 return pPage;
302 } 302 }
303 303
304 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page) { 304 DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page) {
305 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); 305 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
306 return pPage ? pPage->GetPageWidth() : 0.0; 306 return pPage ? pPage->GetPageWidth() : 0.0;
307 } 307 }
308 308
309 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page) { 309 DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page) {
310 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); 310 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 if (!buffer) { 913 if (!buffer) {
914 *buflen = len; 914 *buflen = len;
915 } else if (*buflen >= len) { 915 } else if (*buflen >= len) {
916 memcpy(buffer, utf16Name.c_str(), len); 916 memcpy(buffer, utf16Name.c_str(), len);
917 *buflen = len; 917 *buflen = len;
918 } else { 918 } else {
919 *buflen = -1; 919 *buflen = -1;
920 } 920 }
921 return (FPDF_DEST)pDestObj; 921 return (FPDF_DEST)pDestObj;
922 } 922 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfeditpage.cpp ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698