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