From 69b4f62a7a2c23ce859568be21cb929af07c997d Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 4 Feb 2007 10:49:42 +0000 Subject: [PATCH] No need for this to be split out. --- stepmania/src/XmlFileUtil.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stepmania/src/XmlFileUtil.cpp b/stepmania/src/XmlFileUtil.cpp index f0548e08dc..bcf990b378 100644 --- a/stepmania/src/XmlFileUtil.cpp +++ b/stepmania/src/XmlFileUtil.cpp @@ -400,13 +400,6 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns return iOffset; } -bool GetAttrXML( RageFileBasic &f, const RString &sName, const RString &sValue ) -{ - RString s(sValue); - ReplaceEntityText( s, g_mapCharsToEntities ); - return f.Write( sName ) != -1 && f.Write( "='" ) != -1 && f.Write( s ) && f.Write( "' " ) != -1; -} - bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int &iTabBase ) { // tab @@ -426,9 +419,13 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int if( f.Write(" ") == -1 ) return false; FOREACH_CONST_Attr( pNode, p ) - if( !GetAttrXML(f, p->first, p->second->GetValue()) ) + { + RString attr( p->second->GetValue() ); + ReplaceEntityText( attr, g_mapCharsToEntities ); + if( f.Write( p->first ) == -1 || f.Write( "='" ) == -1 || f.Write( attr ) || f.Write( "' " ) == -1 ) return false; - + } + if( pNode->m_childs.empty() && pNode->m_pValue->GetValue().empty() ) { // alone tag