| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/include/cpdfsdk_document.h" | 7 #include "fpdfsdk/include/cpdfsdk_document.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 delete pPageView; | 152 delete pPageView; |
| 153 } | 153 } |
| 154 | 154 |
| 155 UnderlyingPageType* CPDFSDK_Document::GetPage(int nIndex) { | 155 UnderlyingPageType* CPDFSDK_Document::GetPage(int nIndex) { |
| 156 return UnderlyingFromFPDFPage(m_pEnv->GetPage(m_pDoc, nIndex)); | 156 return UnderlyingFromFPDFPage(m_pEnv->GetPage(m_pDoc, nIndex)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 CPDFSDK_InterForm* CPDFSDK_Document::GetInterForm() { | 159 CPDFSDK_InterForm* CPDFSDK_Document::GetInterForm() { |
| 160 if (!m_pInterForm) | 160 if (!m_pInterForm) |
| 161 m_pInterForm.reset(new CPDFSDK_InterForm(this)); | 161 m_pInterForm = WrapUnique(new CPDFSDK_InterForm(this)); |
| 162 return m_pInterForm.get(); | 162 return m_pInterForm.get(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void CPDFSDK_Document::UpdateAllViews(CPDFSDK_PageView* pSender, | 165 void CPDFSDK_Document::UpdateAllViews(CPDFSDK_PageView* pSender, |
| 166 CPDFSDK_Annot* pAnnot) { | 166 CPDFSDK_Annot* pAnnot) { |
| 167 for (const auto& it : m_pageMap) { | 167 for (const auto& it : m_pageMap) { |
| 168 CPDFSDK_PageView* pPageView = it.second; | 168 CPDFSDK_PageView* pPageView = it.second; |
| 169 if (pPageView != pSender) { | 169 if (pPageView != pSender) { |
| 170 pPageView->UpdateView(pAnnot); | 170 pPageView->UpdateView(pAnnot); |
| 171 } | 171 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 return GetPDFDocument()->GetUserPermissions() & nFlag; | 253 return GetPDFDocument()->GetUserPermissions() & nFlag; |
| 254 } | 254 } |
| 255 | 255 |
| 256 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { | 256 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { |
| 257 return m_pEnv->GetJSRuntime(); | 257 return m_pEnv->GetJSRuntime(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 CFX_WideString CPDFSDK_Document::GetPath() { | 260 CFX_WideString CPDFSDK_Document::GetPath() { |
| 261 return m_pEnv->JS_docGetFilePath(); | 261 return m_pEnv->JS_docGetFilePath(); |
| 262 } | 262 } |
| OLD | NEW |