Skip to content

Commit

Permalink
Fix status bar path value
Browse files Browse the repository at this point in the history
Identity attributes values were not displayed if "Dump attributes name" is disabled
  • Loading branch information
Nicolas Crittin committed Mar 31, 2022
1 parent f251bd4 commit de76065
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions QuickXmlLib/QuickXml/src/XmlFormater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,13 @@ namespace QuickXml {
break;
}
case XmlTokenType::AttrValue: {
if (keep_attr_value && vPath.size() >= 2 && this->params.dumpIdAttributesName) {
vPath.back().attributes.push_back({ vPath.back().attr, std::string(token.chars, token.size) });
if (keep_attr_value && vPath.size() >= 2) {
if (this->params.dumpIdAttributesName) {
vPath.back().attributes.push_back({ vPath.back().attr, std::string(token.chars, token.size) });
}
else {
vPath.back().attributes.push_back({ vPath.back().attr, std::string(token.chars+1, token.size-2) });
}
}
keep_attr_value = false;
break;
Expand Down Expand Up @@ -581,7 +586,7 @@ namespace QuickXml {
}
else {
if (i > 0) out_attr << " | ";
out_attr << key;
out_attr << attr.val;
}
}
}
Expand Down

0 comments on commit de76065

Please sign in to comment.