mirror of https://github.com/AxioDL/tinyxml2.git
Make SetText() behave like the docs say.
This commit is contained in:
parent
85fff5e50a
commit
869bb599c1
|
@ -1262,7 +1262,7 @@ const char* XMLElement::GetText() const
|
||||||
|
|
||||||
void XMLElement::SetText( const char* inText )
|
void XMLElement::SetText( const char* inText )
|
||||||
{
|
{
|
||||||
if ( FirstChild() )
|
if ( FirstChild() && FirstChild()->ToText() )
|
||||||
FirstChild()->SetValue( inText );
|
FirstChild()->SetValue( inText );
|
||||||
else {
|
else {
|
||||||
XMLText* theText = GetDocument()->NewText( inText );
|
XMLText* theText = GetDocument()->NewText( inText );
|
||||||
|
|
Loading…
Reference in New Issue