diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index bd089059bc..d0e68c7965 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -284,7 +284,7 @@ static void MergeIniUnder( XNode *pFrom, XNode *pTo ) FOREACHM( RString, XNodeValue *, pSectionNode->m_attrs, it2 ) { /* Don't overwrite existing nodes. */ - pChildNode->AppendAttr( it2->first, it2->second->Copy(), false ); + pChildNode->AppendAttrFrom( it2->first, it2->second->Copy(), false ); } } diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 1b4c41e603..c105f52d82 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -30,7 +30,7 @@ XNode::XNode( const XNode &cpy ): { m_pValue = cpy.m_pValue->Copy(); FOREACH_CONST_Attr( &cpy, pAttr ) - this->AppendAttr( pAttr->first, pAttr->second->Copy() ); + this->AppendAttrFrom( pAttr->first, pAttr->second->Copy() ); FOREACH_CONST_Child( &cpy, c ) this->AppendChild( new XNode(*c) ); } @@ -179,7 +179,7 @@ bool XNode::RemoveAttr( const RString &sName ) /* If bOverwrite is true and a node already exists with that name, the old value will be deleted. * If bOverwrite is false and a node already exists with that name, the new value will be deleted. */ -XNodeValue *XNode::AppendAttr( const RString &sName, XNodeValue *pValue, bool bOverwrite ) +XNodeValue *XNode::AppendAttrFrom( const RString &sName, XNodeValue *pValue, bool bOverwrite ) { DEBUG_ASSERT( sName.size() ); pair ret = m_attrs.insert( make_pair(sName, (XNodeValue *) NULL) ); diff --git a/stepmania/src/XmlFile.h b/stepmania/src/XmlFile.h index c982b13fe6..3481f0606c 100644 --- a/stepmania/src/XmlFile.h +++ b/stepmania/src/XmlFile.h @@ -93,6 +93,7 @@ public: const RString &GetName() const { return m_sName; } RString GetValue() const { return m_pValue->GetValue(); } + void SetValueFrom( XNodeValue *pValue ) { delete m_pValue; m_pValue = pValue; } template void GetValue( T &out ) const { m_pValue->GetValue(out); } template @@ -119,7 +120,7 @@ public: XNode *AppendChild( XNode *node ); bool RemoveChild( XNode *node, bool bDelete = true ); - XNodeValue *AppendAttr( const RString &sName, XNodeValue *pValue, bool bOverwrite = true ); + XNodeValue *AppendAttrFrom( const RString &sName, XNodeValue *pValue, bool bOverwrite = true ); XNodeValue *AppendAttr( const RString &sName ); template XNodeValue *AppendAttr( const RString &sName, T value ) { XNodeValue *pVal = AppendAttr( sName ); pVal->SetValue( value ); return pVal; }