Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1407583004: Changes to master to more closely match XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 "../../public/fpdf_formfill.h" 7 #include "../../public/fpdf_formfill.h"
8 #include "../../public/fpdfview.h" 8 #include "../../public/fpdfview.h"
9 #include "../../third_party/base/nonstd_unique_ptr.h" 9 #include "../../third_party/base/nonstd_unique_ptr.h"
10 #include "../include/fsdk_define.h" 10 #include "../include/fsdk_define.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, 315 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
316 FPDF_FORMHANDLE hHandle, 316 FPDF_FORMHANDLE hHandle,
317 int aaType) { 317 int aaType) {
318 if (!hHandle || !page) 318 if (!hHandle || !page)
319 return; 319 return;
320 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); 320 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
321 CPDF_Page* pPage = (CPDF_Page*)page; 321 CPDF_Page* pPage = (CPDF_Page*)page;
322 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE); 322 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
323 if (pPageView) { 323 if (pPageView) {
324 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv(); 324 CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
325 ASSERT(pEnv != NULL);
326
327 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); 325 CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
328 ASSERT(pActionHandler != NULL);
329
330 CPDF_Dictionary* pPageDict = pPage->m_pFormDict; 326 CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
331 ASSERT(pPageDict != NULL);
332
333 CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA")); 327 CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
334 328
335 FX_BOOL bExistOAAction = FALSE; 329 FX_BOOL bExistOAAction = FALSE;
336 FX_BOOL bExistCAAction = FALSE; 330 FX_BOOL bExistCAAction = FALSE;
337 if (FPDFPAGE_AACTION_OPEN == aaType) { 331 if (FPDFPAGE_AACTION_OPEN == aaType) {
338 bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage); 332 bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
339 if (bExistOAAction) { 333 if (bExistOAAction) {
340 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage); 334 CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
341 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 335 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
342 } 336 }
343 } else { 337 } else {
344 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage); 338 bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
345 if (bExistCAAction) { 339 if (bExistCAAction) {
346 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 340 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
347 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 341 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
348 } 342 }
349 } 343 }
350 } 344 }
351 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698