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

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

Issue 2353303004: Make creation of CPDFSDK_Document clearer (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 "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
10 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" 10 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return; 184 return;
185 185
186 if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index)) 186 if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index))
187 pPage->Release(); 187 pPage->Release();
188 } 188 }
189 189
190 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { 190 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) {
191 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr); 191 m_XFAPageList.SetAt(page->GetPageIndex(), nullptr);
192 } 192 }
193 193
194 CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument( 194 void CPDFXFA_Document::SetSDKDoc(std::unique_ptr<CPDFSDK_Document> pSDKDoc) {
dsinclair 2016/09/22 14:50:10 The one difference between this and the old code,
Tom Sepez 2016/09/22 17:02:23 Acknowledged.
Tom Sepez 2016/09/22 17:04:42 Actually, this scares me. who own the CPDFSKD_Doc
dsinclair 2016/09/22 17:32:12 Depends. In XFA it's owned by CPDFXFA_Document. In
195 CPDFSDK_Environment* pFormFillEnv) { 195 m_pSDKDoc.reset(pSDKDoc.release());
196 if (!m_pSDKDoc && pFormFillEnv)
197 m_pSDKDoc.reset(new CPDFSDK_Document(this, pFormFillEnv));
198 return m_pSDKDoc.get();
199 } 196 }
200 197
201 void CPDFXFA_Document::ClearChangeMark() { 198 void CPDFXFA_Document::ClearChangeMark() {
202 if (m_pSDKDoc) 199 if (m_pSDKDoc)
203 m_pSDKDoc->ClearChangeMark(); 200 m_pSDKDoc->ClearChangeMark();
204 } 201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698