diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-29 16:26:27 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-29 16:26:27 -0800 |
commit | fe351dbc18e419b0ed9fbe34f2d1fb155b4f7bf1 (patch) | |
tree | ac7136643eb602f6fec582b4c3ef71694682730e /fpdfsdk/src/fpdfformfill.cpp | |
parent | 9b76113ae4567eb998618d049afde26d3f0175d5 (diff) | |
download | pdfium-fe351dbc18e419b0ed9fbe34f2d1fb155b4f7bf1.tar.xz |
Merge to XFA: Add tests for CBA_AnnotIterator.
Original Review URL: https://codereview.chromium.org/1652533002 .
(cherry picked from commit 1bce5f62f3292a6baf35491bf4c9b4fde2fb73e3)
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1652543003 .
Diffstat (limited to 'fpdfsdk/src/fpdfformfill.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfformfill.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 49dfd6c113..5825456b19 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -20,13 +20,8 @@ namespace { -CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { - CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; - return pEnv ? pEnv->GetSDKDocument() : nullptr; -} - CPDFSDK_InterForm* FormHandleToInterForm(FPDF_FORMHANDLE hHandle) { - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); return pSDKDoc ? pSDKDoc->GetInterForm() : nullptr; } @@ -36,7 +31,7 @@ CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle, if (!pPage) return nullptr; - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); return pSDKDoc ? pSDKDoc->GetPageView(pPage, TRUE) : nullptr; } @@ -285,7 +280,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, } DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); if (!pSDKDoc) return FALSE; @@ -681,20 +676,20 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, } DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) { - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated()) pSDKDoc->ProcJavascriptFun(); } DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) { - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated()) pSDKDoc->ProcOpenAction(); } DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType) { - CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); + CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); if (!pSDKDoc) return; |