| 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/cpdfsdk_formfillenvironment.h" | 7 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 dstRect.left = static_cast<float>(left); | 423 dstRect.left = static_cast<float>(left); |
| 424 dstRect.top = static_cast<float>(top < bottom ? bottom : top); | 424 dstRect.top = static_cast<float>(top < bottom ? bottom : top); |
| 425 dstRect.bottom = static_cast<float>(top < bottom ? top : bottom); | 425 dstRect.bottom = static_cast<float>(top < bottom ? top : bottom); |
| 426 dstRect.right = static_cast<float>(right); | 426 dstRect.right = static_cast<float>(right); |
| 427 } | 427 } |
| 428 | 428 |
| 429 FX_BOOL CPDFSDK_FormFillEnvironment::PopupMenu(FPDF_PAGE page, | 429 FX_BOOL CPDFSDK_FormFillEnvironment::PopupMenu(FPDF_PAGE page, |
| 430 FPDF_WIDGET hWidget, | 430 FPDF_WIDGET hWidget, |
| 431 int menuFlag, | 431 int menuFlag, |
| 432 CFX_PointF pt) { | 432 CFX_PointF pt) { |
| 433 if (!m_pInfo || !m_pInfo->FFI_PopupMenu) | 433 return m_pInfo && m_pInfo->FFI_PopupMenu && |
| 434 return FALSE; | 434 m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, menuFlag, pt.x, pt.y); |
| 435 return m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, menuFlag, pt.x, pt.y); | |
| 436 } | 435 } |
| 437 | 436 |
| 438 void CPDFSDK_FormFillEnvironment::Alert(FPDF_WIDESTRING Msg, | 437 void CPDFSDK_FormFillEnvironment::Alert(FPDF_WIDESTRING Msg, |
| 439 FPDF_WIDESTRING Title, | 438 FPDF_WIDESTRING Title, |
| 440 int Type, | 439 int Type, |
| 441 int Icon) { | 440 int Icon) { |
| 442 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert) { | 441 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert) { |
| 443 m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, Msg, Title, Type, | 442 m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, Msg, Title, Type, |
| 444 Icon); | 443 Icon); |
| 445 } | 444 } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 } else { | 760 } else { |
| 762 m_pFocusAnnot.Reset(pFocusAnnot.Get()); | 761 m_pFocusAnnot.Reset(pFocusAnnot.Get()); |
| 763 } | 762 } |
| 764 } | 763 } |
| 765 return FALSE; | 764 return FALSE; |
| 766 } | 765 } |
| 767 | 766 |
| 768 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { | 767 FX_BOOL CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) { |
| 769 return !!(GetPDFDocument()->GetUserPermissions() & nFlag); | 768 return !!(GetPDFDocument()->GetUserPermissions() & nFlag); |
| 770 } | 769 } |
| OLD | NEW |