| 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 |
| 11 #include "xfa/fde/tto/fde_textout.h" | 11 #include "xfa/fde/tto/fde_textout.h" |
| 12 #include "xfa/fde/xml/fde_xml_imp.h" |
| 12 #include "xfa/fxfa/app/xfa_ffapp.h" | 13 #include "xfa/fxfa/app/xfa_ffapp.h" |
| 13 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" | 14 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" |
| 14 #include "xfa/fxfa/app/xfa_ffchoicelist.h" | 15 #include "xfa/fxfa/app/xfa_ffchoicelist.h" |
| 15 #include "xfa/fxfa/app/xfa_ffdoc.h" | 16 #include "xfa/fxfa/app/xfa_ffdoc.h" |
| 16 #include "xfa/fxfa/app/xfa_ffdocview.h" | 17 #include "xfa/fxfa/app/xfa_ffdocview.h" |
| 17 #include "xfa/fxfa/app/xfa_fffield.h" | 18 #include "xfa/fxfa/app/xfa_fffield.h" |
| 18 #include "xfa/fxfa/app/xfa_ffpageview.h" | 19 #include "xfa/fxfa/app/xfa_ffpageview.h" |
| 19 #include "xfa/fxfa/app/xfa_ffwidget.h" | 20 #include "xfa/fxfa/app/xfa_ffwidget.h" |
| 20 #include "xfa/fxfa/app/xfa_fontmgr.h" | 21 #include "xfa/fxfa/app/xfa_fontmgr.h" |
| 21 #include "xfa/fxfa/app/xfa_fwladapter.h" | 22 #include "xfa/fxfa/app/xfa_fwladapter.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 CXFA_Node* pBind = GetDatasets(); | 282 CXFA_Node* pBind = GetDatasets(); |
| 282 if (!pBind) { | 283 if (!pBind) { |
| 283 image.SetTransferEncoding(XFA_ATTRIBUTEENUM_Base64); | 284 image.SetTransferEncoding(XFA_ATTRIBUTEENUM_Base64); |
| 284 return; | 285 return; |
| 285 } | 286 } |
| 286 pBind->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); | 287 pBind->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); |
| 287 CXFA_Node* pHrefNode = pBind->GetNodeItem(XFA_NODEITEM_FirstChild); | 288 CXFA_Node* pHrefNode = pBind->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 288 if (pHrefNode) { | 289 if (pHrefNode) { |
| 289 pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); | 290 pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); |
| 290 } else { | 291 } else { |
| 291 IFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 292 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
| 292 FXSYS_assert(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); | 293 FXSYS_assert(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); |
| 293 ((IFDE_XMLElement*)pXMLNode)->SetString(FX_WSTRC(L"href"), wsHref); | 294 static_cast<CFDE_XMLElement*>(pXMLNode) |
| 295 ->SetString(FX_WSTRC(L"href"), wsHref); |
| 294 } | 296 } |
| 295 } | 297 } |
| 296 | 298 |
| 297 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { | 299 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { |
| 298 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); | 300 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); |
| 299 if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) { | 301 if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) { |
| 300 return NULL; | 302 return NULL; |
| 301 } | 303 } |
| 302 return (CXFA_WidgetAcc*)pExcl->GetWidgetData(); | 304 return (CXFA_WidgetAcc*)pExcl->GetWidgetData(); |
| 303 } | 305 } |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1597 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { |
| 1596 CFX_WideString wsContentType; | 1598 CFX_WideString wsContentType; |
| 1597 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1599 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
| 1598 if (wsContentType.Equal(FX_WSTRC(L"text/html"))) { | 1600 if (wsContentType.Equal(FX_WSTRC(L"text/html"))) { |
| 1599 bRichText = TRUE; | 1601 bRichText = TRUE; |
| 1600 } | 1602 } |
| 1601 } | 1603 } |
| 1602 return pChildNode; | 1604 return pChildNode; |
| 1603 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { | 1605 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { |
| 1604 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); | 1606 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); |
| 1605 IFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 1607 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
| 1606 FXSYS_assert(pXMLNode); | 1608 FXSYS_assert(pXMLNode); |
| 1607 for (IFDE_XMLNode* pXMLChild = | 1609 for (CFDE_XMLNode* pXMLChild = |
| 1608 pXMLNode->GetNodeItem(IFDE_XMLNode::FirstChild); | 1610 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); |
| 1609 pXMLChild; | 1611 pXMLChild; |
| 1610 pXMLChild = pXMLChild->GetNodeItem(IFDE_XMLNode::NextSibling)) { | 1612 pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { |
| 1611 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { | 1613 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { |
| 1612 IFDE_XMLElement* pElement = (IFDE_XMLElement*)pXMLChild; | 1614 CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); |
| 1613 if (XFA_RecognizeRichText(pElement)) { | 1615 if (XFA_RecognizeRichText(pElement)) { |
| 1614 bRichText = TRUE; | 1616 bRichText = TRUE; |
| 1615 } | 1617 } |
| 1616 } | 1618 } |
| 1617 } | 1619 } |
| 1618 return pBind; | 1620 return pBind; |
| 1619 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { | 1621 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { |
| 1620 CXFA_Node* pCaptionNode = | 1622 CXFA_Node* pCaptionNode = |
| 1621 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1623 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); |
| 1622 if (pCaptionNode == NULL) { | 1624 if (pCaptionNode == NULL) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 if (pIDNode) { | 1707 if (pIDNode) { |
| 1706 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); | 1708 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); |
| 1707 } | 1709 } |
| 1708 if (pEmbAcc) { | 1710 if (pEmbAcc) { |
| 1709 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 1711 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
| 1710 return TRUE; | 1712 return TRUE; |
| 1711 } | 1713 } |
| 1712 } | 1714 } |
| 1713 return FALSE; | 1715 return FALSE; |
| 1714 } | 1716 } |
| OLD | NEW |