From 58ce6c2bb736d4e096bbeca624fd292fc858c8b0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 12 Mar 2011 20:23:56 +0000 Subject: [PATCH] a better fix fpr that wierd XMLProperty botch git-svn-id: svn://localhost/ardour2/branches/3.0@9128 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/export_preset.h | 2 +- libs/ardour/export_preset.cc | 2 +- libs/pbd/xml++.cc | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/export_preset.h b/libs/ardour/ardour/export_preset.h index 595cfaf9bf..b24cc70dcf 100644 --- a/libs/ardour/ardour/export_preset.h +++ b/libs/ardour/ardour/export_preset.h @@ -53,7 +53,7 @@ class ExportPreset { private: - void set_id (std::string id); + void set_id (std::string const & id); XMLNode * get_instant_xml () const; void save_instant_xml () const; diff --git a/libs/ardour/export_preset.cc b/libs/ardour/export_preset.cc index e26f4175f4..eb405a5bd8 100644 --- a/libs/ardour/export_preset.cc +++ b/libs/ardour/export_preset.cc @@ -66,7 +66,7 @@ ExportPreset::set_name (string const & name) } void -ExportPreset::set_id (string id) +ExportPreset::set_id (string const & id) { _id = id; diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index dbed9d1917..dc27b8b1a5 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -377,8 +377,11 @@ XMLProperty* XMLNode::add_property(const char* n, const string& v) { string ns(n); - if (_propmap.find(ns) != _propmap.end()) { - remove_property(ns); + map::iterator iter; + + if ((iter = _propmap.find(ns)) != _propmap.end()) { + iter->second->set_value (v); + return iter->second; } XMLProperty* tmp = new XMLProperty(ns, v);