From 6651be1203d05f4bc3c8439145e6280d8fc7ed45 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 1 Oct 2006 13:00:20 +0000 Subject: [PATCH] Always true. --- stepmania/src/XmlFile.cpp | 41 ++++++++++++++------------------------- stepmania/src/XmlFile.h | 4 ---- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index a7342721bd..4c656227ad 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -394,8 +394,7 @@ unsigned XNode::Load( const RString &xml, RString &sErrorOut, unsigned iOffset ) bool XNode::GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const RString &sName, const RString &sValue ) const { RString s(sValue); - if( opt.reference_value ) - ReplaceEntityText( s, g_mapCharsToEntities ); + ReplaceEntityText( s, g_mapCharsToEntities ); return f.Write(sName + "='" + s + "' ") != -1; } @@ -404,15 +403,12 @@ bool XNode::GetAttrXML( RageFileBasic &f, DISP_OPT &opt, const RString &sName, c bool XNode::GetXML( RageFileBasic &f, DISP_OPT &opt ) const { // tab - if( opt.newline ) - { - if( f.Write("\r\n") == -1 ) - return false; - if( opt.write_tabs ) - for( int i = 0 ; i < opt.tab_base ; i++) - if( f.Write("\t") == -1 ) - return false; - } + if( f.Write("\r\n") == -1 ) + return false; + if( opt.write_tabs ) + for( int i = 0 ; i < opt.tab_base ; i++) + if( f.Write("\t") == -1 ) + return false; // ") == -1 ) return false; - if( opt.newline && !m_childs.empty() ) - { + if( !m_childs.empty() ) opt.tab_base++; - } FOREACH_CONST_Child( this, p ) if( !p->GetXML( f, opt ) ) @@ -450,25 +444,23 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT &opt ) const // Text Value if( !m_sValue.empty() ) { - if( opt.newline && !m_childs.empty() ) + if( !m_childs.empty() ) { - if( opt.newline ) - if( f.Write("\r\n") == -1 ) - return false; + if( f.Write("\r\n") == -1 ) + return false; if( opt.write_tabs ) for( int i = 0 ; i < opt.tab_base ; i++) if( f.Write("\t") == -1 ) return false; } RString s( m_sValue ); - if( opt.reference_value ) - ReplaceEntityText( s, g_mapCharsToEntities ); + ReplaceEntityText( s, g_mapCharsToEntities ); if( f.Write(s) == -1 ) return false; } // CloseTag - if( opt.newline && !m_childs.empty() ) + if( !m_childs.empty() ) { if( f.Write("\r\n") == -1 ) return false; @@ -480,11 +472,8 @@ bool XNode::GetXML( RageFileBasic &f, DISP_OPT &opt ) const if( f.Write("") == -1 ) return false; - if( opt.newline ) - { - if( !m_childs.empty() ) - opt.tab_base--; - } + if( !m_childs.empty() ) + opt.tab_base--; } return true; } diff --git a/stepmania/src/XmlFile.h b/stepmania/src/XmlFile.h index b1744624d6..29f753d50a 100644 --- a/stepmania/src/XmlFile.h +++ b/stepmania/src/XmlFile.h @@ -38,16 +38,12 @@ typedef multimap XNodes; // display optional environment struct DISP_OPT { - bool newline; // newline when new tag - bool reference_value; // do convert from entity to reference ( < -> < ) RString stylesheet; // empty string = no stylesheet bool write_tabs; // if false, don't write tab indent characters int tab_base; // internal usage DISP_OPT() { - newline = true; - reference_value = true; stylesheet = ""; write_tabs = true; tab_base = 0;