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 <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 if (pParent) { | 1423 if (pParent) { |
1424 pLayoutPro->AddChangedContainer(pParent); | 1424 pLayoutPro->AddChangedContainer(pParent); |
1425 } | 1425 } |
1426 } | 1426 } |
1427 } | 1427 } |
1428 | 1428 |
1429 void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue, | 1429 void CXFA_Node::Script_Attribute_String(CFXJSE_Value* pValue, |
1430 FX_BOOL bSetting, | 1430 FX_BOOL bSetting, |
1431 XFA_ATTRIBUTE eAttribute) { | 1431 XFA_ATTRIBUTE eAttribute) { |
1432 if (bSetting) { | 1432 if (bSetting) { |
1433 CFX_ByteString szValue; | 1433 CFX_WideString wsValue = pValue->ToWideString(); |
1434 pValue->ToString(szValue); | |
1435 CFX_WideString wsValue = CFX_WideString::FromUTF8(szValue.AsStringC()); | |
1436 SetAttribute(eAttribute, wsValue.AsStringC(), true); | 1434 SetAttribute(eAttribute, wsValue.AsStringC(), true); |
1437 if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) { | 1435 if (eAttribute == XFA_ATTRIBUTE_Use && GetClassID() == XFA_ELEMENT_Desc) { |
1438 CFX_WideString wsUseVal = wsValue, wsID, wsSOM; | |
1439 CXFA_Node* pTemplateNode = | 1436 CXFA_Node* pTemplateNode = |
1440 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Template)); | 1437 ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Template)); |
1441 CXFA_Node* pProtoRoot = | 1438 CXFA_Node* pProtoRoot = |
1442 pTemplateNode->GetFirstChildByClass(XFA_ELEMENT_Subform) | 1439 pTemplateNode->GetFirstChildByClass(XFA_ELEMENT_Subform) |
1443 ->GetFirstChildByClass(XFA_ELEMENT_Proto); | 1440 ->GetFirstChildByClass(XFA_ELEMENT_Proto); |
1444 if (!wsUseVal.IsEmpty()) { | 1441 |
1445 if (wsUseVal[0] == '#') { | 1442 CFX_WideString wsID; |
1446 wsID = CFX_WideString(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1); | 1443 CFX_WideString wsSOM; |
| 1444 if (!wsValue.IsEmpty()) { |
| 1445 if (wsValue[0] == '#') { |
| 1446 wsID = CFX_WideString(wsValue.c_str() + 1, wsValue.GetLength() - 1); |
1447 } else { | 1447 } else { |
1448 wsSOM = wsUseVal; | 1448 wsSOM = wsValue; |
1449 } | 1449 } |
1450 } | 1450 } |
1451 CXFA_Node* pProtoNode = nullptr; | 1451 CXFA_Node* pProtoNode = nullptr; |
1452 if (!wsSOM.IsEmpty()) { | 1452 if (!wsSOM.IsEmpty()) { |
1453 uint32_t dwFlag = XFA_RESOLVENODE_Children | | 1453 uint32_t dwFlag = XFA_RESOLVENODE_Children | |
1454 XFA_RESOLVENODE_Attributes | | 1454 XFA_RESOLVENODE_Attributes | |
1455 XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | | 1455 XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent | |
1456 XFA_RESOLVENODE_Siblings; | 1456 XFA_RESOLVENODE_Siblings; |
1457 XFA_RESOLVENODE_RS resoveNodeRS; | 1457 XFA_RESOLVENODE_RS resoveNodeRS; |
1458 int32_t iRet = m_pDocument->GetScriptContext()->ResolveObjects( | 1458 int32_t iRet = m_pDocument->GetScriptContext()->ResolveObjects( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 if (!pWidgetData) { | 1534 if (!pWidgetData) { |
1535 return; | 1535 return; |
1536 } | 1536 } |
1537 FX_BOOL bNew = FALSE; | 1537 FX_BOOL bNew = FALSE; |
1538 CXFA_Validate validate = pWidgetData->GetValidate(); | 1538 CXFA_Validate validate = pWidgetData->GetValidate(); |
1539 if (!validate) { | 1539 if (!validate) { |
1540 validate = pWidgetData->GetValidate(TRUE); | 1540 validate = pWidgetData->GetValidate(TRUE); |
1541 bNew = TRUE; | 1541 bNew = TRUE; |
1542 } | 1542 } |
1543 if (bSetting) { | 1543 if (bSetting) { |
1544 CFX_ByteString bsMessage; | |
1545 pValue->ToString(bsMessage); | |
1546 switch (iMessageType) { | 1544 switch (iMessageType) { |
1547 case XFA_SOM_ValidationMessage: | 1545 case XFA_SOM_ValidationMessage: |
1548 validate.SetScriptMessageText( | 1546 validate.SetScriptMessageText(pValue->ToWideString()); |
1549 CFX_WideString::FromUTF8(bsMessage.AsStringC())); | |
1550 break; | 1547 break; |
1551 case XFA_SOM_FormatMessage: | 1548 case XFA_SOM_FormatMessage: |
1552 validate.SetFormatMessageText( | 1549 validate.SetFormatMessageText(pValue->ToWideString()); |
1553 CFX_WideString::FromUTF8(bsMessage.AsStringC())); | |
1554 break; | 1550 break; |
1555 case XFA_SOM_MandatoryMessage: | 1551 case XFA_SOM_MandatoryMessage: |
1556 validate.SetNullMessageText( | 1552 validate.SetNullMessageText(pValue->ToWideString()); |
1557 CFX_WideString::FromUTF8(bsMessage.AsStringC())); | |
1558 break; | 1553 break; |
1559 default: | 1554 default: |
1560 break; | 1555 break; |
1561 } | 1556 } |
1562 if (!bNew) { | 1557 if (!bNew) { |
1563 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 1558 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
1564 if (!pNotify) { | 1559 if (!pNotify) { |
1565 return; | 1560 return; |
1566 } | 1561 } |
1567 pNotify->AddCalcValidate(this); | 1562 pNotify->AddCalcValidate(this); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 Script_Field_DefaultValue(pValue, bSetting, eAttribute); | 1606 Script_Field_DefaultValue(pValue, bSetting, eAttribute); |
1612 return; | 1607 return; |
1613 } else if (classID == XFA_ELEMENT_Draw) { | 1608 } else if (classID == XFA_ELEMENT_Draw) { |
1614 Script_Draw_DefaultValue(pValue, bSetting, eAttribute); | 1609 Script_Draw_DefaultValue(pValue, bSetting, eAttribute); |
1615 return; | 1610 return; |
1616 } else if (classID == XFA_ELEMENT_Boolean) { | 1611 } else if (classID == XFA_ELEMENT_Boolean) { |
1617 Script_Boolean_Value(pValue, bSetting, eAttribute); | 1612 Script_Boolean_Value(pValue, bSetting, eAttribute); |
1618 return; | 1613 return; |
1619 } | 1614 } |
1620 if (bSetting) { | 1615 if (bSetting) { |
1621 CFX_ByteString newValue; | 1616 CFX_WideString wsNewValue; |
1622 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) | 1617 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) |
1623 pValue->ToString(newValue); | 1618 wsNewValue = pValue->ToWideString(); |
1624 | 1619 |
1625 CFX_WideString wsNewValue = CFX_WideString::FromUTF8(newValue.AsStringC()); | |
1626 CFX_WideString wsFormatValue(wsNewValue); | 1620 CFX_WideString wsFormatValue(wsNewValue); |
1627 CXFA_WidgetData* pContainerWidgetData = nullptr; | 1621 CXFA_WidgetData* pContainerWidgetData = nullptr; |
1628 if (GetPacketID() == XFA_XDPPACKET_Datasets) { | 1622 if (GetPacketID() == XFA_XDPPACKET_Datasets) { |
1629 CXFA_NodeArray formNodes; | 1623 CXFA_NodeArray formNodes; |
1630 GetBindItems(formNodes); | 1624 GetBindItems(formNodes); |
1631 CFX_WideString wsPicture; | 1625 CFX_WideString wsPicture; |
1632 for (int32_t i = 0; i < formNodes.GetSize(); i++) { | 1626 for (int32_t i = 0; i < formNodes.GetSize(); i++) { |
1633 CXFA_Node* pFormNode = formNodes.GetAt(i); | 1627 CXFA_Node* pFormNode = formNodes.GetAt(i); |
1634 if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) { | 1628 if (!pFormNode || pFormNode->HasFlag(XFA_NODEFLAG_HasRemoved)) { |
1635 continue; | 1629 continue; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 pValue->SetString( | 1675 pValue->SetString( |
1682 FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC()); | 1676 FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC()); |
1683 } | 1677 } |
1684 } | 1678 } |
1685 void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue, | 1679 void CXFA_Node::Script_Boolean_Value(CFXJSE_Value* pValue, |
1686 FX_BOOL bSetting, | 1680 FX_BOOL bSetting, |
1687 XFA_ATTRIBUTE eAttribute) { | 1681 XFA_ATTRIBUTE eAttribute) { |
1688 if (bSetting) { | 1682 if (bSetting) { |
1689 CFX_ByteString newValue; | 1683 CFX_ByteString newValue; |
1690 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) | 1684 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) |
1691 pValue->ToString(newValue); | 1685 newValue = pValue->ToString(); |
1692 | 1686 |
1693 int32_t iValue = FXSYS_atoi(newValue.c_str()); | 1687 int32_t iValue = FXSYS_atoi(newValue.c_str()); |
1694 CFX_WideString wsNewValue(iValue == 0 ? L"0" : L"1"); | 1688 CFX_WideString wsNewValue(iValue == 0 ? L"0" : L"1"); |
1695 CFX_WideString wsFormatValue(wsNewValue); | 1689 CFX_WideString wsFormatValue(wsNewValue); |
1696 CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); | 1690 CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); |
1697 if (pContainerWidgetData) { | 1691 if (pContainerWidgetData) { |
1698 pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue); | 1692 pContainerWidgetData->GetFormatDataValue(wsNewValue, wsFormatValue); |
1699 } | 1693 } |
1700 SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); | 1694 SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); |
1701 } else { | 1695 } else { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 return eventParaInfo; | 1743 return eventParaInfo; |
1750 } | 1744 } |
1751 if (uHash < eventParaInfo->m_uHash) { | 1745 if (uHash < eventParaInfo->m_uHash) { |
1752 iEnd = iMid - 1; | 1746 iEnd = iMid - 1; |
1753 } else { | 1747 } else { |
1754 iStart = iMid + 1; | 1748 iStart = iMid + 1; |
1755 } | 1749 } |
1756 } while (iStart <= iEnd); | 1750 } while (iStart <= iEnd); |
1757 return nullptr; | 1751 return nullptr; |
1758 } | 1752 } |
1759 void XFA_STRING_TO_RGB(CFX_WideString& strRGB, | 1753 void XFA_STRING_TO_RGB(const CFX_WideString& strRGB, |
1760 int32_t& r, | 1754 int32_t& r, |
1761 int32_t& g, | 1755 int32_t& g, |
1762 int32_t& b) { | 1756 int32_t& b) { |
1763 r = 0; | 1757 r = 0; |
1764 g = 0; | 1758 g = 0; |
1765 b = 0; | 1759 b = 0; |
| 1760 |
1766 FX_WCHAR zero = '0'; | 1761 FX_WCHAR zero = '0'; |
1767 int32_t iIndex = 0; | 1762 int32_t iIndex = 0; |
1768 int32_t iLen = strRGB.GetLength(); | 1763 int32_t iLen = strRGB.GetLength(); |
1769 for (int32_t i = 0; i < iLen; ++i) { | 1764 for (int32_t i = 0; i < iLen; ++i) { |
1770 FX_WCHAR ch = strRGB.GetAt(i); | 1765 FX_WCHAR ch = strRGB.GetAt(i); |
1771 if (ch == L',') { | 1766 if (ch == L',') { |
1772 ++iIndex; | 1767 ++iIndex; |
1773 } | 1768 } |
1774 if (iIndex > 2) { | 1769 if (iIndex > 2) { |
1775 break; | 1770 break; |
(...skipping 16 matching lines...) Expand all Loading... |
1792 } | 1787 } |
1793 void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, | 1788 void CXFA_Node::Script_Som_BorderColor(CFXJSE_Value* pValue, |
1794 FX_BOOL bSetting, | 1789 FX_BOOL bSetting, |
1795 XFA_ATTRIBUTE eAttribute) { | 1790 XFA_ATTRIBUTE eAttribute) { |
1796 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1791 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1797 if (!pWidgetData) { | 1792 if (!pWidgetData) { |
1798 return; | 1793 return; |
1799 } | 1794 } |
1800 CXFA_Border border = pWidgetData->GetBorder(TRUE); | 1795 CXFA_Border border = pWidgetData->GetBorder(TRUE); |
1801 int32_t iSize = border.CountEdges(); | 1796 int32_t iSize = border.CountEdges(); |
1802 CFX_WideString strColor; | |
1803 if (bSetting) { | 1797 if (bSetting) { |
1804 CFX_ByteString bsValue; | 1798 int32_t r = 0; |
1805 pValue->ToString(bsValue); | 1799 int32_t g = 0; |
1806 strColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); | 1800 int32_t b = 0; |
1807 int32_t r = 0, g = 0, b = 0; | 1801 XFA_STRING_TO_RGB(pValue->ToWideString(), r, g, b); |
1808 XFA_STRING_TO_RGB(strColor, r, g, b); | |
1809 FX_ARGB rgb = ArgbEncode(100, r, g, b); | 1802 FX_ARGB rgb = ArgbEncode(100, r, g, b); |
1810 for (int32_t i = 0; i < iSize; ++i) { | 1803 for (int32_t i = 0; i < iSize; ++i) { |
1811 CXFA_Edge edge = border.GetEdge(i); | 1804 CXFA_Edge edge = border.GetEdge(i); |
1812 edge.SetColor(rgb); | 1805 edge.SetColor(rgb); |
1813 } | 1806 } |
1814 } else { | 1807 } else { |
1815 CXFA_Edge edge = border.GetEdge(0); | 1808 CXFA_Edge edge = border.GetEdge(0); |
1816 FX_ARGB color = edge.GetColor(); | 1809 FX_ARGB color = edge.GetColor(); |
1817 int32_t a, r, g, b; | 1810 int32_t a, r, g, b; |
1818 ArgbDecode(color, a, r, g, b); | 1811 ArgbDecode(color, a, r, g, b); |
| 1812 CFX_WideString strColor; |
1819 strColor.Format(L"%d,%d,%d", r, g, b); | 1813 strColor.Format(L"%d,%d,%d", r, g, b); |
1820 pValue->SetString(FX_UTF8Encode(strColor).AsStringC()); | 1814 pValue->SetString(FX_UTF8Encode(strColor).AsStringC()); |
1821 } | 1815 } |
1822 } | 1816 } |
1823 void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue, | 1817 void CXFA_Node::Script_Som_BorderWidth(CFXJSE_Value* pValue, |
1824 FX_BOOL bSetting, | 1818 FX_BOOL bSetting, |
1825 XFA_ATTRIBUTE eAttribute) { | 1819 XFA_ATTRIBUTE eAttribute) { |
1826 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1820 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1827 if (!pWidgetData) { | 1821 if (!pWidgetData) { |
1828 return; | 1822 return; |
1829 } | 1823 } |
1830 CXFA_Border border = pWidgetData->GetBorder(TRUE); | 1824 CXFA_Border border = pWidgetData->GetBorder(TRUE); |
1831 int32_t iSize = border.CountEdges(); | 1825 int32_t iSize = border.CountEdges(); |
1832 CFX_WideString wsThickness; | 1826 CFX_WideString wsThickness; |
1833 if (bSetting) { | 1827 if (bSetting) { |
1834 CFX_ByteString bsValue; | 1828 wsThickness = pValue->ToWideString(); |
1835 pValue->ToString(bsValue); | |
1836 wsThickness = CFX_WideString::FromUTF8(bsValue.AsStringC()); | |
1837 for (int32_t i = 0; i < iSize; ++i) { | 1829 for (int32_t i = 0; i < iSize; ++i) { |
1838 CXFA_Edge edge = border.GetEdge(i); | 1830 CXFA_Edge edge = border.GetEdge(i); |
1839 CXFA_Measurement thickness(wsThickness.AsStringC()); | 1831 CXFA_Measurement thickness(wsThickness.AsStringC()); |
1840 edge.SetMSThickness(thickness); | 1832 edge.SetMSThickness(thickness); |
1841 } | 1833 } |
1842 } else { | 1834 } else { |
1843 CXFA_Edge edge = border.GetEdge(0); | 1835 CXFA_Edge edge = border.GetEdge(0); |
1844 CXFA_Measurement thickness = edge.GetMSThickness(); | 1836 CXFA_Measurement thickness = edge.GetMSThickness(); |
1845 thickness.ToString(wsThickness); | 1837 thickness.ToString(wsThickness); |
1846 pValue->SetString(FX_UTF8Encode(wsThickness).AsStringC()); | 1838 pValue->SetString(FX_UTF8Encode(wsThickness).AsStringC()); |
1847 } | 1839 } |
1848 } | 1840 } |
1849 void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue, | 1841 void CXFA_Node::Script_Som_FillColor(CFXJSE_Value* pValue, |
1850 FX_BOOL bSetting, | 1842 FX_BOOL bSetting, |
1851 XFA_ATTRIBUTE eAttribute) { | 1843 XFA_ATTRIBUTE eAttribute) { |
1852 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1844 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1853 if (!pWidgetData) { | 1845 if (!pWidgetData) { |
1854 return; | 1846 return; |
1855 } | 1847 } |
1856 CXFA_Border border = pWidgetData->GetBorder(TRUE); | 1848 CXFA_Border border = pWidgetData->GetBorder(TRUE); |
1857 CXFA_Fill borderfill = border.GetFill(TRUE); | 1849 CXFA_Fill borderfill = border.GetFill(TRUE); |
1858 CXFA_Node* pNode = borderfill.GetNode(); | 1850 CXFA_Node* pNode = borderfill.GetNode(); |
1859 if (!pNode) { | 1851 if (!pNode) { |
1860 return; | 1852 return; |
1861 } | 1853 } |
1862 CFX_WideString wsColor; | |
1863 if (bSetting) { | 1854 if (bSetting) { |
1864 CFX_ByteString bsValue; | 1855 int32_t r; |
1865 pValue->ToString(bsValue); | 1856 int32_t g; |
1866 wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); | 1857 int32_t b; |
1867 int32_t r, g, b; | 1858 XFA_STRING_TO_RGB(pValue->ToWideString(), r, g, b); |
1868 XFA_STRING_TO_RGB(wsColor, r, g, b); | |
1869 FX_ARGB color = ArgbEncode(0xff, r, g, b); | 1859 FX_ARGB color = ArgbEncode(0xff, r, g, b); |
1870 borderfill.SetColor(color); | 1860 borderfill.SetColor(color); |
1871 } else { | 1861 } else { |
1872 FX_ARGB color = borderfill.GetColor(); | 1862 FX_ARGB color = borderfill.GetColor(); |
1873 int32_t a, r, g, b; | 1863 int32_t a; |
| 1864 int32_t r; |
| 1865 int32_t g; |
| 1866 int32_t b; |
1874 ArgbDecode(color, a, r, g, b); | 1867 ArgbDecode(color, a, r, g, b); |
| 1868 CFX_WideString wsColor; |
1875 wsColor.Format(L"%d,%d,%d", r, g, b); | 1869 wsColor.Format(L"%d,%d,%d", r, g, b); |
1876 pValue->SetString(FX_UTF8Encode(wsColor).AsStringC()); | 1870 pValue->SetString(FX_UTF8Encode(wsColor).AsStringC()); |
1877 } | 1871 } |
1878 } | 1872 } |
1879 void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue, | 1873 void CXFA_Node::Script_Som_DataNode(CFXJSE_Value* pValue, |
1880 FX_BOOL bSetting, | 1874 FX_BOOL bSetting, |
1881 XFA_ATTRIBUTE eAttribute) { | 1875 XFA_ATTRIBUTE eAttribute) { |
1882 if (!bSetting) { | 1876 if (!bSetting) { |
1883 CXFA_Node* pDataNode = GetBindData(); | 1877 CXFA_Node* pDataNode = GetBindData(); |
1884 if (pDataNode) { | 1878 if (pDataNode) { |
1885 pValue->Assign( | 1879 pValue->Assign( |
1886 m_pDocument->GetScriptContext()->GetJSValueFromMap(pDataNode)); | 1880 m_pDocument->GetScriptContext()->GetJSValueFromMap(pDataNode)); |
1887 } else { | 1881 } else { |
1888 pValue->SetNull(); | 1882 pValue->SetNull(); |
1889 } | 1883 } |
1890 } else { | 1884 } else { |
1891 ThrowException(XFA_IDS_INVAlID_PROP_SET); | 1885 ThrowException(XFA_IDS_INVAlID_PROP_SET); |
1892 } | 1886 } |
1893 } | 1887 } |
1894 void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue, | 1888 void CXFA_Node::Script_Draw_DefaultValue(CFXJSE_Value* pValue, |
1895 FX_BOOL bSetting, | 1889 FX_BOOL bSetting, |
1896 XFA_ATTRIBUTE eAttribute) { | 1890 XFA_ATTRIBUTE eAttribute) { |
1897 if (bSetting) { | 1891 if (bSetting) { |
1898 if (pValue && pValue->IsString()) { | 1892 if (pValue && pValue->IsString()) { |
1899 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1893 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1900 ASSERT(pWidgetData); | 1894 ASSERT(pWidgetData); |
1901 XFA_ELEMENT uiType = pWidgetData->GetUIType(); | 1895 XFA_ELEMENT uiType = pWidgetData->GetUIType(); |
1902 if (uiType == XFA_ELEMENT_Text) { | 1896 if (uiType == XFA_ELEMENT_Text) { |
1903 CFX_ByteString newValue; | 1897 CFX_WideString wsNewValue = pValue->ToWideString(); |
1904 pValue->ToString(newValue); | |
1905 CFX_WideString wsNewValue = | |
1906 CFX_WideString::FromUTF8(newValue.AsStringC()); | |
1907 CFX_WideString wsFormatValue(wsNewValue); | 1898 CFX_WideString wsFormatValue(wsNewValue); |
1908 SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); | 1899 SetScriptContent(wsNewValue, wsFormatValue, true, TRUE); |
1909 } | 1900 } |
1910 } | 1901 } |
1911 } else { | 1902 } else { |
1912 CFX_WideString content = GetScriptContent(TRUE); | 1903 CFX_WideString content = GetScriptContent(TRUE); |
1913 if (content.IsEmpty()) { | 1904 if (content.IsEmpty()) { |
1914 pValue->SetNull(); | 1905 pValue->SetNull(); |
1915 } else { | 1906 } else { |
1916 pValue->SetString( | 1907 pValue->SetString( |
1917 FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC()); | 1908 FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC()); |
1918 } | 1909 } |
1919 } | 1910 } |
1920 } | 1911 } |
1921 void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, | 1912 void CXFA_Node::Script_Field_DefaultValue(CFXJSE_Value* pValue, |
1922 FX_BOOL bSetting, | 1913 FX_BOOL bSetting, |
1923 XFA_ATTRIBUTE eAttribute) { | 1914 XFA_ATTRIBUTE eAttribute) { |
1924 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1915 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1925 if (!pWidgetData) { | 1916 if (!pWidgetData) { |
1926 return; | 1917 return; |
1927 } | 1918 } |
1928 if (bSetting) { | 1919 if (bSetting) { |
1929 if (pValue && pValue->IsNull()) { | 1920 if (pValue && pValue->IsNull()) { |
1930 pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; | 1921 pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; |
1931 pWidgetData->m_bIsNull = TRUE; | 1922 pWidgetData->m_bIsNull = TRUE; |
1932 } else { | 1923 } else { |
1933 pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; | 1924 pWidgetData->m_bPreNull = pWidgetData->m_bIsNull; |
1934 pWidgetData->m_bIsNull = FALSE; | 1925 pWidgetData->m_bIsNull = FALSE; |
1935 } | 1926 } |
1936 CFX_ByteString newValue; | 1927 CFX_WideString wsNewText; |
1937 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) | 1928 if (!(pValue && (pValue->IsNull() || pValue->IsUndefined()))) |
1938 pValue->ToString(newValue); | 1929 wsNewText = pValue->ToWideString(); |
1939 | 1930 |
1940 CFX_WideString wsNewText = CFX_WideString::FromUTF8(newValue.AsStringC()); | |
1941 CXFA_Node* pUIChild = pWidgetData->GetUIChild(); | 1931 CXFA_Node* pUIChild = pWidgetData->GetUIChild(); |
1942 if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) { | 1932 if (pUIChild->GetClassID() == XFA_ELEMENT_NumericEdit) { |
1943 int32_t iLeadDigits = 0; | 1933 int32_t iLeadDigits = 0; |
1944 int32_t iFracDigits = 0; | 1934 int32_t iFracDigits = 0; |
1945 pWidgetData->GetLeadDigits(iLeadDigits); | 1935 pWidgetData->GetLeadDigits(iLeadDigits); |
1946 pWidgetData->GetFracDigits(iFracDigits); | 1936 pWidgetData->GetFracDigits(iFracDigits); |
1947 wsNewText = | 1937 wsNewText = |
1948 pWidgetData->NumericLimit(wsNewText, iLeadDigits, iFracDigits); | 1938 pWidgetData->NumericLimit(wsNewText, iLeadDigits, iFracDigits); |
1949 } | 1939 } |
1950 CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); | 1940 CXFA_WidgetData* pContainerWidgetData = GetContainerWidgetData(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 } | 1975 } |
1986 } | 1976 } |
1987 } | 1977 } |
1988 void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue, | 1978 void CXFA_Node::Script_Field_EditValue(CFXJSE_Value* pValue, |
1989 FX_BOOL bSetting, | 1979 FX_BOOL bSetting, |
1990 XFA_ATTRIBUTE eAttribute) { | 1980 XFA_ATTRIBUTE eAttribute) { |
1991 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1981 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
1992 if (!pWidgetData) { | 1982 if (!pWidgetData) { |
1993 return; | 1983 return; |
1994 } | 1984 } |
1995 CFX_WideString wsValue; | |
1996 if (bSetting) { | 1985 if (bSetting) { |
1997 CFX_ByteString bsValue; | 1986 pWidgetData->SetValue(pValue->ToWideString(), XFA_VALUEPICTURE_Edit); |
1998 pValue->ToString(bsValue); | |
1999 wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); | |
2000 pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Edit); | |
2001 } else { | 1987 } else { |
| 1988 CFX_WideString wsValue; |
2002 pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit); | 1989 pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Edit); |
2003 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); | 1990 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); |
2004 } | 1991 } |
2005 } | 1992 } |
2006 void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue, | 1993 void CXFA_Node::Script_Som_FontColor(CFXJSE_Value* pValue, |
2007 FX_BOOL bSetting, | 1994 FX_BOOL bSetting, |
2008 XFA_ATTRIBUTE eAttribute) { | 1995 XFA_ATTRIBUTE eAttribute) { |
2009 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 1996 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
2010 if (!pWidgetData) { | 1997 if (!pWidgetData) { |
2011 return; | 1998 return; |
2012 } | 1999 } |
2013 CXFA_Font font = pWidgetData->GetFont(TRUE); | 2000 CXFA_Font font = pWidgetData->GetFont(TRUE); |
2014 CXFA_Node* pNode = font.GetNode(); | 2001 CXFA_Node* pNode = font.GetNode(); |
2015 if (!pNode) { | 2002 if (!pNode) { |
2016 return; | 2003 return; |
2017 } | 2004 } |
2018 CFX_WideString wsColor; | |
2019 if (bSetting) { | 2005 if (bSetting) { |
2020 CFX_ByteString bsValue; | 2006 int32_t r; |
2021 pValue->ToString(bsValue); | 2007 int32_t g; |
2022 wsColor = CFX_WideString::FromUTF8(bsValue.AsStringC()); | 2008 int32_t b; |
2023 int32_t r, g, b; | 2009 XFA_STRING_TO_RGB(pValue->ToWideString(), r, g, b); |
2024 XFA_STRING_TO_RGB(wsColor, r, g, b); | |
2025 FX_ARGB color = ArgbEncode(0xff, r, g, b); | 2010 FX_ARGB color = ArgbEncode(0xff, r, g, b); |
2026 font.SetColor(color); | 2011 font.SetColor(color); |
2027 } else { | 2012 } else { |
2028 FX_ARGB color = font.GetColor(); | 2013 FX_ARGB color = font.GetColor(); |
2029 int32_t a, r, g, b; | 2014 int32_t a; |
| 2015 int32_t r; |
| 2016 int32_t g; |
| 2017 int32_t b; |
2030 ArgbDecode(color, a, r, g, b); | 2018 ArgbDecode(color, a, r, g, b); |
| 2019 CFX_WideString wsColor; |
2031 wsColor.Format(L"%d,%d,%d", r, g, b); | 2020 wsColor.Format(L"%d,%d,%d", r, g, b); |
2032 pValue->SetString(FX_UTF8Encode(wsColor).AsStringC()); | 2021 pValue->SetString(FX_UTF8Encode(wsColor).AsStringC()); |
2033 } | 2022 } |
2034 } | 2023 } |
2035 void CXFA_Node::Script_Field_FormatMessage(CFXJSE_Value* pValue, | 2024 void CXFA_Node::Script_Field_FormatMessage(CFXJSE_Value* pValue, |
2036 FX_BOOL bSetting, | 2025 FX_BOOL bSetting, |
2037 XFA_ATTRIBUTE eAttribute) { | 2026 XFA_ATTRIBUTE eAttribute) { |
2038 Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage); | 2027 Script_Som_Message(pValue, bSetting, XFA_SOM_FormatMessage); |
2039 } | 2028 } |
2040 void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue, | 2029 void CXFA_Node::Script_Field_FormattedValue(CFXJSE_Value* pValue, |
2041 FX_BOOL bSetting, | 2030 FX_BOOL bSetting, |
2042 XFA_ATTRIBUTE eAttribute) { | 2031 XFA_ATTRIBUTE eAttribute) { |
2043 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 2032 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
2044 if (!pWidgetData) { | 2033 if (!pWidgetData) { |
2045 return; | 2034 return; |
2046 } | 2035 } |
2047 CFX_WideString wsValue; | |
2048 if (bSetting) { | 2036 if (bSetting) { |
2049 CFX_ByteString bsValue; | 2037 pWidgetData->SetValue(pValue->ToWideString(), XFA_VALUEPICTURE_Display); |
2050 pValue->ToString(bsValue); | |
2051 wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); | |
2052 pWidgetData->SetValue(wsValue, XFA_VALUEPICTURE_Display); | |
2053 } else { | 2038 } else { |
| 2039 CFX_WideString wsValue; |
2054 pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 2040 pWidgetData->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
2055 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); | 2041 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); |
2056 } | 2042 } |
2057 } | 2043 } |
2058 void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue, | 2044 void CXFA_Node::Script_Som_Mandatory(CFXJSE_Value* pValue, |
2059 FX_BOOL bSetting, | 2045 FX_BOOL bSetting, |
2060 XFA_ATTRIBUTE eAttribute) { | 2046 XFA_ATTRIBUTE eAttribute) { |
2061 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 2047 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
2062 if (!pWidgetData) { | 2048 if (!pWidgetData) { |
2063 return; | 2049 return; |
2064 } | 2050 } |
2065 CXFA_Validate validate = pWidgetData->GetValidate(TRUE); | 2051 CXFA_Validate validate = pWidgetData->GetValidate(TRUE); |
2066 CFX_WideString wsValue; | |
2067 if (bSetting) { | 2052 if (bSetting) { |
2068 CFX_ByteString bsValue; | 2053 validate.SetNullTest(pValue->ToWideString()); |
2069 pValue->ToString(bsValue); | |
2070 wsValue = CFX_WideString::FromUTF8(bsValue.AsStringC()); | |
2071 validate.SetNullTest(wsValue); | |
2072 } else { | 2054 } else { |
2073 int32_t iValue = validate.GetNullTest(); | 2055 int32_t iValue = validate.GetNullTest(); |
2074 const XFA_ATTRIBUTEENUMINFO* pInfo = | 2056 const XFA_ATTRIBUTEENUMINFO* pInfo = |
2075 XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)iValue); | 2057 XFA_GetAttributeEnumByID((XFA_ATTRIBUTEENUM)iValue); |
2076 if (pInfo) { | 2058 CFX_WideString wsValue; |
| 2059 if (pInfo) |
2077 wsValue = pInfo->pName; | 2060 wsValue = pInfo->pName; |
2078 } | |
2079 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); | 2061 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); |
2080 } | 2062 } |
2081 } | 2063 } |
2082 void CXFA_Node::Script_Som_MandatoryMessage(CFXJSE_Value* pValue, | 2064 void CXFA_Node::Script_Som_MandatoryMessage(CFXJSE_Value* pValue, |
2083 FX_BOOL bSetting, | 2065 FX_BOOL bSetting, |
2084 XFA_ATTRIBUTE eAttribute) { | 2066 XFA_ATTRIBUTE eAttribute) { |
2085 Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage); | 2067 Script_Som_Message(pValue, bSetting, XFA_SOM_MandatoryMessage); |
2086 } | 2068 } |
2087 void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue, | 2069 void CXFA_Node::Script_Field_ParentSubform(CFXJSE_Value* pValue, |
2088 FX_BOOL bSetting, | 2070 FX_BOOL bSetting, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 } | 2305 } |
2324 } | 2306 } |
2325 void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, | 2307 void CXFA_Node::Script_ExclGroup_DefaultAndRawValue(CFXJSE_Value* pValue, |
2326 FX_BOOL bSetting, | 2308 FX_BOOL bSetting, |
2327 XFA_ATTRIBUTE eAttribute) { | 2309 XFA_ATTRIBUTE eAttribute) { |
2328 CXFA_WidgetData* pWidgetData = GetWidgetData(); | 2310 CXFA_WidgetData* pWidgetData = GetWidgetData(); |
2329 if (!pWidgetData) { | 2311 if (!pWidgetData) { |
2330 return; | 2312 return; |
2331 } | 2313 } |
2332 if (bSetting) { | 2314 if (bSetting) { |
2333 CFX_ByteString bsValue; | 2315 pWidgetData->SetSelectedMemberByValue(pValue->ToWideString().AsStringC(), |
2334 pValue->ToString(bsValue); | 2316 true, TRUE, TRUE); |
2335 pWidgetData->SetSelectedMemberByValue( | |
2336 CFX_WideString::FromUTF8(bsValue.AsStringC()).AsStringC(), true, TRUE, | |
2337 TRUE); | |
2338 } else { | 2317 } else { |
2339 CFX_WideString wsValue = GetScriptContent(TRUE); | 2318 CFX_WideString wsValue = GetScriptContent(TRUE); |
2340 XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); | 2319 XFA_VERSION curVersion = GetDocument()->GetCurVersionMode(); |
2341 if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { | 2320 if (wsValue.IsEmpty() && curVersion >= XFA_VERSION_300) { |
2342 pValue->SetNull(); | 2321 pValue->SetNull(); |
2343 } else { | 2322 } else { |
2344 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); | 2323 pValue->SetString(FX_UTF8Encode(wsValue).AsStringC()); |
2345 } | 2324 } |
2346 } | 2325 } |
2347 } | 2326 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2522 pValue->SetNull(); | 2501 pValue->SetNull(); |
2523 } | 2502 } |
2524 } else { | 2503 } else { |
2525 ThrowException(XFA_IDS_INVAlID_PROP_SET); | 2504 ThrowException(XFA_IDS_INVAlID_PROP_SET); |
2526 } | 2505 } |
2527 } | 2506 } |
2528 void CXFA_Node::Script_Subform_Locale(CFXJSE_Value* pValue, | 2507 void CXFA_Node::Script_Subform_Locale(CFXJSE_Value* pValue, |
2529 FX_BOOL bSetting, | 2508 FX_BOOL bSetting, |
2530 XFA_ATTRIBUTE eAttribute) { | 2509 XFA_ATTRIBUTE eAttribute) { |
2531 if (bSetting) { | 2510 if (bSetting) { |
2532 CFX_ByteString bsLocaleName; | 2511 SetCData(XFA_ATTRIBUTE_Locale, pValue->ToWideString(), true, TRUE); |
2533 pValue->ToString(bsLocaleName); | |
2534 SetCData(XFA_ATTRIBUTE_Locale, | |
2535 CFX_WideString::FromUTF8(bsLocaleName.AsStringC()), true, TRUE); | |
2536 } else { | 2512 } else { |
2537 CFX_WideString wsLocaleName; | 2513 CFX_WideString wsLocaleName; |
2538 GetLocaleName(wsLocaleName); | 2514 GetLocaleName(wsLocaleName); |
2539 pValue->SetString( | 2515 pValue->SetString( |
2540 FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength()) | 2516 FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength()) |
2541 .AsStringC()); | 2517 .AsStringC()); |
2542 } | 2518 } |
2543 } | 2519 } |
2544 void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { | 2520 void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) { |
2545 int32_t argc = pArguments->GetLength(); | 2521 int32_t argc = pArguments->GetLength(); |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); | 3355 (iRet == XFA_EVENTERROR_Error) ? FALSE : TRUE); |
3380 } | 3356 } |
3381 } else { | 3357 } else { |
3382 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); | 3358 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"execValidate"); |
3383 } | 3359 } |
3384 } | 3360 } |
3385 void CXFA_Node::Script_Form_Checksum(CFXJSE_Value* pValue, | 3361 void CXFA_Node::Script_Form_Checksum(CFXJSE_Value* pValue, |
3386 FX_BOOL bSetting, | 3362 FX_BOOL bSetting, |
3387 XFA_ATTRIBUTE eAttribute) { | 3363 XFA_ATTRIBUTE eAttribute) { |
3388 if (bSetting) { | 3364 if (bSetting) { |
3389 CFX_ByteString bsChecksum; | 3365 SetAttribute(XFA_ATTRIBUTE_Checksum, pValue->ToWideString().AsStringC()); |
3390 pValue->ToString(bsChecksum); | |
3391 SetAttribute(XFA_ATTRIBUTE_Checksum, | |
3392 CFX_WideString::FromUTF8(bsChecksum.AsStringC()).AsStringC()); | |
3393 } else { | 3366 } else { |
3394 CFX_WideString wsChecksum; | 3367 CFX_WideString wsChecksum; |
3395 GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE); | 3368 GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE); |
3396 pValue->SetString( | 3369 pValue->SetString( |
3397 FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC()); | 3370 FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC()); |
3398 } | 3371 } |
3399 } | 3372 } |
3400 void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) { | 3373 void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) { |
3401 int32_t argc = pArguments->GetLength(); | 3374 int32_t argc = pArguments->GetLength(); |
3402 if (argc == 1) { | 3375 if (argc == 1) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3445 } | 3418 } |
3446 pArguments->GetReturnValue()->SetNull(); | 3419 pArguments->GetReturnValue()->SetNull(); |
3447 } else { | 3420 } else { |
3448 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"removeAttribute"); | 3421 ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"removeAttribute"); |
3449 } | 3422 } |
3450 } | 3423 } |
3451 void CXFA_Node::Script_Packet_Content(CFXJSE_Value* pValue, | 3424 void CXFA_Node::Script_Packet_Content(CFXJSE_Value* pValue, |
3452 FX_BOOL bSetting, | 3425 FX_BOOL bSetting, |
3453 XFA_ATTRIBUTE eAttribute) { | 3426 XFA_ATTRIBUTE eAttribute) { |
3454 if (bSetting) { | 3427 if (bSetting) { |
3455 CFX_ByteString bsNewContent; | |
3456 pValue->ToString(bsNewContent); | |
3457 CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); | 3428 CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); |
3458 if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { | 3429 if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { |
3459 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); | 3430 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); |
3460 pXMLElement->SetTextData( | 3431 pXMLElement->SetTextData(pValue->ToWideString()); |
3461 CFX_WideString::FromUTF8(bsNewContent.AsStringC())); | |
3462 } | 3432 } |
3463 } else { | 3433 } else { |
3464 CFX_WideString wsTextData; | 3434 CFX_WideString wsTextData; |
3465 CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); | 3435 CFDE_XMLNode* pXMLNode = GetXMLMappingNode(); |
3466 if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { | 3436 if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) { |
3467 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); | 3437 CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); |
3468 pXMLElement->GetTextData(wsTextData); | 3438 pXMLElement->GetTextData(wsTextData); |
3469 } | 3439 } |
3470 pValue->SetString( | 3440 pValue->SetString( |
3471 FX_UTF8Encode(wsTextData.c_str(), wsTextData.GetLength()).AsStringC()); | 3441 FX_UTF8Encode(wsTextData.c_str(), wsTextData.GetLength()).AsStringC()); |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5278 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); | 5248 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); |
5279 } | 5249 } |
5280 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { | 5250 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { |
5281 return m_pAttachNode->RemoveChild(pNode); | 5251 return m_pAttachNode->RemoveChild(pNode); |
5282 } | 5252 } |
5283 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { | 5253 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { |
5284 return m_pAttachNode->GetChild( | 5254 return m_pAttachNode->GetChild( |
5285 iIndex, XFA_ELEMENT_UNKNOWN, | 5255 iIndex, XFA_ELEMENT_UNKNOWN, |
5286 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); | 5256 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); |
5287 } | 5257 } |
OLD | NEW |