mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-06-27 17:03:44 +00:00
SetBoolFirstChild now makes sure its bool is not wrapped onto its own line.
This commit is contained in:
parent
b85b4e0a60
commit
07ac762b80
12
tinyxml2.cpp
12
tinyxml2.cpp
@ -1315,13 +1315,15 @@ void XMLElement::SetText( double v )
|
|||||||
|
|
||||||
void XMLElement::SetBoolFirstChild( bool inBool )
|
void XMLElement::SetBoolFirstChild( bool inBool )
|
||||||
{
|
{
|
||||||
if( FirstChild() && FirstChild()->ToElement()
|
XMLElement * theBoolElem = FirstChild() ? FirstChild()->ToElement() : NULL;
|
||||||
&& (strcmp(FirstChild()->Value(),"true") == 0 || strcmp(FirstChild()->Value(),"false") == 0) ) {
|
if( theBoolElem
|
||||||
FirstChild()->SetValue( inBool ? "true" : "false" );
|
&& (strcmp(theBoolElem->Value(),"true") == 0 || strcmp(theBoolElem->Value(),"false") == 0) ) {
|
||||||
|
theBoolElem->SetValue( inBool ? "true" : "false" );
|
||||||
}
|
}
|
||||||
else if( !FirstChild() ) {
|
else if( !FirstChild() ) {
|
||||||
XMLElement* theText = GetDocument()->NewElement( inBool ? "true" : "false" );
|
theBoolElem = GetDocument()->NewElement( inBool ? "true" : "false" );
|
||||||
InsertFirstChild( theText );
|
InsertFirstChild( theBoolElem );
|
||||||
|
SetForceCompactMode(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user