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/parser/xfa_object.h" | 7 #include "xfa/fxfa/parser/xfa_object.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fde/xml/fde_xml_imp.h" | 10 #include "xfa/fde/xml/fde_xml_imp.h" |
11 #include "xfa/fgas/crt/fgas_codepage.h" | 11 #include "xfa/fgas/crt/fgas_codepage.h" |
12 #include "xfa/fgas/crt/fgas_system.h" | 12 #include "xfa/fgas/crt/fgas_system.h" |
| 13 #include "xfa/fxfa/app/xfa_ffnotify.h" |
13 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 14 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
14 #include "xfa/fxfa/parser/xfa_basic_imp.h" | 15 #include "xfa/fxfa/parser/xfa_basic_imp.h" |
15 #include "xfa/fxfa/parser/xfa_docdata.h" | 16 #include "xfa/fxfa/parser/xfa_docdata.h" |
16 #include "xfa/fxfa/parser/xfa_doclayout.h" | 17 #include "xfa/fxfa/parser/xfa_doclayout.h" |
17 #include "xfa/fxfa/parser/xfa_document.h" | 18 #include "xfa/fxfa/parser/xfa_document.h" |
18 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" | 19 #include "xfa/fxfa/parser/xfa_document_layout_imp.h" |
19 #include "xfa/fxfa/parser/xfa_localemgr.h" | 20 #include "xfa/fxfa/parser/xfa_localemgr.h" |
20 #include "xfa/fxfa/parser/xfa_parser.h" | 21 #include "xfa/fxfa/parser/xfa_parser.h" |
| 22 #include "xfa/fxfa/parser/xfa_parser_imp.h" |
21 #include "xfa/fxfa/parser/xfa_script.h" | 23 #include "xfa/fxfa/parser/xfa_script.h" |
| 24 #include "xfa/fxfa/parser/xfa_script_imp.h" |
22 #include "xfa/fxfa/parser/xfa_utils.h" | 25 #include "xfa/fxfa/parser/xfa_utils.h" |
23 #include "xfa/fxjse/cfxjse_arguments.h" | 26 #include "xfa/fxjse/cfxjse_arguments.h" |
24 | 27 |
25 CXFA_Object::CXFA_Object(CXFA_Document* pDocument, uint32_t uFlags) | 28 CXFA_Object::CXFA_Object(CXFA_Document* pDocument, uint32_t uFlags) |
26 : m_pDocument(pDocument), m_uFlags(uFlags) {} | 29 : m_pDocument(pDocument), m_uFlags(uFlags) {} |
27 void CXFA_Object::GetClassName(CFX_WideStringC& wsName) const { | 30 void CXFA_Object::GetClassName(CFX_WideStringC& wsName) const { |
28 wsName = XFA_GetElementByID(GetClassID())->pName; | 31 wsName = XFA_GetElementByID(GetClassID())->pName; |
29 } | 32 } |
30 uint32_t CXFA_Object::GetClassHashCode() const { | 33 uint32_t CXFA_Object::GetClassHashCode() const { |
31 return XFA_GetElementByID(GetClassID())->uHash; | 34 return XFA_GetElementByID(GetClassID())->uHash; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 pNext = pNode->m_pNext; | 113 pNext = pNode->m_pNext; |
111 pNode->m_pParent = NULL; | 114 pNode->m_pParent = NULL; |
112 delete pNode; | 115 delete pNode; |
113 pNode = pNext; | 116 pNode = pNext; |
114 } | 117 } |
115 if (m_pXMLNode && HasFlag(XFA_NODEFLAG_OwnXMLNode)) { | 118 if (m_pXMLNode && HasFlag(XFA_NODEFLAG_OwnXMLNode)) { |
116 m_pXMLNode->Release(); | 119 m_pXMLNode->Release(); |
117 } | 120 } |
118 } | 121 } |
119 CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { | 122 CXFA_Node* CXFA_Node::Clone(FX_BOOL bRecursive) { |
120 IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); | 123 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); |
121 CXFA_Node* pClone = pFactory->CreateNode(m_ePacket, m_eNodeClass); | 124 CXFA_Node* pClone = pFactory->CreateNode(m_ePacket, m_eNodeClass); |
122 if (!pClone) { | 125 if (!pClone) { |
123 return NULL; | 126 return NULL; |
124 } | 127 } |
125 MergeAllData(pClone); | 128 MergeAllData(pClone); |
126 pClone->UpdateNameHash(); | 129 pClone->UpdateNameHash(); |
127 if (IsNeedSavingXMLNode()) { | 130 if (IsNeedSavingXMLNode()) { |
128 CFDE_XMLNode* pCloneXML = NULL; | 131 CFDE_XMLNode* pCloneXML = NULL; |
129 if (IsAttributeInXML()) { | 132 if (IsAttributeInXML()) { |
130 CFX_WideString wsName; | 133 CFX_WideString wsName; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 282 } |
280 if (bFilterOneOfProperties && nodes.GetSize() < 1) { | 283 if (bFilterOneOfProperties && nodes.GetSize() < 1) { |
281 int32_t iProperties = 0; | 284 int32_t iProperties = 0; |
282 const XFA_PROPERTY* pProperty = | 285 const XFA_PROPERTY* pProperty = |
283 XFA_GetElementProperties(GetClassID(), iProperties); | 286 XFA_GetElementProperties(GetClassID(), iProperties); |
284 if (pProperty == NULL || iProperties < 1) { | 287 if (pProperty == NULL || iProperties < 1) { |
285 return 0; | 288 return 0; |
286 } | 289 } |
287 for (int32_t i = 0; i < iProperties; i++) { | 290 for (int32_t i = 0; i < iProperties; i++) { |
288 if (pProperty[i].uFlags & XFA_PROPERTYFLAG_DefaultOneOf) { | 291 if (pProperty[i].uFlags & XFA_PROPERTYFLAG_DefaultOneOf) { |
289 IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); | 292 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); |
290 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(GetPacketID()); | 293 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(GetPacketID()); |
291 CXFA_Node* pNewNode = | 294 CXFA_Node* pNewNode = |
292 pFactory->CreateNode(pPacket, (XFA_ELEMENT)pProperty[i].eName); | 295 pFactory->CreateNode(pPacket, (XFA_ELEMENT)pProperty[i].eName); |
293 if (!pNewNode) { | 296 if (!pNewNode) { |
294 break; | 297 break; |
295 } | 298 } |
296 InsertChild(pNewNode, NULL); | 299 InsertChild(pNewNode, NULL); |
297 pNewNode->SetFlag(XFA_NODEFLAG_Initialized); | 300 pNewNode->SetFlag(XFA_NODEFLAG_Initialized); |
298 nodes.Add(pNewNode); | 301 nodes.Add(pNewNode); |
299 break; | 302 break; |
300 } | 303 } |
301 } | 304 } |
302 } | 305 } |
303 } | 306 } |
304 return nodes.GetSize(); | 307 return nodes.GetSize(); |
305 } | 308 } |
306 CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_ELEMENT eElement, | 309 CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_ELEMENT eElement, |
307 uint32_t dwFlags) { | 310 uint32_t dwFlags) { |
308 IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); | 311 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); |
309 CXFA_Node* pNode = pFactory->CreateNode(m_ePacket, eElement); | 312 CXFA_Node* pNode = pFactory->CreateNode(m_ePacket, eElement); |
310 pNode->SetFlag(dwFlags); | 313 pNode->SetFlag(dwFlags); |
311 return pNode; | 314 return pNode; |
312 } | 315 } |
313 CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) { | 316 CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) { |
314 FXSYS_assert(m_ePacket == XFA_XDPPACKET_Template); | 317 FXSYS_assert(m_ePacket == XFA_XDPPACKET_Template); |
315 IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); | 318 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); |
316 CXFA_Node* pClone = pFactory->CreateNode(XFA_XDPPACKET_Form, m_eNodeClass); | 319 CXFA_Node* pClone = pFactory->CreateNode(XFA_XDPPACKET_Form, m_eNodeClass); |
317 if (!pClone) { | 320 if (!pClone) { |
318 return NULL; | 321 return NULL; |
319 } | 322 } |
320 pClone->SetTemplateNode(this); | 323 pClone->SetTemplateNode(this); |
321 pClone->UpdateNameHash(); | 324 pClone->UpdateNameHash(); |
322 pClone->SetXMLMappingNode(GetXMLMappingNode()); | 325 pClone->SetXMLMappingNode(GetXMLMappingNode()); |
323 if (bRecursive) { | 326 if (bRecursive) { |
324 for (CXFA_Node* pChild = GetNodeItem(XFA_NODEITEM_FirstChild); pChild; | 327 for (CXFA_Node* pChild = GetNodeItem(XFA_NODEITEM_FirstChild); pChild; |
325 pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 328 pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { | 627 void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { |
625 int32_t iLength = pArguments->GetLength(); | 628 int32_t iLength = pArguments->GetLength(); |
626 if (iLength != 1) { | 629 if (iLength != 1) { |
627 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNode"); | 630 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resolveNode"); |
628 return; | 631 return; |
629 } | 632 } |
630 CFX_WideString wsExpression; | 633 CFX_WideString wsExpression; |
631 CFX_ByteString bsExpression = pArguments->GetUTF8String(0); | 634 CFX_ByteString bsExpression = pArguments->GetUTF8String(0); |
632 wsExpression = | 635 wsExpression = |
633 CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); | 636 CFX_WideString::FromUTF8(bsExpression, bsExpression.GetLength()); |
634 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 637 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
635 if (!pScriptContext) { | 638 if (!pScriptContext) { |
636 return; | 639 return; |
637 } | 640 } |
638 CXFA_Node* refNode = this; | 641 CXFA_Node* refNode = this; |
639 if (refNode->GetClassID() == XFA_ELEMENT_Xfa) { | 642 if (refNode->GetClassID() == XFA_ELEMENT_Xfa) { |
640 refNode = ToNode(pScriptContext->GetThisObject()); | 643 refNode = ToNode(pScriptContext->GetThisObject()); |
641 } | 644 } |
642 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | | 645 uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes | |
643 XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | | 646 XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | |
644 XFA_RESOLVENODE_Siblings; | 647 XFA_RESOLVENODE_Siblings; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 CXFA_Node* refNode = this; | 691 CXFA_Node* refNode = this; |
689 if (refNode->GetClassID() == XFA_ELEMENT_Xfa) { | 692 if (refNode->GetClassID() == XFA_ELEMENT_Xfa) { |
690 refNode = ToNode(m_pDocument->GetScriptContext()->GetThisObject()); | 693 refNode = ToNode(m_pDocument->GetScriptContext()->GetThisObject()); |
691 } | 694 } |
692 Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag, refNode); | 695 Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag, refNode); |
693 } | 696 } |
694 void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, | 697 void CXFA_Node::Script_Som_ResolveNodeList(FXJSE_HVALUE hValue, |
695 CFX_WideString wsExpression, | 698 CFX_WideString wsExpression, |
696 uint32_t dwFlag, | 699 uint32_t dwFlag, |
697 CXFA_Node* refNode) { | 700 CXFA_Node* refNode) { |
698 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 701 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
699 if (!pScriptContext) { | 702 if (!pScriptContext) { |
700 return; | 703 return; |
701 } | 704 } |
702 XFA_RESOLVENODE_RS resoveNodeRS; | 705 XFA_RESOLVENODE_RS resoveNodeRS; |
703 if (refNode == NULL) { | 706 if (refNode == NULL) { |
704 refNode = this; | 707 refNode = this; |
705 } | 708 } |
706 pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); | 709 pScriptContext->ResolveObjects(refNode, wsExpression, resoveNodeRS, dwFlag); |
707 CXFA_ArrayNodeList* pNodeList = new CXFA_ArrayNodeList(m_pDocument); | 710 CXFA_ArrayNodeList* pNodeList = new CXFA_ArrayNodeList(m_pDocument); |
708 if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { | 711 if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { |
(...skipping 24 matching lines...) Expand all Loading... |
733 uint32_t dwFlag = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_ALL; | 736 uint32_t dwFlag = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_ALL; |
734 CFX_WideString wsName; | 737 CFX_WideString wsName; |
735 GetAttribute(XFA_ATTRIBUTE_Name, wsName); | 738 GetAttribute(XFA_ATTRIBUTE_Name, wsName); |
736 CFX_WideString wsExpression = wsName + FX_WSTRC(L"[*]"); | 739 CFX_WideString wsExpression = wsName + FX_WSTRC(L"[*]"); |
737 Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag); | 740 Script_Som_ResolveNodeList(hValue, wsExpression, dwFlag); |
738 } | 741 } |
739 } | 742 } |
740 void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue, | 743 void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue, |
741 FX_BOOL bSetting, | 744 FX_BOOL bSetting, |
742 XFA_ATTRIBUTE eAttribute) { | 745 XFA_ATTRIBUTE eAttribute) { |
743 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 746 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
744 if (!pScriptContext) { | 747 if (!pScriptContext) { |
745 return; | 748 return; |
746 } | 749 } |
747 if (bSetting) { | 750 if (bSetting) { |
748 IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); | 751 IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); |
749 FXSYS_assert(pAppProvider); | 752 FXSYS_assert(pAppProvider); |
750 CFX_WideString wsMessage; | 753 CFX_WideString wsMessage; |
751 pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage); | 754 pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage); |
752 FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); | 755 FXJSE_ThrowMessage("", FX_UTF8Encode(wsMessage, wsMessage.GetLength())); |
753 } else { | 756 } else { |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 } | 1305 } |
1303 } | 1306 } |
1304 void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( | 1307 void CXFA_Node::Script_Attribute_SendAttributeChangeMessage( |
1305 void* eAttribute, | 1308 void* eAttribute, |
1306 void* eValue, | 1309 void* eValue, |
1307 FX_BOOL bScriptModify) { | 1310 FX_BOOL bScriptModify) { |
1308 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); | 1311 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); |
1309 if (!pLayoutPro) { | 1312 if (!pLayoutPro) { |
1310 return; | 1313 return; |
1311 } | 1314 } |
1312 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 1315 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
1313 if (!pNotify) { | 1316 if (!pNotify) { |
1314 return; | 1317 return; |
1315 } | 1318 } |
1316 uint32_t dwPacket = GetPacketID(); | 1319 uint32_t dwPacket = GetPacketID(); |
1317 if (dwPacket & XFA_XDPPACKET_Form) { | 1320 if (dwPacket & XFA_XDPPACKET_Form) { |
1318 FX_BOOL bNeedFindContainer = FALSE; | 1321 FX_BOOL bNeedFindContainer = FALSE; |
1319 XFA_ELEMENT eType = GetClassID(); | 1322 XFA_ELEMENT eType = GetClassID(); |
1320 switch (eType) { | 1323 switch (eType) { |
1321 case XFA_ELEMENT_Caption: | 1324 case XFA_ELEMENT_Caption: |
1322 bNeedFindContainer = TRUE; | 1325 bNeedFindContainer = TRUE; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength())); | 1600 CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength())); |
1598 break; | 1601 break; |
1599 case XFA_SOM_MandatoryMessage: | 1602 case XFA_SOM_MandatoryMessage: |
1600 validate.SetNullMessageText( | 1603 validate.SetNullMessageText( |
1601 CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength())); | 1604 CFX_WideString::FromUTF8(bsMessage, bsMessage.GetLength())); |
1602 break; | 1605 break; |
1603 default: | 1606 default: |
1604 break; | 1607 break; |
1605 } | 1608 } |
1606 if (!bNew) { | 1609 if (!bNew) { |
1607 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 1610 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
1608 if (!pNotify) { | 1611 if (!pNotify) { |
1609 return; | 1612 return; |
1610 } | 1613 } |
1611 pNotify->AddCalcValidate(this); | 1614 pNotify->AddCalcValidate(this); |
1612 } | 1615 } |
1613 } else { | 1616 } else { |
1614 CFX_WideString wsMessage; | 1617 CFX_WideString wsMessage; |
1615 switch (iMessageType) { | 1618 switch (iMessageType) { |
1616 case XFA_SOM_ValidationMessage: | 1619 case XFA_SOM_ValidationMessage: |
1617 validate.GetScriptMessageText(wsMessage); | 1620 validate.GetScriptMessageText(wsMessage); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2178 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), | 2181 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), |
2179 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); | 2182 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); |
2180 } | 2183 } |
2181 } else { | 2184 } else { |
2182 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); | 2185 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); |
2183 } | 2186 } |
2184 } | 2187 } |
2185 void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) { | 2188 void CXFA_Node::Script_Field_ExecInitialize(CFXJSE_Arguments* pArguments) { |
2186 int32_t argc = pArguments->GetLength(); | 2189 int32_t argc = pArguments->GetLength(); |
2187 if (argc == 0) { | 2190 if (argc == 0) { |
2188 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2191 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2189 if (!pNotify) { | 2192 if (!pNotify) { |
2190 return; | 2193 return; |
2191 } | 2194 } |
2192 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, FALSE, FALSE); | 2195 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize, FALSE, FALSE); |
2193 } else { | 2196 } else { |
2194 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2197 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2195 L"execInitialize"); | 2198 L"execInitialize"); |
2196 } | 2199 } |
2197 } | 2200 } |
2198 void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) { | 2201 void CXFA_Node::Script_Field_DeleteItem(CFXJSE_Arguments* pArguments) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 int32_t iIndex = pArguments->GetInt32(0); | 2274 int32_t iIndex = pArguments->GetInt32(0); |
2272 FX_BOOL bValue = pWidgetData->GetItemState(iIndex); | 2275 FX_BOOL bValue = pWidgetData->GetItemState(iIndex); |
2273 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 2276 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); |
2274 if (hValue) { | 2277 if (hValue) { |
2275 FXJSE_Value_SetBoolean(hValue, bValue); | 2278 FXJSE_Value_SetBoolean(hValue, bValue); |
2276 } | 2279 } |
2277 } | 2280 } |
2278 void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) { | 2281 void CXFA_Node::Script_Field_ExecCalculate(CFXJSE_Arguments* pArguments) { |
2279 int32_t argc = pArguments->GetLength(); | 2282 int32_t argc = pArguments->GetLength(); |
2280 if (argc == 0) { | 2283 if (argc == 0) { |
2281 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2284 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2282 if (!pNotify) { | 2285 if (!pNotify) { |
2283 return; | 2286 return; |
2284 } | 2287 } |
2285 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, FALSE, FALSE); | 2288 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate, FALSE, FALSE); |
2286 } else { | 2289 } else { |
2287 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2290 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2288 L"execCalculate"); | 2291 L"execCalculate"); |
2289 } | 2292 } |
2290 } | 2293 } |
2291 void CXFA_Node::Script_Field_SetItems(CFXJSE_Arguments* pArguments) {} | 2294 void CXFA_Node::Script_Field_SetItems(CFXJSE_Arguments* pArguments) {} |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 } | 2356 } |
2354 if (iLength >= 2) { | 2357 if (iLength >= 2) { |
2355 CFX_ByteString bsValue = pArguments->GetUTF8String(1); | 2358 CFX_ByteString bsValue = pArguments->GetUTF8String(1); |
2356 wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); | 2359 wsValue = CFX_WideString::FromUTF8(bsValue, bsValue.GetLength()); |
2357 } | 2360 } |
2358 pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE); | 2361 pWidgetData->InsertItem(wsLabel, wsValue, -1, TRUE); |
2359 } | 2362 } |
2360 void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { | 2363 void CXFA_Node::Script_Field_ExecValidate(CFXJSE_Arguments* pArguments) { |
2361 int32_t argc = pArguments->GetLength(); | 2364 int32_t argc = pArguments->GetLength(); |
2362 if (argc == 0) { | 2365 if (argc == 0) { |
2363 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2366 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2364 if (!pNotify) { | 2367 if (!pNotify) { |
2365 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); | 2368 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); |
2366 } else { | 2369 } else { |
2367 int32_t iRet = | 2370 int32_t iRet = |
2368 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE); | 2371 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate, FALSE, FALSE); |
2369 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), | 2372 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), |
2370 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); | 2373 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); |
2371 } | 2374 } |
2372 } else { | 2375 } else { |
2373 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2376 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 } | 2446 } |
2444 } | 2447 } |
2445 } else { | 2448 } else { |
2446 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2449 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2447 L"selectedMember"); | 2450 L"selectedMember"); |
2448 } | 2451 } |
2449 } | 2452 } |
2450 void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) { | 2453 void CXFA_Node::Script_ExclGroup_ExecInitialize(CFXJSE_Arguments* pArguments) { |
2451 int32_t argc = pArguments->GetLength(); | 2454 int32_t argc = pArguments->GetLength(); |
2452 if (argc == 0) { | 2455 if (argc == 0) { |
2453 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2456 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2454 if (!pNotify) { | 2457 if (!pNotify) { |
2455 return; | 2458 return; |
2456 } | 2459 } |
2457 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); | 2460 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); |
2458 } else { | 2461 } else { |
2459 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2462 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2460 L"execInitialize"); | 2463 L"execInitialize"); |
2461 } | 2464 } |
2462 } | 2465 } |
2463 void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) { | 2466 void CXFA_Node::Script_ExclGroup_ExecCalculate(CFXJSE_Arguments* pArguments) { |
2464 int32_t argc = pArguments->GetLength(); | 2467 int32_t argc = pArguments->GetLength(); |
2465 if (argc == 0) { | 2468 if (argc == 0) { |
2466 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2469 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2467 if (!pNotify) { | 2470 if (!pNotify) { |
2468 return; | 2471 return; |
2469 } | 2472 } |
2470 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); | 2473 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); |
2471 } else { | 2474 } else { |
2472 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2475 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2473 L"execCalculate"); | 2476 L"execCalculate"); |
2474 } | 2477 } |
2475 } | 2478 } |
2476 void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { | 2479 void CXFA_Node::Script_ExclGroup_ExecValidate(CFXJSE_Arguments* pArguments) { |
2477 int32_t argc = pArguments->GetLength(); | 2480 int32_t argc = pArguments->GetLength(); |
2478 if (argc == 0) { | 2481 if (argc == 0) { |
2479 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2482 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2480 if (!pNotify) { | 2483 if (!pNotify) { |
2481 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); | 2484 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); |
2482 } else { | 2485 } else { |
2483 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); | 2486 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); |
2484 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), | 2487 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), |
2485 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); | 2488 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); |
2486 } | 2489 } |
2487 } else { | 2490 } else { |
2488 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2491 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2489 L"execValidate"); | 2492 L"execValidate"); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 CXFA_Node* pManagerNode = NULL; | 2535 CXFA_Node* pManagerNode = NULL; |
2533 for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode; | 2536 for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_PrevSibling); pNode; |
2534 pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { | 2537 pNode = pNode->GetNodeItem(XFA_NODEITEM_PrevSibling)) { |
2535 if (pNode->GetClassID() == XFA_ELEMENT_InstanceManager) { | 2538 if (pNode->GetClassID() == XFA_ELEMENT_InstanceManager) { |
2536 pManagerNode = pNode; | 2539 pManagerNode = pNode; |
2537 break; | 2540 break; |
2538 } | 2541 } |
2539 } | 2542 } |
2540 if (pManagerNode) { | 2543 if (pManagerNode) { |
2541 pManagerNode->InstanceManager_MoveInstance(iTo, iFrom); | 2544 pManagerNode->InstanceManager_MoveInstance(iTo, iFrom); |
2542 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2545 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2543 if (!pNotify) { | 2546 if (!pNotify) { |
2544 return; | 2547 return; |
2545 } | 2548 } |
2546 CXFA_Node* pToInstance = | 2549 CXFA_Node* pToInstance = |
2547 XFA_ScriptInstanceManager_GetItem(pManagerNode, iTo); | 2550 XFA_ScriptInstanceManager_GetItem(pManagerNode, iTo); |
2548 if (pToInstance && pToInstance->GetClassID() == XFA_ELEMENT_Subform) { | 2551 if (pToInstance && pToInstance->GetClassID() == XFA_ELEMENT_Subform) { |
2549 pNotify->RunSubformIndexChange(pToInstance); | 2552 pNotify->RunSubformIndexChange(pToInstance); |
2550 } | 2553 } |
2551 CXFA_Node* pFromInstance = | 2554 CXFA_Node* pFromInstance = |
2552 XFA_ScriptInstanceManager_GetItem(pManagerNode, iFrom); | 2555 XFA_ScriptInstanceManager_GetItem(pManagerNode, iFrom); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2609 execSingleEventByName( | 2612 execSingleEventByName( |
2610 CFX_WideString::FromUTF8(eventString, eventString.GetLength()), | 2613 CFX_WideString::FromUTF8(eventString, eventString.GetLength()), |
2611 XFA_ELEMENT_Subform); | 2614 XFA_ELEMENT_Subform); |
2612 } else { | 2615 } else { |
2613 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); | 2616 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execEvent"); |
2614 } | 2617 } |
2615 } | 2618 } |
2616 void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) { | 2619 void CXFA_Node::Script_Subform_ExecInitialize(CFXJSE_Arguments* pArguments) { |
2617 int32_t argc = pArguments->GetLength(); | 2620 int32_t argc = pArguments->GetLength(); |
2618 if (argc == 0) { | 2621 if (argc == 0) { |
2619 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2622 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2620 if (!pNotify) { | 2623 if (!pNotify) { |
2621 return; | 2624 return; |
2622 } | 2625 } |
2623 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); | 2626 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); |
2624 } else { | 2627 } else { |
2625 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2628 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2626 L"execInitialize"); | 2629 L"execInitialize"); |
2627 } | 2630 } |
2628 } | 2631 } |
2629 void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) { | 2632 void CXFA_Node::Script_Subform_ExecCalculate(CFXJSE_Arguments* pArguments) { |
2630 int32_t argc = pArguments->GetLength(); | 2633 int32_t argc = pArguments->GetLength(); |
2631 if (argc == 0) { | 2634 if (argc == 0) { |
2632 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2635 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2633 if (!pNotify) { | 2636 if (!pNotify) { |
2634 return; | 2637 return; |
2635 } | 2638 } |
2636 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); | 2639 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); |
2637 } else { | 2640 } else { |
2638 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2641 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2639 L"execCalculate"); | 2642 L"execCalculate"); |
2640 } | 2643 } |
2641 } | 2644 } |
2642 void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) { | 2645 void CXFA_Node::Script_Subform_ExecValidate(CFXJSE_Arguments* pArguments) { |
2643 int32_t argc = pArguments->GetLength(); | 2646 int32_t argc = pArguments->GetLength(); |
2644 if (argc == 0) { | 2647 if (argc == 0) { |
2645 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 2648 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
2646 if (!pNotify) { | 2649 if (!pNotify) { |
2647 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); | 2650 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); |
2648 } else { | 2651 } else { |
2649 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); | 2652 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); |
2650 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), | 2653 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), |
2651 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); | 2654 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); |
2652 } | 2655 } |
2653 } else { | 2656 } else { |
2654 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 2657 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
2655 L"execValidate"); | 2658 L"execValidate"); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3127 void CXFA_Node::Script_InstanceManager_MoveInstance( | 3130 void CXFA_Node::Script_InstanceManager_MoveInstance( |
3128 CFXJSE_Arguments* pArguments) { | 3131 CFXJSE_Arguments* pArguments) { |
3129 int32_t argc = pArguments->GetLength(); | 3132 int32_t argc = pArguments->GetLength(); |
3130 if (argc != 2) { | 3133 if (argc != 2) { |
3131 FXJSE_Value_SetUndefined(pArguments->GetReturnValue()); | 3134 FXJSE_Value_SetUndefined(pArguments->GetReturnValue()); |
3132 return; | 3135 return; |
3133 } | 3136 } |
3134 int32_t iFrom = pArguments->GetInt32(0); | 3137 int32_t iFrom = pArguments->GetInt32(0); |
3135 int32_t iTo = pArguments->GetInt32(1); | 3138 int32_t iTo = pArguments->GetInt32(1); |
3136 InstanceManager_MoveInstance(iTo, iFrom); | 3139 InstanceManager_MoveInstance(iTo, iFrom); |
3137 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3140 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3138 if (!pNotify) { | 3141 if (!pNotify) { |
3139 return; | 3142 return; |
3140 } | 3143 } |
3141 CXFA_Node* pToInstance = XFA_ScriptInstanceManager_GetItem(this, iTo); | 3144 CXFA_Node* pToInstance = XFA_ScriptInstanceManager_GetItem(this, iTo); |
3142 if (pToInstance && pToInstance->GetClassID() == XFA_ELEMENT_Subform) { | 3145 if (pToInstance && pToInstance->GetClassID() == XFA_ELEMENT_Subform) { |
3143 pNotify->RunSubformIndexChange(pToInstance); | 3146 pNotify->RunSubformIndexChange(pToInstance); |
3144 } | 3147 } |
3145 CXFA_Node* pFromInstance = XFA_ScriptInstanceManager_GetItem(this, iFrom); | 3148 CXFA_Node* pFromInstance = XFA_ScriptInstanceManager_GetItem(this, iFrom); |
3146 if (pFromInstance && pFromInstance->GetClassID() == XFA_ELEMENT_Subform) { | 3149 if (pFromInstance && pFromInstance->GetClassID() == XFA_ELEMENT_Subform) { |
3147 pNotify->RunSubformIndexChange(pFromInstance); | 3150 pNotify->RunSubformIndexChange(pFromInstance); |
(...skipping 13 matching lines...) Expand all Loading... |
3161 return; | 3164 return; |
3162 } | 3165 } |
3163 CXFA_Occur nodeOccur(GetOccurNode()); | 3166 CXFA_Occur nodeOccur(GetOccurNode()); |
3164 int32_t iMin = nodeOccur.GetMin(); | 3167 int32_t iMin = nodeOccur.GetMin(); |
3165 if (iCount - 1 < iMin) { | 3168 if (iCount - 1 < iMin) { |
3166 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min"); | 3169 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"min"); |
3167 return; | 3170 return; |
3168 } | 3171 } |
3169 CXFA_Node* pRemoveInstance = XFA_ScriptInstanceManager_GetItem(this, iIndex); | 3172 CXFA_Node* pRemoveInstance = XFA_ScriptInstanceManager_GetItem(this, iIndex); |
3170 XFA_ScriptInstanceManager_RemoveItem(this, pRemoveInstance); | 3173 XFA_ScriptInstanceManager_RemoveItem(this, pRemoveInstance); |
3171 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3174 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3172 if (pNotify) { | 3175 if (pNotify) { |
3173 for (int32_t i = iIndex; i < iCount - 1; i++) { | 3176 for (int32_t i = iIndex; i < iCount - 1; i++) { |
3174 CXFA_Node* pSubformInstance = XFA_ScriptInstanceManager_GetItem(this, i); | 3177 CXFA_Node* pSubformInstance = XFA_ScriptInstanceManager_GetItem(this, i); |
3175 if (pSubformInstance && | 3178 if (pSubformInstance && |
3176 pSubformInstance->GetClassID() == XFA_ELEMENT_Subform) { | 3179 pSubformInstance->GetClassID() == XFA_ELEMENT_Subform) { |
3177 pNotify->RunSubformIndexChange(pSubformInstance); | 3180 pNotify->RunSubformIndexChange(pSubformInstance); |
3178 } | 3181 } |
3179 } | 3182 } |
3180 } | 3183 } |
3181 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); | 3184 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3213 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); | 3216 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); |
3214 return; | 3217 return; |
3215 } | 3218 } |
3216 CXFA_Node* pNewInstance = | 3219 CXFA_Node* pNewInstance = |
3217 XFA_ScriptInstanceManager_CreateInstance(this, fFlags); | 3220 XFA_ScriptInstanceManager_CreateInstance(this, fFlags); |
3218 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iCount, iCount, | 3221 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iCount, iCount, |
3219 FALSE); | 3222 FALSE); |
3220 FXJSE_Value_Set( | 3223 FXJSE_Value_Set( |
3221 pArguments->GetReturnValue(), | 3224 pArguments->GetReturnValue(), |
3222 m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); | 3225 m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); |
3223 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3226 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3224 if (!pNotify) { | 3227 if (!pNotify) { |
3225 return; | 3228 return; |
3226 } | 3229 } |
3227 pNotify->RunNodeInitialize(pNewInstance); | 3230 pNotify->RunNodeInitialize(pNewInstance); |
3228 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); | 3231 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); |
3229 if (!pLayoutPro) { | 3232 if (!pLayoutPro) { |
3230 return; | 3233 return; |
3231 } | 3234 } |
3232 pLayoutPro->AddChangedContainer( | 3235 pLayoutPro->AddChangedContainer( |
3233 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); | 3236 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); |
(...skipping 22 matching lines...) Expand all Loading... |
3256 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); | 3259 ThrowScriptErrorMessage(XFA_IDS_VIOLATE_BOUNDARY, L"max"); |
3257 return; | 3260 return; |
3258 } | 3261 } |
3259 CXFA_Node* pNewInstance = | 3262 CXFA_Node* pNewInstance = |
3260 XFA_ScriptInstanceManager_CreateInstance(this, bBind); | 3263 XFA_ScriptInstanceManager_CreateInstance(this, bBind); |
3261 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iIndex, iCount, | 3264 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iIndex, iCount, |
3262 TRUE); | 3265 TRUE); |
3263 FXJSE_Value_Set( | 3266 FXJSE_Value_Set( |
3264 pArguments->GetReturnValue(), | 3267 pArguments->GetReturnValue(), |
3265 m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); | 3268 m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewInstance)); |
3266 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3269 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3267 if (!pNotify) { | 3270 if (!pNotify) { |
3268 return; | 3271 return; |
3269 } | 3272 } |
3270 pNotify->RunNodeInitialize(pNewInstance); | 3273 pNotify->RunNodeInitialize(pNewInstance); |
3271 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); | 3274 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); |
3272 if (!pLayoutPro) { | 3275 if (!pLayoutPro) { |
3273 return; | 3276 return; |
3274 } | 3277 } |
3275 pLayoutPro->AddChangedContainer( | 3278 pLayoutPro->AddChangedContainer( |
3276 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); | 3279 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 iCount--; | 3322 iCount--; |
3320 } | 3323 } |
3321 } | 3324 } |
3322 } else if (iDesired > iCount) { | 3325 } else if (iDesired > iCount) { |
3323 while (iCount < iDesired) { | 3326 while (iCount < iDesired) { |
3324 CXFA_Node* pNewInstance = | 3327 CXFA_Node* pNewInstance = |
3325 XFA_ScriptInstanceManager_CreateInstance(this, TRUE); | 3328 XFA_ScriptInstanceManager_CreateInstance(this, TRUE); |
3326 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iCount, iCount, | 3329 XFA_ScriptInstanceManager_InsertItem(this, pNewInstance, iCount, iCount, |
3327 FALSE); | 3330 FALSE); |
3328 iCount++; | 3331 iCount++; |
3329 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3332 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3330 if (!pNotify) { | 3333 if (!pNotify) { |
3331 return 0; | 3334 return 0; |
3332 } | 3335 } |
3333 pNotify->RunNodeInitialize(pNewInstance); | 3336 pNotify->RunNodeInitialize(pNewInstance); |
3334 } | 3337 } |
3335 } | 3338 } |
3336 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); | 3339 CXFA_LayoutProcessor* pLayoutPro = m_pDocument->GetLayoutProcessor(); |
3337 if (pLayoutPro) { | 3340 if (pLayoutPro) { |
3338 pLayoutPro->AddChangedContainer( | 3341 pLayoutPro->AddChangedContainer( |
3339 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); | 3342 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form))); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3412 int32_t argc = pArguments->GetLength(); | 3415 int32_t argc = pArguments->GetLength(); |
3413 if (argc == 0) { | 3416 if (argc == 0) { |
3414 m_pDocument->DoDataRemerge(TRUE); | 3417 m_pDocument->DoDataRemerge(TRUE); |
3415 } else { | 3418 } else { |
3416 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge"); | 3419 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"remerge"); |
3417 } | 3420 } |
3418 } | 3421 } |
3419 void CXFA_Node::Script_Form_ExecInitialize(CFXJSE_Arguments* pArguments) { | 3422 void CXFA_Node::Script_Form_ExecInitialize(CFXJSE_Arguments* pArguments) { |
3420 int32_t argc = pArguments->GetLength(); | 3423 int32_t argc = pArguments->GetLength(); |
3421 if (argc == 0) { | 3424 if (argc == 0) { |
3422 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3425 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3423 if (!pNotify) { | 3426 if (!pNotify) { |
3424 return; | 3427 return; |
3425 } | 3428 } |
3426 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); | 3429 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Initialize); |
3427 } else { | 3430 } else { |
3428 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3431 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3429 L"execInitialize"); | 3432 L"execInitialize"); |
3430 } | 3433 } |
3431 } | 3434 } |
3432 void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) { | 3435 void CXFA_Node::Script_Form_Recalculate(CFXJSE_Arguments* pArguments) { |
3433 CXFA_EventParam* pEventParam = | 3436 CXFA_EventParam* pEventParam = |
3434 m_pDocument->GetScriptContext()->GetEventParam(); | 3437 m_pDocument->GetScriptContext()->GetEventParam(); |
3435 if (pEventParam->m_eType == XFA_EVENT_Calculate || | 3438 if (pEventParam->m_eType == XFA_EVENT_Calculate || |
3436 pEventParam->m_eType == XFA_EVENT_InitCalculate) { | 3439 pEventParam->m_eType == XFA_EVENT_InitCalculate) { |
3437 return; | 3440 return; |
3438 } | 3441 } |
3439 int32_t argc = pArguments->GetLength(); | 3442 int32_t argc = pArguments->GetLength(); |
3440 if (argc == 1) { | 3443 if (argc == 1) { |
3441 const bool bScriptFlags = pArguments->GetInt32(0) != 0; | 3444 const bool bScriptFlags = pArguments->GetInt32(0) != 0; |
3442 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3445 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3443 if (!pNotify) { | 3446 if (!pNotify) { |
3444 return; | 3447 return; |
3445 } | 3448 } |
3446 if (bScriptFlags) { | 3449 if (bScriptFlags) { |
3447 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); | 3450 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); |
3448 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); | 3451 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); |
3449 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, TRUE); | 3452 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Ready, TRUE); |
3450 } else { | 3453 } else { |
3451 } | 3454 } |
3452 } else { | 3455 } else { |
3453 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"recalculate"); | 3456 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"recalculate"); |
3454 } | 3457 } |
3455 } | 3458 } |
3456 void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) { | 3459 void CXFA_Node::Script_Form_ExecCalculate(CFXJSE_Arguments* pArguments) { |
3457 int32_t argc = pArguments->GetLength(); | 3460 int32_t argc = pArguments->GetLength(); |
3458 if (argc == 0) { | 3461 if (argc == 0) { |
3459 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3462 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3460 if (!pNotify) { | 3463 if (!pNotify) { |
3461 return; | 3464 return; |
3462 } | 3465 } |
3463 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); | 3466 pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Calculate); |
3464 } else { | 3467 } else { |
3465 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3468 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3466 L"execCalculate"); | 3469 L"execCalculate"); |
3467 } | 3470 } |
3468 } | 3471 } |
3469 void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { | 3472 void CXFA_Node::Script_Form_ExecValidate(CFXJSE_Arguments* pArguments) { |
3470 int32_t argc = pArguments->GetLength(); | 3473 int32_t argc = pArguments->GetLength(); |
3471 if (argc == 0) { | 3474 if (argc == 0) { |
3472 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 3475 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
3473 if (!pNotify) { | 3476 if (!pNotify) { |
3474 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); | 3477 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), FALSE); |
3475 } else { | 3478 } else { |
3476 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); | 3479 int32_t iRet = pNotify->ExecEventByDeepFirst(this, XFA_EVENT_Validate); |
3477 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), | 3480 FXJSE_Value_SetBoolean(pArguments->GetReturnValue(), |
3478 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); | 3481 ((iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE)); |
3479 } | 3482 } |
3480 } else { | 3483 } else { |
3481 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 3484 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
3482 L"execValidate"); | 3485 L"execValidate"); |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4422 case XFA_OBJECTTYPE_TextNode: | 4425 case XFA_OBJECTTYPE_TextNode: |
4423 pNode = this; | 4426 pNode = this; |
4424 default: | 4427 default: |
4425 if (GetClassID() == XFA_ELEMENT_DataValue) { | 4428 if (GetClassID() == XFA_ELEMENT_DataValue) { |
4426 pNode = this; | 4429 pNode = this; |
4427 } | 4430 } |
4428 break; | 4431 break; |
4429 } | 4432 } |
4430 if (pNode) { | 4433 if (pNode) { |
4431 if (bScriptModify) { | 4434 if (bScriptModify) { |
4432 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 4435 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
4433 if (pScriptContext) { | 4436 if (pScriptContext) { |
4434 m_pDocument->GetScriptContext()->AddNodesOfRunScript(this); | 4437 m_pDocument->GetScriptContext()->AddNodesOfRunScript(this); |
4435 } | 4438 } |
4436 } | 4439 } |
4437 return TryCData(XFA_ATTRIBUTE_Value, wsContent, FALSE, bProto); | 4440 return TryCData(XFA_ATTRIBUTE_Value, wsContent, FALSE, bProto); |
4438 } | 4441 } |
4439 return FALSE; | 4442 return FALSE; |
4440 } | 4443 } |
4441 CXFA_Node* CXFA_Node::GetModelNode() { | 4444 CXFA_Node* CXFA_Node::GetModelNode() { |
4442 switch (GetPacketID()) { | 4445 switch (GetPacketID()) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4519 if (pProperty->uFlags & XFA_PROPERTYFLAG_OneOf) { | 4522 if (pProperty->uFlags & XFA_PROPERTYFLAG_OneOf) { |
4520 pNode = m_pChild; | 4523 pNode = m_pChild; |
4521 for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 4524 for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
4522 const XFA_PROPERTY* pExistProperty = | 4525 const XFA_PROPERTY* pExistProperty = |
4523 XFA_GetPropertyOfElement(eElement, pNode->GetClassID(), dwPacket); | 4526 XFA_GetPropertyOfElement(eElement, pNode->GetClassID(), dwPacket); |
4524 if (pExistProperty && (pExistProperty->uFlags & XFA_PROPERTYFLAG_OneOf)) { | 4527 if (pExistProperty && (pExistProperty->uFlags & XFA_PROPERTYFLAG_OneOf)) { |
4525 return NULL; | 4528 return NULL; |
4526 } | 4529 } |
4527 } | 4530 } |
4528 } | 4531 } |
4529 IXFA_ObjFactory* pFactory = m_pDocument->GetParser()->GetFactory(); | 4532 CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); |
4530 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket); | 4533 const XFA_PACKETINFO* pPacket = XFA_GetPacketByID(dwPacket); |
4531 CXFA_Node* pNewNode; | 4534 CXFA_Node* pNewNode; |
4532 for (; iCount <= index; iCount++) { | 4535 for (; iCount <= index; iCount++) { |
4533 pNewNode = pFactory->CreateNode(pPacket, eProperty); | 4536 pNewNode = pFactory->CreateNode(pPacket, eProperty); |
4534 if (!pNewNode) { | 4537 if (!pNewNode) { |
4535 return NULL; | 4538 return NULL; |
4536 } | 4539 } |
4537 InsertChild(pNewNode, nullptr); | 4540 InsertChild(pNewNode, nullptr); |
4538 pNewNode->SetFlag(XFA_NODEFLAG_Initialized); | 4541 pNewNode->SetFlag(XFA_NODEFLAG_Initialized); |
4539 } | 4542 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4607 pNode->m_pNext = pPrev->m_pNext; | 4610 pNode->m_pNext = pPrev->m_pNext; |
4608 pPrev->m_pNext = pNode; | 4611 pPrev->m_pNext = pNode; |
4609 index = iCount; | 4612 index = iCount; |
4610 } | 4613 } |
4611 if (pNode->m_pNext == NULL) { | 4614 if (pNode->m_pNext == NULL) { |
4612 m_pLastChild = pNode; | 4615 m_pLastChild = pNode; |
4613 } | 4616 } |
4614 ASSERT(m_pLastChild); | 4617 ASSERT(m_pLastChild); |
4615 ASSERT(m_pLastChild->m_pNext == NULL); | 4618 ASSERT(m_pLastChild->m_pNext == NULL); |
4616 pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); | 4619 pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); |
4617 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4620 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4618 if (pNotify) { | 4621 if (pNotify) { |
4619 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); | 4622 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); |
4620 } | 4623 } |
4621 if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { | 4624 if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { |
4622 FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); | 4625 FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); |
4623 m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, index); | 4626 m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, index); |
4624 pNode->SetFlag(XFA_NODEFLAG_OwnXMLNode, FALSE, FALSE); | 4627 pNode->SetFlag(XFA_NODEFLAG_OwnXMLNode, FALSE, FALSE); |
4625 } | 4628 } |
4626 return index; | 4629 return index; |
4627 } | 4630 } |
(...skipping 25 matching lines...) Expand all Loading... |
4653 } | 4656 } |
4654 pNode->m_pNext = pPrev->m_pNext; | 4657 pNode->m_pNext = pPrev->m_pNext; |
4655 pPrev->m_pNext = pNode; | 4658 pPrev->m_pNext = pNode; |
4656 } | 4659 } |
4657 if (pNode->m_pNext == NULL) { | 4660 if (pNode->m_pNext == NULL) { |
4658 m_pLastChild = pNode; | 4661 m_pLastChild = pNode; |
4659 } | 4662 } |
4660 ASSERT(m_pLastChild); | 4663 ASSERT(m_pLastChild); |
4661 ASSERT(m_pLastChild->m_pNext == NULL); | 4664 ASSERT(m_pLastChild->m_pNext == NULL); |
4662 pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); | 4665 pNode->SetFlag(XFA_NODEFLAG_HasRemoved, FALSE); |
4663 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4666 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4664 if (pNotify) { | 4667 if (pNotify) { |
4665 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); | 4668 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ChildAdded, pNode); |
4666 } | 4669 } |
4667 if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { | 4670 if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { |
4668 FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); | 4671 FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); |
4669 m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, nIndex); | 4672 m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, nIndex); |
4670 pNode->SetFlag(XFA_NODEFLAG_OwnXMLNode, FALSE, FALSE); | 4673 pNode->SetFlag(XFA_NODEFLAG_OwnXMLNode, FALSE, FALSE); |
4671 } | 4674 } |
4672 return TRUE; | 4675 return TRUE; |
4673 } | 4676 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 CXFA_Node* CXFA_Node::GetNextSameClassSibling(XFA_ELEMENT eElement) const { | 4780 CXFA_Node* CXFA_Node::GetNextSameClassSibling(XFA_ELEMENT eElement) const { |
4778 for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_NextSibling); pNode; | 4781 for (CXFA_Node* pNode = GetNodeItem(XFA_NODEITEM_NextSibling); pNode; |
4779 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { | 4782 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { |
4780 if (pNode->GetClassID() == eElement) { | 4783 if (pNode->GetClassID() == eElement) { |
4781 return pNode; | 4784 return pNode; |
4782 } | 4785 } |
4783 } | 4786 } |
4784 return NULL; | 4787 return NULL; |
4785 } | 4788 } |
4786 int32_t CXFA_Node::GetNodeSameNameIndex() const { | 4789 int32_t CXFA_Node::GetNodeSameNameIndex() const { |
4787 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 4790 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
4788 if (!pScriptContext) { | 4791 if (!pScriptContext) { |
4789 return -1; | 4792 return -1; |
4790 } | 4793 } |
4791 return pScriptContext->GetIndexByName(const_cast<CXFA_Node*>(this)); | 4794 return pScriptContext->GetIndexByName(const_cast<CXFA_Node*>(this)); |
4792 } | 4795 } |
4793 int32_t CXFA_Node::GetNodeSameClassIndex() const { | 4796 int32_t CXFA_Node::GetNodeSameClassIndex() const { |
4794 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 4797 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
4795 if (!pScriptContext) { | 4798 if (!pScriptContext) { |
4796 return -1; | 4799 return -1; |
4797 } | 4800 } |
4798 return pScriptContext->GetIndexByClassName(const_cast<CXFA_Node*>(this)); | 4801 return pScriptContext->GetIndexByClassName(const_cast<CXFA_Node*>(this)); |
4799 } | 4802 } |
4800 void CXFA_Node::GetSOMExpression(CFX_WideString& wsSOMExpression) { | 4803 void CXFA_Node::GetSOMExpression(CFX_WideString& wsSOMExpression) { |
4801 IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); | 4804 CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); |
4802 if (!pScriptContext) { | 4805 if (!pScriptContext) { |
4803 return; | 4806 return; |
4804 } | 4807 } |
4805 pScriptContext->GetSomExpression(this, wsSOMExpression); | 4808 pScriptContext->GetSomExpression(this, wsSOMExpression); |
4806 } | 4809 } |
4807 CXFA_Node* CXFA_Node::GetInstanceMgrOfSubform() { | 4810 CXFA_Node* CXFA_Node::GetInstanceMgrOfSubform() { |
4808 CXFA_Node* pInstanceMgr = NULL; | 4811 CXFA_Node* pInstanceMgr = NULL; |
4809 if (m_ePacket == XFA_XDPPACKET_Form) { | 4812 if (m_ePacket == XFA_XDPPACKET_Form) { |
4810 CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); | 4813 CXFA_Node* pParentNode = GetNodeItem(XFA_NODEITEM_Parent); |
4811 if (!pParentNode || pParentNode->GetClassID() == XFA_ELEMENT_Area) { | 4814 if (!pParentNode || pParentNode->GetClassID() == XFA_ELEMENT_Area) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4844 default: | 4847 default: |
4845 break; | 4848 break; |
4846 } | 4849 } |
4847 return FALSE; | 4850 return FALSE; |
4848 } | 4851 } |
4849 void CXFA_Node::SetFlag(uint32_t dwFlag, FX_BOOL bOn, FX_BOOL bNotify) { | 4852 void CXFA_Node::SetFlag(uint32_t dwFlag, FX_BOOL bOn, FX_BOOL bNotify) { |
4850 if (bOn) { | 4853 if (bOn) { |
4851 switch (dwFlag) { | 4854 switch (dwFlag) { |
4852 case XFA_NODEFLAG_Initialized: | 4855 case XFA_NODEFLAG_Initialized: |
4853 if (bNotify && !HasFlag(XFA_NODEFLAG_Initialized)) { | 4856 if (bNotify && !HasFlag(XFA_NODEFLAG_Initialized)) { |
4854 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4857 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4855 if (pNotify) { | 4858 if (pNotify) { |
4856 pNotify->OnNodeEvent(this, XFA_NODEEVENT_Ready); | 4859 pNotify->OnNodeEvent(this, XFA_NODEEVENT_Ready); |
4857 } | 4860 } |
4858 } | 4861 } |
4859 break; | 4862 break; |
4860 default: | 4863 default: |
4861 break; | 4864 break; |
4862 } | 4865 } |
4863 m_uFlags |= dwFlag; | 4866 m_uFlags |= dwFlag; |
4864 } else { | 4867 } else { |
4865 m_uFlags &= ~dwFlag; | 4868 m_uFlags &= ~dwFlag; |
4866 } | 4869 } |
4867 } | 4870 } |
4868 FX_BOOL CXFA_Node::IsAttributeInXML() { | 4871 FX_BOOL CXFA_Node::IsAttributeInXML() { |
4869 return GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData; | 4872 return GetEnum(XFA_ATTRIBUTE_Contains) == XFA_ATTRIBUTEENUM_MetaData; |
4870 } | 4873 } |
4871 void CXFA_Node::OnRemoved(CXFA_Node* pParent, | 4874 void CXFA_Node::OnRemoved(CXFA_Node* pParent, |
4872 CXFA_Node* pRemoved, | 4875 CXFA_Node* pRemoved, |
4873 FX_BOOL bNotify) { | 4876 FX_BOOL bNotify) { |
4874 if (bNotify && pParent) { | 4877 if (bNotify && pParent) { |
4875 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4878 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4876 if (pNotify) { | 4879 if (pNotify) { |
4877 pNotify->OnNodeEvent(pParent, XFA_NODEEVENT_ChildRemoved, pRemoved); | 4880 pNotify->OnNodeEvent(pParent, XFA_NODEEVENT_ChildRemoved, pRemoved); |
4878 } | 4881 } |
4879 } | 4882 } |
4880 } | 4883 } |
4881 void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, | 4884 void CXFA_Node::OnChanging(XFA_ATTRIBUTE eAttr, |
4882 void* pNewValue, | 4885 void* pNewValue, |
4883 FX_BOOL bNotify) { | 4886 FX_BOOL bNotify) { |
4884 if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { | 4887 if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { |
4885 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4888 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4886 if (pNotify) { | 4889 if (pNotify) { |
4887 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, | 4890 pNotify->OnNodeEvent(this, XFA_NODEEVENT_ValueChanging, |
4888 (void*)(uintptr_t)eAttr, pNewValue); | 4891 (void*)(uintptr_t)eAttr, pNewValue); |
4889 } | 4892 } |
4890 } | 4893 } |
4891 } | 4894 } |
4892 void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr, | 4895 void CXFA_Node::OnChanged(XFA_ATTRIBUTE eAttr, |
4893 void* pNewValue, | 4896 void* pNewValue, |
4894 FX_BOOL bNotify, | 4897 FX_BOOL bNotify, |
4895 FX_BOOL bScriptModify) { | 4898 FX_BOOL bScriptModify) { |
4896 if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { | 4899 if (bNotify && HasFlag(XFA_NODEFLAG_Initialized)) { |
4897 Script_Attribute_SendAttributeChangeMessage((void*)(uintptr_t)eAttr, | 4900 Script_Attribute_SendAttributeChangeMessage((void*)(uintptr_t)eAttr, |
4898 pNewValue, bScriptModify); | 4901 pNewValue, bScriptModify); |
4899 } | 4902 } |
4900 } | 4903 } |
4901 int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, | 4904 int32_t CXFA_Node::execSingleEventByName(const CFX_WideStringC& wsEventName, |
4902 XFA_ELEMENT eElementType) { | 4905 XFA_ELEMENT eElementType) { |
4903 int32_t iRet = XFA_EVENTERROR_NotExist; | 4906 int32_t iRet = XFA_EVENTERROR_NotExist; |
4904 const XFA_ExecEventParaInfo* eventParaInfo = | 4907 const XFA_ExecEventParaInfo* eventParaInfo = |
4905 GetEventParaInfoByName(wsEventName); | 4908 GetEventParaInfoByName(wsEventName); |
4906 if (eventParaInfo) { | 4909 if (eventParaInfo) { |
4907 uint32_t validFlags = eventParaInfo->m_validFlags; | 4910 uint32_t validFlags = eventParaInfo->m_validFlags; |
4908 IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); | 4911 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
4909 if (!pNotify) { | 4912 if (!pNotify) { |
4910 return iRet; | 4913 return iRet; |
4911 } | 4914 } |
4912 if (validFlags == 1) { | 4915 if (validFlags == 1) { |
4913 iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType); | 4916 iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType); |
4914 } else if (validFlags == 2) { | 4917 } else if (validFlags == 2) { |
4915 iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, | 4918 iRet = pNotify->ExecEventByDeepFirst(this, eventParaInfo->m_eventType, |
4916 FALSE, FALSE); | 4919 FALSE, FALSE); |
4917 } else if (validFlags == 3) { | 4920 } else if (validFlags == 3) { |
4918 if (eElementType == XFA_ELEMENT_Subform) { | 4921 if (eElementType == XFA_ELEMENT_Subform) { |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5405 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); | 5408 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); |
5406 } | 5409 } |
5407 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { | 5410 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { |
5408 return m_pAttachNode->RemoveChild(pNode); | 5411 return m_pAttachNode->RemoveChild(pNode); |
5409 } | 5412 } |
5410 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { | 5413 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { |
5411 return m_pAttachNode->GetChild( | 5414 return m_pAttachNode->GetChild( |
5412 iIndex, XFA_ELEMENT_UNKNOWN, | 5415 iIndex, XFA_ELEMENT_UNKNOWN, |
5413 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); | 5416 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); |
5414 } | 5417 } |
OLD | NEW |