OLD | NEW |
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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 (!pTmpRetValue->IsUndefined()) { | 660 if (!pTmpRetValue->IsUndefined()) { |
661 if (!pTmpRetValue->IsNull()) { | 661 if (!pTmpRetValue->IsNull()) |
662 CFX_ByteString bsString; | 662 pEventParam->m_wsResult = pTmpRetValue->ToWideString(); |
663 pTmpRetValue->ToString(bsString); | 663 |
664 pEventParam->m_wsResult = | |
665 CFX_WideString::FromUTF8(bsString.AsStringC()); | |
666 } | |
667 iRet = XFA_EVENTERROR_Success; | 664 iRet = XFA_EVENTERROR_Success; |
668 } else { | 665 } else { |
669 iRet = XFA_EVENTERROR_Error; | 666 iRet = XFA_EVENTERROR_Error; |
670 } | 667 } |
671 if (pEventParam->m_eType == XFA_EVENT_InitCalculate) { | 668 if (pEventParam->m_eType == XFA_EVENT_InitCalculate) { |
672 if ((iRet == XFA_EVENTERROR_Success) && | 669 if ((iRet == XFA_EVENTERROR_Success) && |
673 (GetRawValue() != pEventParam->m_wsResult)) { | 670 (GetRawValue() != pEventParam->m_wsResult)) { |
674 SetValue(pEventParam->m_wsResult, XFA_VALUEPICTURE_Raw); | 671 SetValue(pEventParam->m_wsResult, XFA_VALUEPICTURE_Raw); |
675 m_pDocView->AddValidateWidget(this); | 672 m_pDocView->AddValidateWidget(this); |
676 } | 673 } |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 if (pIDNode) { | 1687 if (pIDNode) { |
1691 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); | 1688 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); |
1692 } | 1689 } |
1693 if (pEmbAcc) { | 1690 if (pEmbAcc) { |
1694 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 1691 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
1695 return TRUE; | 1692 return TRUE; |
1696 } | 1693 } |
1697 } | 1694 } |
1698 return FALSE; | 1695 return FALSE; |
1699 } | 1696 } |
OLD | NEW |