OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" | 7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 } | 1576 } |
1577 return 0xFF000000; | 1577 return 0xFF000000; |
1578 } | 1578 } |
1579 CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { | 1579 CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { |
1580 bRichText = FALSE; | 1580 bRichText = FALSE; |
1581 if (m_pTextNode) { | 1581 if (m_pTextNode) { |
1582 if (m_pTextNode->GetClassID() == XFA_ELEMENT_ExData) { | 1582 if (m_pTextNode->GetClassID() == XFA_ELEMENT_ExData) { |
1583 CFX_WideString wsContentType; | 1583 CFX_WideString wsContentType; |
1584 m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, | 1584 m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, |
1585 FALSE); | 1585 FALSE); |
1586 if (wsContentType.Equal(FX_WSTRC(L"text/html"))) { | 1586 if (wsContentType == FX_WSTRC(L"text/html")) { |
1587 bRichText = TRUE; | 1587 bRichText = TRUE; |
1588 } | 1588 } |
1589 } | 1589 } |
1590 return m_pTextNode; | 1590 return m_pTextNode; |
1591 } | 1591 } |
1592 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1592 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
1593 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); | 1593 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); |
1594 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_ELEMENT_Value); | 1594 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_ELEMENT_Value); |
1595 if (!pValueNode) { | 1595 if (!pValueNode) { |
1596 return NULL; | 1596 return NULL; |
1597 } | 1597 } |
1598 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1598 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
1599 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1599 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { |
1600 CFX_WideString wsContentType; | 1600 CFX_WideString wsContentType; |
1601 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1601 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
1602 if (wsContentType.Equal(FX_WSTRC(L"text/html"))) { | 1602 if (wsContentType == FX_WSTRC(L"text/html")) { |
1603 bRichText = TRUE; | 1603 bRichText = TRUE; |
1604 } | 1604 } |
1605 } | 1605 } |
1606 return pChildNode; | 1606 return pChildNode; |
1607 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { | 1607 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { |
1608 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); | 1608 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); |
1609 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 1609 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
1610 FXSYS_assert(pXMLNode); | 1610 FXSYS_assert(pXMLNode); |
1611 for (CFDE_XMLNode* pXMLChild = | 1611 for (CFDE_XMLNode* pXMLChild = |
1612 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); | 1612 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); |
(...skipping 14 matching lines...) Expand all Loading... |
1627 return NULL; | 1627 return NULL; |
1628 } | 1628 } |
1629 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_ELEMENT_Value); | 1629 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_ELEMENT_Value); |
1630 if (pValueNode == NULL) { | 1630 if (pValueNode == NULL) { |
1631 return NULL; | 1631 return NULL; |
1632 } | 1632 } |
1633 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1633 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
1634 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1634 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { |
1635 CFX_WideString wsContentType; | 1635 CFX_WideString wsContentType; |
1636 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1636 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
1637 if (wsContentType.Equal(FX_WSTRC(L"text/html"))) { | 1637 if (wsContentType == FX_WSTRC(L"text/html")) { |
1638 bRichText = TRUE; | 1638 bRichText = TRUE; |
1639 } | 1639 } |
1640 } | 1640 } |
1641 return pChildNode; | 1641 return pChildNode; |
1642 } | 1642 } |
1643 CXFA_Node* pItemNode = | 1643 CXFA_Node* pItemNode = |
1644 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Items); | 1644 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Items); |
1645 if (pItemNode == NULL) { | 1645 if (pItemNode == NULL) { |
1646 return NULL; | 1646 return NULL; |
1647 } | 1647 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1709 if (pIDNode) { | 1709 if (pIDNode) { |
1710 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); | 1710 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); |
1711 } | 1711 } |
1712 if (pEmbAcc) { | 1712 if (pEmbAcc) { |
1713 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 1713 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
1714 return TRUE; | 1714 return TRUE; |
1715 } | 1715 } |
1716 } | 1716 } |
1717 return FALSE; | 1717 return FALSE; |
1718 } | 1718 } |
OLD | NEW |