| 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/parser/xfa_doclayout.h" | 10 #include "xfa/fxfa/parser/xfa_doclayout.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 while (parent) { | 277 while (parent) { |
| 278 XFA_GetNameExpression(parent, wsParent, FALSE, eLogicType); | 278 XFA_GetNameExpression(parent, wsParent, FALSE, eLogicType); |
| 279 wsParent += L"."; | 279 wsParent += L"."; |
| 280 wsParent += wsName; | 280 wsParent += wsName; |
| 281 wsName = wsParent; | 281 wsName = wsParent; |
| 282 parent = XFA_ResolveNodes_GetParent(parent, XFA_LOGIC_NoTransparent); | 282 parent = XFA_ResolveNodes_GetParent(parent, XFA_LOGIC_NoTransparent); |
| 283 } | 283 } |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 | 286 |
| 287 CFX_WideStringC wsTagName; | |
| 288 CFX_WideString ws; | 287 CFX_WideString ws; |
| 289 FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode); | 288 FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode); |
| 290 if (refNode->IsUnnamed() || | 289 if (refNode->IsUnnamed() || |
| 291 (bIsProperty && refNode->GetElementType() != XFA_Element::PageSet)) { | 290 (bIsProperty && refNode->GetElementType() != XFA_Element::PageSet)) { |
| 292 refNode->GetClassName(wsTagName); | 291 ws = refNode->GetClassName(); |
| 293 ws = wsTagName; | |
| 294 wsName.Format(L"#%s[%d]", ws.c_str(), | 292 wsName.Format(L"#%s[%d]", ws.c_str(), |
| 295 XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE)); | 293 XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE)); |
| 296 return; | 294 return; |
| 297 } | 295 } |
| 298 ws = refNode->GetCData(XFA_ATTRIBUTE_Name); | 296 ws = refNode->GetCData(XFA_ATTRIBUTE_Name); |
| 299 ws.Replace(L".", L"\\."); | 297 ws.Replace(L".", L"\\."); |
| 300 wsName.Format(L"%s[%d]", ws.c_str(), | 298 wsName.Format(L"%s[%d]", ws.c_str(), |
| 301 XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE)); | 299 XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE)); |
| 302 } | 300 } |
| 303 | 301 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 } | 428 } |
| 431 | 429 |
| 432 FX_BOOL CXFA_NodeHelper::XFA_NodeIsProperty(CXFA_Node* refNode) { | 430 FX_BOOL CXFA_NodeHelper::XFA_NodeIsProperty(CXFA_Node* refNode) { |
| 433 CXFA_Node* parent = | 431 CXFA_Node* parent = |
| 434 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); | 432 XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent); |
| 435 return parent && refNode && | 433 return parent && refNode && |
| 436 XFA_GetPropertyOfElement(parent->GetElementType(), | 434 XFA_GetPropertyOfElement(parent->GetElementType(), |
| 437 refNode->GetElementType(), | 435 refNode->GetElementType(), |
| 438 XFA_XDPPACKET_UNKNOWN); | 436 XFA_XDPPACKET_UNKNOWN); |
| 439 } | 437 } |
| OLD | NEW |