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

Side by Side Diff: xfa/fxfa/app/xfa_ffwidgetacc.cpp

Issue 2045883004: Remove more FXJSE c-method wrappers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "xfa/fxfa/app/xfa_ffwidgetacc.h" 7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 UpdateUIDisplay(); 363 UpdateUIDisplay();
364 } 364 }
365 return XFA_EVENTERROR_Success; 365 return XFA_EVENTERROR_Success;
366 } 366 }
367 367
368 void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate, 368 void CXFA_WidgetAcc::ProcessScriptTestValidate(CXFA_Validate validate,
369 int32_t iRet, 369 int32_t iRet,
370 CFXJSE_Value* pRetValue, 370 CFXJSE_Value* pRetValue,
371 FX_BOOL bVersionFlag) { 371 FX_BOOL bVersionFlag) {
372 if (iRet == XFA_EVENTERROR_Success && pRetValue) { 372 if (iRet == XFA_EVENTERROR_Success && pRetValue) {
373 if (FXJSE_Value_IsBoolean(pRetValue) && !pRetValue->ToBoolean()) { 373 if (pRetValue->IsBoolean() && !pRetValue->ToBoolean()) {
374 IXFA_AppProvider* pAppProvider = GetAppProvider(); 374 IXFA_AppProvider* pAppProvider = GetAppProvider();
375 if (!pAppProvider) { 375 if (!pAppProvider) {
376 return; 376 return;
377 } 377 }
378 CFX_WideString wsTitle; 378 CFX_WideString wsTitle;
379 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); 379 pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
380 CFX_WideString wsScriptMsg; 380 CFX_WideString wsScriptMsg;
381 validate.GetScriptMessageText(wsScriptMsg); 381 validate.GetScriptMessageText(wsScriptMsg);
382 int32_t eScriptTest = validate.GetScriptTest(); 382 int32_t eScriptTest = validate.GetScriptTest();
383 if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) { 383 if (eScriptTest == XFA_ATTRIBUTEENUM_Warning) {
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 ++m_nRecursionDepth; 650 ++m_nRecursionDepth;
651 FX_BOOL bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType, 651 FX_BOOL bRet = pContext->RunScript((XFA_SCRIPTLANGTYPE)eScriptType,
652 wsExpression.AsStringC(), 652 wsExpression.AsStringC(),
653 pTmpRetValue.get(), m_pNode); 653 pTmpRetValue.get(), m_pNode);
654 --m_nRecursionDepth; 654 --m_nRecursionDepth;
655 int32_t iRet = XFA_EVENTERROR_Error; 655 int32_t iRet = XFA_EVENTERROR_Error;
656 if (bRet) { 656 if (bRet) {
657 iRet = XFA_EVENTERROR_Success; 657 iRet = XFA_EVENTERROR_Success;
658 if (pEventParam->m_eType == XFA_EVENT_Calculate || 658 if (pEventParam->m_eType == XFA_EVENT_Calculate ||
659 pEventParam->m_eType == XFA_EVENT_InitCalculate) { 659 pEventParam->m_eType == XFA_EVENT_InitCalculate) {
660 if (!FXJSE_Value_IsUndefined(pTmpRetValue.get())) { 660 if (!pTmpRetValue->IsUndefined()) {
661 if (!FXJSE_Value_IsNull(pTmpRetValue.get())) { 661 if (!pTmpRetValue->IsNull()) {
662 CFX_ByteString bsString; 662 CFX_ByteString bsString;
663 pTmpRetValue->ToString(bsString); 663 pTmpRetValue->ToString(bsString);
664 pEventParam->m_wsResult = 664 pEventParam->m_wsResult =
665 CFX_WideString::FromUTF8(bsString.AsStringC()); 665 CFX_WideString::FromUTF8(bsString.AsStringC());
666 } 666 }
667 iRet = XFA_EVENTERROR_Success; 667 iRet = XFA_EVENTERROR_Success;
668 } else { 668 } else {
669 iRet = XFA_EVENTERROR_Error; 669 iRet = XFA_EVENTERROR_Error;
670 } 670 }
671 if (pEventParam->m_eType == XFA_EVENT_InitCalculate) { 671 if (pEventParam->m_eType == XFA_EVENT_InitCalculate) {
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 if (pIDNode) { 1690 if (pIDNode) {
1691 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); 1691 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData();
1692 } 1692 }
1693 if (pEmbAcc) { 1693 if (pEmbAcc) {
1694 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); 1694 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display);
1695 return TRUE; 1695 return TRUE;
1696 } 1696 }
1697 } 1697 }
1698 return FALSE; 1698 return FALSE;
1699 } 1699 }
OLDNEW
« no previous file with comments | « no previous file | xfa/fxfa/fm2js/xfa_fm2jscontext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698