summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index eac7ac04b0..1265988902 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -77,7 +77,7 @@ int32_t GetCount(CXFA_Node* pInstMgrNode) {
CFX_WideStringC wsName = pNode->GetCData(XFA_ATTRIBUTE_Name);
CFX_WideStringC wsInstName = pInstMgrNode->GetCData(XFA_ATTRIBUTE_Name);
if (wsInstName.GetLength() < 1 || wsInstName.GetAt(0) != '_' ||
- wsInstName.Mid(1) != wsName) {
+ wsInstName.Mid(1, wsInstName.GetLength() - 1) != wsName) {
return iCount;
}
dwNameHash = pNode->GetNameHash();
@@ -198,7 +198,7 @@ CXFA_Node* GetItem(CXFA_Node* pInstMgrNode, int32_t iIndex) {
CFX_WideStringC wsName = pNode->GetCData(XFA_ATTRIBUTE_Name);
CFX_WideStringC wsInstName = pInstMgrNode->GetCData(XFA_ATTRIBUTE_Name);
if (wsInstName.GetLength() < 1 || wsInstName.GetAt(0) != '_' ||
- wsInstName.Mid(1) != wsName) {
+ wsInstName.Mid(1, wsInstName.GetLength() - 1) != wsName) {
return nullptr;
}
dwNameHash = pNode->GetNameHash();
@@ -2737,7 +2737,7 @@ void CXFA_Node::Script_Subform_InstanceManager(CFXJSE_Value* pValue,
if (pNode->GetElementType() == XFA_Element::InstanceManager) {
CFX_WideStringC wsInstMgrName = pNode->GetCData(XFA_ATTRIBUTE_Name);
if (wsInstMgrName.GetLength() >= 1 && wsInstMgrName.GetAt(0) == '_' &&
- wsInstMgrName.Mid(1) == wsName) {
+ wsInstMgrName.Mid(1, wsInstMgrName.GetLength() - 1) == wsName) {
pInstanceMgr = pNode;
}
break;
@@ -3162,9 +3162,10 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) {
}
if (iDesired < iCount) {
CFX_WideStringC wsInstManagerName = GetCData(XFA_ATTRIBUTE_Name);
- CFX_WideString wsInstanceName =
- CFX_WideString(wsInstManagerName.IsEmpty() ? wsInstManagerName
- : wsInstManagerName.Mid(1));
+ CFX_WideString wsInstanceName = CFX_WideString(
+ wsInstManagerName.IsEmpty()
+ ? wsInstManagerName
+ : wsInstManagerName.Mid(1, wsInstManagerName.GetLength() - 1));
uint32_t dInstanceNameHash =
FX_HashCode_GetW(wsInstanceName.AsStringC(), false);
CXFA_Node* pPrevSibling =
@@ -4664,7 +4665,7 @@ CXFA_Node* CXFA_Node::GetInstanceMgrOfSubform() {
CFX_WideStringC wsName = GetCData(XFA_ATTRIBUTE_Name);
CFX_WideStringC wsInstName = pNode->GetCData(XFA_ATTRIBUTE_Name);
if (wsInstName.GetLength() > 0 && wsInstName.GetAt(0) == '_' &&
- wsInstName.Mid(1) == wsName) {
+ wsInstName.Mid(1, wsInstName.GetLength() - 1) == wsName) {
pInstanceMgr = pNode;
}
break;