| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 if (pPageView != pSender) { | 170 if (pPageView != pSender) { |
| 171 pPageView->UpdateView(pAnnot); | 171 pPageView->UpdateView(pAnnot); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot() { | 176 CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot() { |
| 177 return m_pFocusAnnot; | 177 return m_pFocusAnnot; |
| 178 } | 178 } |
| 179 | 179 |
| 180 FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { | 180 FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot, |
| 181 unsigned int nFlag) { |
| 181 if (m_bBeingDestroyed) | 182 if (m_bBeingDestroyed) |
| 182 return FALSE; | 183 return FALSE; |
| 183 | 184 |
| 184 if (m_pFocusAnnot == pAnnot) | 185 if (m_pFocusAnnot == pAnnot) |
| 185 return TRUE; | 186 return TRUE; |
| 186 | 187 |
| 187 if (m_pFocusAnnot) { | 188 if (m_pFocusAnnot) { |
| 188 if (!KillFocusAnnot(nFlag)) | 189 if (!KillFocusAnnot(nFlag)) |
| 189 return FALSE; | 190 return FALSE; |
| 190 } | 191 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 207 return FALSE; | 208 return FALSE; |
| 208 if (!m_pFocusAnnot) { | 209 if (!m_pFocusAnnot) { |
| 209 m_pFocusAnnot = pAnnot; | 210 m_pFocusAnnot = pAnnot; |
| 210 return TRUE; | 211 return TRUE; |
| 211 } | 212 } |
| 212 } | 213 } |
| 213 } | 214 } |
| 214 return FALSE; | 215 return FALSE; |
| 215 } | 216 } |
| 216 | 217 |
| 217 FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag) { | 218 FX_BOOL CPDFSDK_Document::KillFocusAnnot(unsigned int nFlag) { |
| 218 if (m_pFocusAnnot) { | 219 if (m_pFocusAnnot) { |
| 219 CPDFSDK_AnnotHandlerMgr* pAnnotHandler = m_pEnv->GetAnnotHandlerMgr(); | 220 CPDFSDK_AnnotHandlerMgr* pAnnotHandler = m_pEnv->GetAnnotHandlerMgr(); |
| 220 CPDFSDK_Annot* pFocusAnnot = m_pFocusAnnot; | 221 CPDFSDK_Annot* pFocusAnnot = m_pFocusAnnot; |
| 221 m_pFocusAnnot = nullptr; | 222 m_pFocusAnnot = nullptr; |
| 222 | 223 |
| 223 #ifdef PDF_ENABLE_XFA | 224 #ifdef PDF_ENABLE_XFA |
| 224 if (!pAnnotHandler->Annot_OnChangeFocus(nullptr, pFocusAnnot)) | 225 if (!pAnnotHandler->Annot_OnChangeFocus(nullptr, pFocusAnnot)) |
| 225 return FALSE; | 226 return FALSE; |
| 226 #endif // PDF_ENABLE_XFA | 227 #endif // PDF_ENABLE_XFA |
| 227 | 228 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 252 return GetPDFDocument()->GetUserPermissions() & nFlag; | 253 return GetPDFDocument()->GetUserPermissions() & nFlag; |
| 253 } | 254 } |
| 254 | 255 |
| 255 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { | 256 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { |
| 256 return m_pEnv->GetJSRuntime(); | 257 return m_pEnv->GetJSRuntime(); |
| 257 } | 258 } |
| 258 | 259 |
| 259 CFX_WideString CPDFSDK_Document::GetPath() { | 260 CFX_WideString CPDFSDK_Document::GetPath() { |
| 260 return m_pEnv->JS_docGetFilePath(); | 261 return m_pEnv->JS_docGetFilePath(); |
| 261 } | 262 } |
| OLD | NEW |