diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-05-01 17:46:34 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-01 17:46:34 +0000 |
commit | 3f3c39d04fd68d8ce11f52baa3acae8e0522a2c4 (patch) | |
tree | 6126bc07b3e212f758dfa4e13462fb7bfaa6d97f /fpdfsdk/cpdfsdk_formfillenvironment.cpp | |
parent | fe06d5109cd575c1e53b9b1cc3cc4ec3c5d7364f (diff) | |
download | pdfium-3f3c39d04fd68d8ce11f52baa3acae8e0522a2c4.tar.xz |
Check for NULL XFA context even when XFA
Use strict typing for FPDF_Page to ensure we don't fall into
code that expects the other page type when continuing from null
context case.
Change-Id: I7f028ef3e3d733f5557620030a87e22997da00d5
Reviewed-on: https://pdfium-review.googlesource.com/31770
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_formfillenvironment.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_formfillenvironment.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp index 6007ac9443..599aed3cf2 100644 --- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp +++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp @@ -234,8 +234,8 @@ CPDFSDK_FormFillEnvironment::GetInteractiveFormFiller() { void CPDFSDK_FormFillEnvironment::Invalidate(UnderlyingPageType* page, const FX_RECT& rect) { if (m_pInfo && m_pInfo->FFI_Invalidate) { - m_pInfo->FFI_Invalidate(m_pInfo, page, rect.left, rect.top, rect.right, - rect.bottom); + m_pInfo->FFI_Invalidate(m_pInfo, FPDFPageFromUnderlying(page), rect.left, + rect.top, rect.right, rect.bottom); } } @@ -243,8 +243,9 @@ void CPDFSDK_FormFillEnvironment::OutputSelectedRect( UnderlyingPageType* page, const CFX_FloatRect& rect) { if (m_pInfo && m_pInfo->FFI_OutputSelectedRect) { - m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, rect.left, rect.top, - rect.right, rect.bottom); + m_pInfo->FFI_OutputSelectedRect(m_pInfo, FPDFPageFromUnderlying(page), + rect.left, rect.top, rect.right, + rect.bottom); } } @@ -331,8 +332,8 @@ void CPDFSDK_FormFillEnvironment::DisplayCaret(CPDFXFA_Page* page, double right, double bottom) { if (m_pInfo && m_pInfo->FFI_DisplayCaret) { - m_pInfo->FFI_DisplayCaret(m_pInfo, page, bVisible, left, top, right, - bottom); + m_pInfo->FFI_DisplayCaret(m_pInfo, FPDFPageFromUnderlying(page), bVisible, + left, top, right, bottom); } } @@ -386,7 +387,8 @@ void CPDFSDK_FormFillEnvironment::GetPageViewRect(CPDFXFA_Page* page, double top; double right; double bottom; - m_pInfo->FFI_GetPageViewRect(m_pInfo, page, &left, &top, &right, &bottom); + m_pInfo->FFI_GetPageViewRect(m_pInfo, FPDFPageFromUnderlying(page), &left, + &top, &right, &bottom); dstRect.left = static_cast<float>(left); dstRect.top = static_cast<float>(top); @@ -399,7 +401,8 @@ bool CPDFSDK_FormFillEnvironment::PopupMenu(CPDFXFA_Page* page, int menuFlag, CFX_PointF pt) { return m_pInfo && m_pInfo->FFI_PopupMenu && - m_pInfo->FFI_PopupMenu(m_pInfo, page, hWidget, menuFlag, pt.x, pt.y); + m_pInfo->FFI_PopupMenu(m_pInfo, FPDFPageFromUnderlying(page), hWidget, + menuFlag, pt.x, pt.y); } void CPDFSDK_FormFillEnvironment::Alert(FPDF_WIDESTRING Msg, |