Make xml_node::value() structure consistent with set_*

This commit is contained in:
Arseny Kapoulkine 2015-04-22 08:30:53 -07:00
parent e4e2259646
commit 4223b4a3f0

View File

@ -5378,14 +5378,13 @@ namespace pugi
PUGI__FN const char_t* xml_node::value() const
{
if (_root)
{
if (impl::has_value(_root) && _root->contents)
return _root->contents;
if (!_root) return PUGIXML_TEXT("");
if (PUGI__NODETYPE(_root) == node_pi && static_cast<xml_node_pi_struct*>(_root)->pi_value)
return static_cast<xml_node_pi_struct*>(_root)->pi_value;
}
if (impl::has_value(_root) && _root->contents)
return _root->contents;
if (PUGI__NODETYPE(_root) == node_pi && static_cast<xml_node_pi_struct*>(_root)->pi_value)
return static_cast<xml_node_pi_struct*>(_root)->pi_value;
return PUGIXML_TEXT("");
}