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

Unified Diff: fpdfsdk/fpdfxfa/cpdfxfa_document.cpp

Issue 2397473006: Remove ownership of CPDFSDK_Document from CPDFXFA_Document (Closed)
Patch Set: Rebase to master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/cpdfxfa_document.h ('k') | samples/pdfium_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
index e49cfde8c4892b6a423b94fd27570a86ebe54401..121d0604534a418a2829423a0d01f75ccab94b8e 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
@@ -33,6 +33,7 @@ CPDFXFA_Document::CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc,
CPDFXFA_App* pProvider)
: m_iDocType(DOCTYPE_PDF),
m_pPDFDoc(std::move(pPDFDoc)),
+ m_pSDKDoc(nullptr),
m_pXFADocView(nullptr),
m_pApp(pProvider),
m_nLoadStatus(FXFA_LOADSTATUS_PRELOAD),
@@ -42,6 +43,11 @@ CPDFXFA_Document::CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc,
CPDFXFA_Document::~CPDFXFA_Document() {
m_nLoadStatus = FXFA_LOADSTATUS_CLOSING;
+ if (m_pSDKDoc) {
+ m_pSDKDoc->ClearAllFocusedAnnots();
+ m_pSDKDoc = nullptr;
+ }
+
if (m_pXFADoc) {
CXFA_FFApp* pApp = m_pApp->GetXFAApp();
if (pApp) {
@@ -191,10 +197,6 @@ void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) {
m_XFAPageList.SetAt(page->GetPageIndex(), nullptr);
}
-void CPDFXFA_Document::SetSDKDoc(std::unique_ptr<CPDFSDK_Document> pSDKDoc) {
- m_pSDKDoc.reset(pSDKDoc.release());
-}
-
void CPDFXFA_Document::ClearChangeMark() {
if (m_pSDKDoc)
m_pSDKDoc->ClearChangeMark();
« no previous file with comments | « fpdfsdk/fpdfxfa/cpdfxfa_document.h ('k') | samples/pdfium_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698