Normalize XML property name style, preserving old session loading (on load _ will...
[ardour.git] / libs / pbd / xml++.cc
index 9643b5d3a831a905600a5f555d3b908b3c7759f0..a42923132bc3042eef8d12fef9a5f32e04dc56a1 100644 (file)
@@ -475,6 +475,12 @@ XMLProperty::XMLProperty(const string &n, const string &v)
        : _name(n), 
        _value(v) 
 { 
+       // Normalize property name (replace '_' with '-' as old session are inconsistent)
+       for (size_t i = 0; i < _name.length(); ++i) {
+               if (_name[i] == '_') {
+                       _name[i] = '-';
+               }
+       }
 }
 
 XMLProperty::~XMLProperty()