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_script_nodehelper.h" | 7 #include "xfa/fxfa/parser/xfa_script_nodehelper.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 return; | 277 return; |
278 } | 278 } |
279 | 279 |
280 CFX_WideStringC wsTagName; | 280 CFX_WideStringC wsTagName; |
281 CFX_WideString ws; | 281 CFX_WideString ws; |
282 FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode); | 282 FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode); |
283 if (refNode->IsUnnamed() || | 283 if (refNode->IsUnnamed() || |
284 (bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) { | 284 (bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) { |
285 refNode->GetClassName(wsTagName); | 285 refNode->GetClassName(wsTagName); |
286 ws = wsTagName; | 286 ws = wsTagName; |
287 wsName.Format(L"#%s[%d]", (const FX_WCHAR*)ws, | 287 wsName.Format(L"#%s[%d]", ws.c_str(), |
288 XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE)); | 288 XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE)); |
289 return; | 289 return; |
290 } | 290 } |
291 ws = refNode->GetCData(XFA_ATTRIBUTE_Name); | 291 ws = refNode->GetCData(XFA_ATTRIBUTE_Name); |
292 ws.Replace(L".", L"\\."); | 292 ws.Replace(L".", L"\\."); |
293 wsName.Format(L"%s[%d]", (const FX_WCHAR*)ws, | 293 wsName.Format(L"%s[%d]", ws.c_str(), |
294 XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE)); | 294 XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE)); |
295 } | 295 } |
296 | 296 |
297 FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) { | 297 FX_BOOL CXFA_NodeHelper::XFA_NodeIsTransparent(CXFA_Node* refNode) { |
298 if (refNode == NULL) { | 298 if (refNode == NULL) { |
299 return FALSE; | 299 return FALSE; |
300 } | 300 } |
301 XFA_ELEMENT eRefNode = refNode->GetClassID(); | 301 XFA_ELEMENT eRefNode = refNode->GetClassID(); |
302 if ((refNode->IsUnnamed() && refNode->IsContainerNode()) || | 302 if ((refNode->IsUnnamed() && refNode->IsContainerNode()) || |
303 eRefNode == XFA_ELEMENT_SubformSet || eRefNode == XFA_ELEMENT_Area || | 303 eRefNode == XFA_ELEMENT_SubformSet || eRefNode == XFA_ELEMENT_Area || |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 m_eLastCreateType = XFA_ELEMENT_DataValue; | 420 m_eLastCreateType = XFA_ELEMENT_DataValue; |
421 } | 421 } |
422 } | 422 } |
423 FX_BOOL CXFA_NodeHelper::XFA_NodeIsProperty(CXFA_Node* refNode) { | 423 FX_BOOL CXFA_NodeHelper::XFA_NodeIsProperty(CXFA_Node* refNode) { |
424 CXFA_Node* parent = | 424 CXFA_Node* parent = |
425 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); | 425 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); |
426 return parent && refNode && | 426 return parent && refNode && |
427 XFA_GetPropertyOfElement(parent->GetClassID(), refNode->GetClassID(), | 427 XFA_GetPropertyOfElement(parent->GetClassID(), refNode->GetClassID(), |
428 XFA_XDPPACKET_UNKNOWN); | 428 XFA_XDPPACKET_UNKNOWN); |
429 } | 429 } |
OLD | NEW |