diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index 7730e952d9..a3868d4931 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -392,7 +392,7 @@ void CatalogXml::Save( LoadingWindow *loading_window ) xml.AppendChild( "FooterText", FOOTER_TEXT ); xml.AppendChild( "FooterLink", FOOTER_LINK ); - xml.SaveToFile( fn, XMLDisplayOptions(CATALOG_XSL, false) ); + xml.SaveToFile( fn, CATALOG_XSL, false ); LOG->Trace( "Done." ); } diff --git a/stepmania/src/ExportStrings.cpp b/stepmania/src/ExportStrings.cpp index 913af5437d..443b4d619e 100644 --- a/stepmania/src/ExportStrings.cpp +++ b/stepmania/src/ExportStrings.cpp @@ -57,7 +57,7 @@ void ExportStrings::LuaInformation() XNode *pDateNode = pNode->AppendChild( "Date" ); pDateNode->m_sValue = DateTime::GetNowDate().GetString(); - pNode->SaveToFile( "Lua.xml", XMLDisplayOptions( "Lua.xsl") ); + pNode->SaveToFile( "Lua.xml", "Lua.xsl" ); delete pNode; } diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 7708922fd4..02e6f3ceff 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -940,7 +940,7 @@ bool Profile::SaveStatsXmlToDir( RString sDir, bool bSignData ) const // Save stats.xml RString fn = sDir + STATS_XML; - bool bSaved = xml->SaveToFile( fn, XMLDisplayOptions(STATS_XSL, false) ); + bool bSaved = xml->SaveToFile( fn, STATS_XSL, false ); SAFE_DELETE( xml ); diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index a12b031fbb..406ce4f15c 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -602,20 +602,20 @@ void XNode::AppendAttr( const RString &sName, float value ){ AppendAttr(sName,ss void XNode::AppendAttr( const RString &sName, int value ) { AppendAttr(sName,ssprintf("%d",value)); } void XNode::AppendAttr( const RString &sName, unsigned value ) { AppendAttr(sName,ssprintf("%u",value)); } -bool XNode::SaveToFile( RageFileBasic &f, const XMLDisplayOptions &opt ) const +bool XNode::SaveToFile( RageFileBasic &f, const RString &sStylesheet, bool bWriteTabs ) const { f.PutLine( "" ); - if( !opt.m_sStylesheet.empty() ) - f.PutLine( "" ); + if( !sStylesheet.empty() ) + f.PutLine( "" ); int iTabBase = 0; - if( !this->GetXMLInternal(f, opt.m_bWriteTabs, iTabBase) ) + if( !this->GetXMLInternal(f, bWriteTabs, iTabBase) ) return false; if( f.Flush() == -1 ) return false; return true; } -bool XNode::SaveToFile( const RString &sFile, const XMLDisplayOptions &opt ) const +bool XNode::SaveToFile( const RString &sFile, const RString &sStylesheet, bool bWriteTabs ) const { RageFile f; if( !f.Open(sFile, RageFile::WRITE) ) @@ -624,5 +624,5 @@ bool XNode::SaveToFile( const RString &sFile, const XMLDisplayOptions &opt ) con return false; } - return SaveToFile( f, opt ); + return SaveToFile( f, sStylesheet, bWriteTabs ); } diff --git a/stepmania/src/XmlFile.h b/stepmania/src/XmlFile.h index d1ceb51a8f..5e59a5fc7a 100644 --- a/stepmania/src/XmlFile.h +++ b/stepmania/src/XmlFile.h @@ -35,19 +35,6 @@ typedef multimap XNodes; Var##Iter != (pNode)->m_childs.end(); \ ++Var##Iter ) -// display optional environment -struct XMLDisplayOptions -{ - XMLDisplayOptions( const RString &sStylesheet = "", bool bWriteTabs = true ) - { - m_sStylesheet = sStylesheet; - m_bWriteTabs = bWriteTabs; - } - - RString m_sStylesheet; // empty string = no stylesheet - bool m_bWriteTabs; // if false, don't write tab indent characters -}; - // XMLNode structure class XNode { @@ -76,8 +63,8 @@ public: bool GetXML( RageFileBasic &f, bool bWriteTabs = true ) const; RString GetXML() const; - bool SaveToFile( const RString &sFile, const XMLDisplayOptions &opt = XMLDisplayOptions() ) const; - bool SaveToFile( RageFileBasic &f, const XMLDisplayOptions &opt = XMLDisplayOptions() ) const; + bool SaveToFile( const RString &sFile, const RString &sStylesheet = "", bool bWriteTabs = true ) const; + bool SaveToFile( RageFileBasic &f, const RString &sStylesheet = "", bool bWriteTabs = true ) const; // in own attribute list const RString *GetAttr( const RString &sAttrName ) const;