git-svn-id: svn://db.shs.com.ru/libs@109 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-08-01 11:32:44 +00:00
parent 508506a112
commit 71cfb447ce

View File

@@ -103,6 +103,7 @@ void KSection::read(const void * ep) {
void KSection::update(KSection & v, bool keep_names) {
PIMap<PIString, PIString> vk_ids;
PISet<int> used;
PIMap<int, KType>::iterator i;
for (i = v.k.begin(); i != v.k.end(); ++i)
vk_ids[i.value().name()] = i.value().formula();
@@ -113,13 +114,25 @@ void KSection::update(KSection & v, bool keep_names) {
continue;
}
}
if (v.k.contains(i.key()))
if (v.k.contains(i.key())) {
k[i.key()].formula_ = v.k[i.key()].formula_;
used << i.key();
}
}
for (i = v.k.begin(); i != v.k.end(); ++i) {
if (!used.contains(i.key()))
k[i.key()] = i.value();
}
used.clear();
PIMap<int, KSection>::iterator j;
for (j = s.begin(); j != s.end(); ++j) {
if (v.s.contains(j.key()))
j.value().update(v.s[j.key()], keep_names);
used << j.key();
}
for (j = v.s.begin(); j != v.s.end(); ++j) {
if (!used.contains(j.key()))
s[j.key()] = j.value();
}
}