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

Side by Side Diff: fpdfsdk/fpdfxfa/fpdfxfa_page.cpp

Issue 2381723002: Replace std::unique_ptr.reset() with WrapUnique assignment. (Closed)
Patch Set: build Created 4 years, 2 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/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/fxedit/fxet_edit.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 "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h" 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_page.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.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 32
33 CPDF_Document* pPDFDoc = m_pDocument->GetPDFDoc(); 33 CPDF_Document* pPDFDoc = m_pDocument->GetPDFDoc();
34 if (!pPDFDoc) 34 if (!pPDFDoc)
35 return FALSE; 35 return FALSE;
36 36
37 CPDF_Dictionary* pDict = pPDFDoc->GetPage(m_iPageIndex); 37 CPDF_Dictionary* pDict = pPDFDoc->GetPage(m_iPageIndex);
38 if (!pDict) 38 if (!pDict)
39 return FALSE; 39 return FALSE;
40 40
41 if (!m_pPDFPage || m_pPDFPage->m_pFormDict != pDict) { 41 if (!m_pPDFPage || m_pPDFPage->m_pFormDict != pDict) {
42 m_pPDFPage.reset(new CPDF_Page(pPDFDoc, pDict, true)); 42 m_pPDFPage = WrapUnique(new CPDF_Page(pPDFDoc, pDict, true));
43 m_pPDFPage->ParseContent(); 43 m_pPDFPage->ParseContent();
44 } 44 }
45 return TRUE; 45 return TRUE;
46 } 46 }
47 47
48 FX_BOOL CPDFXFA_Page::LoadXFAPageView() { 48 FX_BOOL CPDFXFA_Page::LoadXFAPageView() {
49 if (!m_pDocument) 49 if (!m_pDocument)
50 return FALSE; 50 return FALSE;
51 51
52 CXFA_FFDoc* pXFADoc = m_pDocument->GetXFADoc(); 52 CXFA_FFDoc* pXFADoc = m_pDocument->GetXFADoc();
(...skipping 27 matching lines...) Expand all
80 } 80 }
81 default: 81 default:
82 return FALSE; 82 return FALSE;
83 } 83 }
84 } 84 }
85 85
86 FX_BOOL CPDFXFA_Page::LoadPDFPage(CPDF_Dictionary* pageDict) { 86 FX_BOOL CPDFXFA_Page::LoadPDFPage(CPDF_Dictionary* pageDict) {
87 if (!m_pDocument || m_iPageIndex < 0 || !pageDict) 87 if (!m_pDocument || m_iPageIndex < 0 || !pageDict)
88 return FALSE; 88 return FALSE;
89 89
90 m_pPDFPage.reset(new CPDF_Page(m_pDocument->GetPDFDoc(), pageDict, true)); 90 m_pPDFPage =
91 WrapUnique(new CPDF_Page(m_pDocument->GetPDFDoc(), pageDict, true));
91 m_pPDFPage->ParseContent(); 92 m_pPDFPage->ParseContent();
92 return TRUE; 93 return TRUE;
93 } 94 }
94 95
95 FX_FLOAT CPDFXFA_Page::GetPageWidth() const { 96 FX_FLOAT CPDFXFA_Page::GetPageWidth() const {
96 if (!m_pPDFPage && !m_pXFAPageView) 97 if (!m_pPDFPage && !m_pXFAPageView)
97 return 0.0f; 98 return 0.0f;
98 99
99 int nDocType = m_pDocument->GetDocType(); 100 int nDocType = m_pDocument->GetDocType();
100 switch (nDocType) { 101 switch (nDocType) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 case DOCTYPE_PDF: 214 case DOCTYPE_PDF:
214 case DOCTYPE_STATIC_XFA: { 215 case DOCTYPE_STATIC_XFA: {
215 if (m_pPDFPage) { 216 if (m_pPDFPage) {
216 m_pPDFPage->GetDisplayMatrix(matrix, xPos, yPos, xSize, ySize, iRotate); 217 m_pPDFPage->GetDisplayMatrix(matrix, xPos, yPos, xSize, ySize, iRotate);
217 } 218 }
218 } break; 219 } break;
219 default: 220 default:
220 return; 221 return;
221 } 222 }
222 } 223 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/fxedit/fxet_edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698