| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" | 7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "xfa/fxfa/parser/xfa_script_imp.h" | 28 #include "xfa/fxfa/parser/xfa_script_imp.h" |
| 29 #include "xfa/fxjse/value.h" | 29 #include "xfa/fxjse/value.h" |
| 30 | 30 |
| 31 static void XFA_FFDeleteCalcData(void* pData) { | 31 static void XFA_FFDeleteCalcData(void* pData) { |
| 32 if (pData) { | 32 if (pData) { |
| 33 delete ((CXFA_CalcData*)pData); | 33 delete ((CXFA_CalcData*)pData); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteCalcData = { | 37 static XFA_MAPDATABLOCKCALLBACKINFO gs_XFADeleteCalcData = { |
| 38 XFA_FFDeleteCalcData, NULL}; | 38 XFA_FFDeleteCalcData, nullptr}; |
| 39 | 39 |
| 40 class CXFA_WidgetLayoutData { | 40 class CXFA_WidgetLayoutData { |
| 41 public: | 41 public: |
| 42 CXFA_WidgetLayoutData() : m_fWidgetHeight(-1) {} | 42 CXFA_WidgetLayoutData() : m_fWidgetHeight(-1) {} |
| 43 virtual ~CXFA_WidgetLayoutData() {} | 43 virtual ~CXFA_WidgetLayoutData() {} |
| 44 | 44 |
| 45 FX_FLOAT m_fWidgetHeight; | 45 FX_FLOAT m_fWidgetHeight; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 class CXFA_TextLayoutData : public CXFA_WidgetLayoutData { | 48 class CXFA_TextLayoutData : public CXFA_WidgetLayoutData { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 std::unique_ptr<CFX_FloatArray> m_pFieldSplitArray; | 127 std::unique_ptr<CFX_FloatArray> m_pFieldSplitArray; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 class CXFA_TextEditData : public CXFA_FieldLayoutData { | 130 class CXFA_TextEditData : public CXFA_FieldLayoutData { |
| 131 public: | 131 public: |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 class CXFA_ImageEditData : public CXFA_FieldLayoutData { | 134 class CXFA_ImageEditData : public CXFA_FieldLayoutData { |
| 135 public: | 135 public: |
| 136 CXFA_ImageEditData() | 136 CXFA_ImageEditData() |
| 137 : m_pDIBitmap(NULL), | 137 : m_pDIBitmap(nullptr), |
| 138 m_bNamedImage(FALSE), | 138 m_bNamedImage(FALSE), |
| 139 m_iImageXDpi(0), | 139 m_iImageXDpi(0), |
| 140 m_iImageYDpi(0) {} | 140 m_iImageYDpi(0) {} |
| 141 | 141 |
| 142 ~CXFA_ImageEditData() override { | 142 ~CXFA_ImageEditData() override { |
| 143 if (m_pDIBitmap && !m_bNamedImage) | 143 if (m_pDIBitmap && !m_bNamedImage) |
| 144 delete m_pDIBitmap; | 144 delete m_pDIBitmap; |
| 145 } | 145 } |
| 146 | 146 |
| 147 FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) { | 147 FX_BOOL LoadImageData(CXFA_WidgetAcc* pAcc) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } break; | 213 } break; |
| 214 case XFA_ELEMENT_ExclGroup: { | 214 case XFA_ELEMENT_ExclGroup: { |
| 215 CXFA_Node* pNextChild = m_pNode->GetNodeItem( | 215 CXFA_Node* pNextChild = m_pNode->GetNodeItem( |
| 216 XFA_NODEITEM_FirstChild, XFA_OBJECTTYPE_ContainerNode); | 216 XFA_NODEITEM_FirstChild, XFA_OBJECTTYPE_ContainerNode); |
| 217 while (pNextChild) { | 217 while (pNextChild) { |
| 218 CXFA_Node* pChild = pNextChild; | 218 CXFA_Node* pChild = pNextChild; |
| 219 CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pChild->GetWidgetData(); | 219 CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pChild->GetWidgetData(); |
| 220 if (!pAcc) { | 220 if (!pAcc) { |
| 221 continue; | 221 continue; |
| 222 } | 222 } |
| 223 CXFA_Value defValue(NULL); | 223 CXFA_Value defValue(nullptr); |
| 224 if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { | 224 if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { |
| 225 defValue.GetChildValueContent(wsValue); | 225 defValue.GetChildValueContent(wsValue); |
| 226 SetValue(wsValue, XFA_VALUEPICTURE_Raw); | 226 SetValue(wsValue, XFA_VALUEPICTURE_Raw); |
| 227 pAcc->SetValue(wsValue, XFA_VALUEPICTURE_Raw); | 227 pAcc->SetValue(wsValue, XFA_VALUEPICTURE_Raw); |
| 228 } else { | 228 } else { |
| 229 CXFA_Node* pItems = pChild->GetChild(0, XFA_ELEMENT_Items); | 229 CXFA_Node* pItems = pChild->GetChild(0, XFA_ELEMENT_Items); |
| 230 if (!pItems) { | 230 if (!pItems) { |
| 231 continue; | 231 continue; |
| 232 } | 232 } |
| 233 CFX_WideString itemText; | 233 CFX_WideString itemText; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } else { | 273 } else { |
| 274 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 274 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
| 275 ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); | 275 ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); |
| 276 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"href", wsHref); | 276 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"href", wsHref); |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 | 279 |
| 280 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { | 280 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { |
| 281 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); | 281 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); |
| 282 if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) { | 282 if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) { |
| 283 return NULL; | 283 return nullptr; |
| 284 } | 284 } |
| 285 return (CXFA_WidgetAcc*)pExcl->GetWidgetData(); | 285 return (CXFA_WidgetAcc*)pExcl->GetWidgetData(); |
| 286 } | 286 } |
| 287 CXFA_FFDocView* CXFA_WidgetAcc::GetDocView() { | 287 CXFA_FFDocView* CXFA_WidgetAcc::GetDocView() { |
| 288 return m_pDocView; | 288 return m_pDocView; |
| 289 } | 289 } |
| 290 CXFA_FFDoc* CXFA_WidgetAcc::GetDoc() { | 290 CXFA_FFDoc* CXFA_WidgetAcc::GetDoc() { |
| 291 return (CXFA_FFDoc*)m_pDocView->GetDoc(); | 291 return (CXFA_FFDoc*)m_pDocView->GetDoc(); |
| 292 } | 292 } |
| 293 CXFA_FFApp* CXFA_WidgetAcc::GetApp() { | 293 CXFA_FFApp* CXFA_WidgetAcc::GetApp() { |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 } | 691 } |
| 692 if (pGlobalData->m_Globals.Find(this) < 0) { | 692 if (pGlobalData->m_Globals.Find(this) < 0) { |
| 693 pGlobalData->m_Globals.Add(this); | 693 pGlobalData->m_Globals.Add(this); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 } | 697 } |
| 698 if (pRetValue) | 698 if (pRetValue) |
| 699 *pRetValue = pTmpRetValue.release(); | 699 *pRetValue = pTmpRetValue.release(); |
| 700 | 700 |
| 701 pContext->SetNodesOfRunScript(NULL); | 701 pContext->SetNodesOfRunScript(nullptr); |
| 702 return iRet; | 702 return iRet; |
| 703 } | 703 } |
| 704 CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { | 704 CXFA_FFWidget* CXFA_WidgetAcc::GetNextWidget(CXFA_FFWidget* pWidget) { |
| 705 CXFA_LayoutItem* pLayout = nullptr; | 705 CXFA_LayoutItem* pLayout = nullptr; |
| 706 if (pWidget) { | 706 if (pWidget) { |
| 707 pLayout = pWidget->GetNext(); | 707 pLayout = pWidget->GetNext(); |
| 708 } else { | 708 } else { |
| 709 pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(m_pNode); | 709 pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(m_pNode); |
| 710 } | 710 } |
| 711 return static_cast<CXFA_FFWidget*>(pLayout); | 711 return static_cast<CXFA_FFWidget*>(pLayout); |
| 712 } | 712 } |
| 713 void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { | 713 void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { |
| 714 CXFA_FFWidget* pWidget = NULL; | 714 CXFA_FFWidget* pWidget = nullptr; |
| 715 while ((pWidget = GetNextWidget(pWidget)) != nullptr) { | 715 while ((pWidget = GetNextWidget(pWidget)) != nullptr) { |
| 716 if (pWidget == pExcept || !pWidget->IsLoaded() || | 716 if (pWidget == pExcept || !pWidget->IsLoaded() || |
| 717 (GetUIType() != XFA_ELEMENT_CheckButton && pWidget->IsFocused())) { | 717 (GetUIType() != XFA_ELEMENT_CheckButton && pWidget->IsFocused())) { |
| 718 continue; | 718 continue; |
| 719 } | 719 } |
| 720 pWidget->UpdateFWLData(); | 720 pWidget->UpdateFWLData(); |
| 721 pWidget->AddInvalidateRect(); | 721 pWidget->AddInvalidateRect(); |
| 722 } | 722 } |
| 723 } | 723 } |
| 724 | 724 |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 CXFA_TextLayout* CXFA_WidgetAcc::GetCaptionTextLayout() { | 1467 CXFA_TextLayout* CXFA_WidgetAcc::GetCaptionTextLayout() { |
| 1468 return m_pLayoutData | 1468 return m_pLayoutData |
| 1469 ? static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) | 1469 ? static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) |
| 1470 ->m_pCapTextLayout.get() | 1470 ->m_pCapTextLayout.get() |
| 1471 : nullptr; | 1471 : nullptr; |
| 1472 } | 1472 } |
| 1473 CXFA_TextLayout* CXFA_WidgetAcc::GetTextLayout() { | 1473 CXFA_TextLayout* CXFA_WidgetAcc::GetTextLayout() { |
| 1474 return m_pLayoutData | 1474 return m_pLayoutData |
| 1475 ? static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get()) | 1475 ? static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get()) |
| 1476 ->GetTextLayout() | 1476 ->GetTextLayout() |
| 1477 : NULL; | 1477 : nullptr; |
| 1478 } | 1478 } |
| 1479 CFX_DIBitmap* CXFA_WidgetAcc::GetImageImage() { | 1479 CFX_DIBitmap* CXFA_WidgetAcc::GetImageImage() { |
| 1480 return m_pLayoutData | 1480 return m_pLayoutData |
| 1481 ? static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()) | 1481 ? static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()) |
| 1482 ->m_pDIBitmap | 1482 ->m_pDIBitmap |
| 1483 : NULL; | 1483 : nullptr; |
| 1484 } | 1484 } |
| 1485 CFX_DIBitmap* CXFA_WidgetAcc::GetImageEditImage() { | 1485 CFX_DIBitmap* CXFA_WidgetAcc::GetImageEditImage() { |
| 1486 return m_pLayoutData | 1486 return m_pLayoutData |
| 1487 ? static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()) | 1487 ? static_cast<CXFA_ImageEditData*>(m_pLayoutData.get()) |
| 1488 ->m_pDIBitmap | 1488 ->m_pDIBitmap |
| 1489 : NULL; | 1489 : nullptr; |
| 1490 } | 1490 } |
| 1491 | 1491 |
| 1492 void CXFA_WidgetAcc::SetImageImage(CFX_DIBitmap* newImage) { | 1492 void CXFA_WidgetAcc::SetImageImage(CFX_DIBitmap* newImage) { |
| 1493 CXFA_ImageLayoutData* pData = | 1493 CXFA_ImageLayoutData* pData = |
| 1494 static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()); | 1494 static_cast<CXFA_ImageLayoutData*>(m_pLayoutData.get()); |
| 1495 if (pData->m_pDIBitmap == newImage) | 1495 if (pData->m_pDIBitmap == newImage) |
| 1496 return; | 1496 return; |
| 1497 | 1497 |
| 1498 if (pData->m_pDIBitmap && !pData->m_bNamedImage) | 1498 if (pData->m_pDIBitmap && !pData->m_bNamedImage) |
| 1499 delete pData->m_pDIBitmap; | 1499 delete pData->m_pDIBitmap; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 if (wsContentType == FX_WSTRC(L"text/html")) { | 1566 if (wsContentType == FX_WSTRC(L"text/html")) { |
| 1567 bRichText = TRUE; | 1567 bRichText = TRUE; |
| 1568 } | 1568 } |
| 1569 } | 1569 } |
| 1570 return m_pTextNode; | 1570 return m_pTextNode; |
| 1571 } | 1571 } |
| 1572 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1572 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
| 1573 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); | 1573 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); |
| 1574 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_ELEMENT_Value); | 1574 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_ELEMENT_Value); |
| 1575 if (!pValueNode) { | 1575 if (!pValueNode) { |
| 1576 return NULL; | 1576 return nullptr; |
| 1577 } | 1577 } |
| 1578 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1578 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 1579 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1579 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { |
| 1580 CFX_WideString wsContentType; | 1580 CFX_WideString wsContentType; |
| 1581 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1581 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
| 1582 if (wsContentType == FX_WSTRC(L"text/html")) { | 1582 if (wsContentType == FX_WSTRC(L"text/html")) { |
| 1583 bRichText = TRUE; | 1583 bRichText = TRUE; |
| 1584 } | 1584 } |
| 1585 } | 1585 } |
| 1586 return pChildNode; | 1586 return pChildNode; |
| 1587 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { | 1587 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { |
| 1588 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); | 1588 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); |
| 1589 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 1589 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
| 1590 ASSERT(pXMLNode); | 1590 ASSERT(pXMLNode); |
| 1591 for (CFDE_XMLNode* pXMLChild = | 1591 for (CFDE_XMLNode* pXMLChild = |
| 1592 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); | 1592 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); |
| 1593 pXMLChild; | 1593 pXMLChild; |
| 1594 pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { | 1594 pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { |
| 1595 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { | 1595 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { |
| 1596 CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); | 1596 CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); |
| 1597 if (XFA_RecognizeRichText(pElement)) { | 1597 if (XFA_RecognizeRichText(pElement)) { |
| 1598 bRichText = TRUE; | 1598 bRichText = TRUE; |
| 1599 } | 1599 } |
| 1600 } | 1600 } |
| 1601 } | 1601 } |
| 1602 return pBind; | 1602 return pBind; |
| 1603 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { | 1603 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { |
| 1604 CXFA_Node* pCaptionNode = | 1604 CXFA_Node* pCaptionNode = |
| 1605 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1605 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); |
| 1606 if (pCaptionNode == NULL) { | 1606 if (!pCaptionNode) |
| 1607 return NULL; | 1607 return nullptr; |
| 1608 } | 1608 |
| 1609 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_ELEMENT_Value); | 1609 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_ELEMENT_Value); |
| 1610 if (pValueNode == NULL) { | 1610 if (!pValueNode) |
| 1611 return NULL; | 1611 return nullptr; |
| 1612 } | 1612 |
| 1613 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1613 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 1614 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1614 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { |
| 1615 CFX_WideString wsContentType; | 1615 CFX_WideString wsContentType; |
| 1616 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1616 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
| 1617 if (wsContentType == FX_WSTRC(L"text/html")) { | 1617 if (wsContentType == FX_WSTRC(L"text/html")) { |
| 1618 bRichText = TRUE; | 1618 bRichText = TRUE; |
| 1619 } | 1619 } |
| 1620 } | 1620 } |
| 1621 return pChildNode; | 1621 return pChildNode; |
| 1622 } | 1622 } |
| 1623 CXFA_Node* pItemNode = | 1623 CXFA_Node* pItemNode = |
| 1624 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Items); | 1624 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Items); |
| 1625 if (pItemNode == NULL) { | 1625 if (!pItemNode) |
| 1626 return NULL; | 1626 return nullptr; |
| 1627 } | 1627 |
| 1628 CXFA_Node* pNode = pItemNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1628 CXFA_Node* pNode = pItemNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 1629 while (pNode) { | 1629 while (pNode) { |
| 1630 CFX_WideStringC wsName; | 1630 CFX_WideStringC wsName; |
| 1631 pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); | 1631 pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); |
| 1632 if (m_eType == XFA_TEXTPROVIDERTYPE_Rollover && | 1632 if (m_eType == XFA_TEXTPROVIDERTYPE_Rollover && |
| 1633 wsName == FX_WSTRC(L"rollover")) { | 1633 wsName == FX_WSTRC(L"rollover")) { |
| 1634 return pNode; | 1634 return pNode; |
| 1635 } | 1635 } |
| 1636 if (m_eType == XFA_TEXTPROVIDERTYPE_Down && wsName == FX_WSTRC(L"down")) { | 1636 if (m_eType == XFA_TEXTPROVIDERTYPE_Down && wsName == FX_WSTRC(L"down")) { |
| 1637 return pNode; | 1637 return pNode; |
| 1638 } | 1638 } |
| 1639 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 1639 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
| 1640 } | 1640 } |
| 1641 return NULL; | 1641 return nullptr; |
| 1642 } | 1642 } |
| 1643 CXFA_Para CXFA_TextProvider::GetParaNode() { | 1643 CXFA_Para CXFA_TextProvider::GetParaNode() { |
| 1644 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1644 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
| 1645 return m_pWidgetAcc->GetPara(); | 1645 return m_pWidgetAcc->GetPara(); |
| 1646 } | 1646 } |
| 1647 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1647 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); |
| 1648 return CXFA_Para(pNode->GetChild(0, XFA_ELEMENT_Para)); | 1648 return CXFA_Para(pNode->GetChild(0, XFA_ELEMENT_Para)); |
| 1649 } | 1649 } |
| 1650 CXFA_Font CXFA_TextProvider::GetFontNode() { | 1650 CXFA_Font CXFA_TextProvider::GetFontNode() { |
| 1651 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1651 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1670 FX_BOOL bRaw, | 1670 FX_BOOL bRaw, |
| 1671 const CFX_WideString& wsAttr, | 1671 const CFX_WideString& wsAttr, |
| 1672 CFX_WideString& wsValue) { | 1672 CFX_WideString& wsValue) { |
| 1673 if (m_eType != XFA_TEXTPROVIDERTYPE_Text) { | 1673 if (m_eType != XFA_TEXTPROVIDERTYPE_Text) { |
| 1674 return FALSE; | 1674 return FALSE; |
| 1675 } | 1675 } |
| 1676 if (bURI) { | 1676 if (bURI) { |
| 1677 CXFA_Node* pWidgetNode = m_pWidgetAcc->GetNode(); | 1677 CXFA_Node* pWidgetNode = m_pWidgetAcc->GetNode(); |
| 1678 CXFA_Node* pParent = pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent); | 1678 CXFA_Node* pParent = pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent); |
| 1679 CXFA_Document* pDocument = pWidgetNode->GetDocument(); | 1679 CXFA_Document* pDocument = pWidgetNode->GetDocument(); |
| 1680 CXFA_Node* pIDNode = NULL; | 1680 CXFA_Node* pIDNode = nullptr; |
| 1681 CXFA_WidgetAcc* pEmbAcc = NULL; | 1681 CXFA_WidgetAcc* pEmbAcc = nullptr; |
| 1682 if (pParent) { | 1682 if (pParent) { |
| 1683 pIDNode = pDocument->GetNodeByID(pParent, wsAttr.AsStringC()); | 1683 pIDNode = pDocument->GetNodeByID(pParent, wsAttr.AsStringC()); |
| 1684 } | 1684 } |
| 1685 if (!pIDNode) { | 1685 if (!pIDNode) { |
| 1686 pIDNode = pDocument->GetNodeByID( | 1686 pIDNode = pDocument->GetNodeByID( |
| 1687 ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Form)), | 1687 ToNode(pDocument->GetXFAObject(XFA_HASHCODE_Form)), |
| 1688 wsAttr.AsStringC()); | 1688 wsAttr.AsStringC()); |
| 1689 } | 1689 } |
| 1690 if (pIDNode) { | 1690 if (pIDNode) { |
| 1691 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); | 1691 pEmbAcc = (CXFA_WidgetAcc*)pIDNode->GetWidgetData(); |
| 1692 } | 1692 } |
| 1693 if (pEmbAcc) { | 1693 if (pEmbAcc) { |
| 1694 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 1694 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
| 1695 return TRUE; | 1695 return TRUE; |
| 1696 } | 1696 } |
| 1697 } | 1697 } |
| 1698 return FALSE; | 1698 return FALSE; |
| 1699 } | 1699 } |
| OLD | NEW |