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