From 293e426ed4b5e3c15bd5fb6ef9ac9b77f487a730 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 1 Feb 2013 21:14:56 +0000 Subject: [PATCH] fixed: plugin 'group' Groups::ReindexGroups incorrectly read a field from a PT::Space (it used 'table' object directly) but the value was in 'table_single' now we are using GetValue method git-svn-id: svn://ttmath.org/publicrep/winix/trunk@916 e52654a7-88a9-db11-a3e9-0013d4bc506e --- plugins/group/groups.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/group/groups.cpp b/plugins/group/groups.cpp index d99d3d7..b61e737 100755 --- a/plugins/group/groups.cpp +++ b/plugins/group/groups.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2011-2012, Tomasz Sowa + * Copyright (c) 2011-2013, Tomasz Sowa * All rights reserved. * */ @@ -63,27 +63,31 @@ size_t i, v; // loop through all values in the group for(v=0 ; vtable.find(key); + std::wstring * vali = group.spaces[v]->GetValue(key); - if( vali != group.spaces[v]->table.end() && vali->second.size() == 1 ) + if( vali ) { - GroupIndex::iterator g = group_index.find(vali->second[0]); + GroupIndex::iterator g = group_index.find(*vali); if( g == group_index.end() ) { - group_index[vali->second[0]] = i; + group_index[*vali] = i; v += 1; } else { slog << logwarning << "set: " << set.name << " has a group with a duplicated value: " - << vali->second[0] << " (skipping)" << logend; + << *vali << " (skipping)" << logend; + group.spaces.erase(group.spaces.begin() + v); } } else { - slog << logwarning << "set: " << set.name << " has a group without a value (skipping)" << logend; + log << log1 << "key: " << key << " was not found" << logend; + slog << logwarning << "set: " << set.name + << " has a group without a value (skipping)" << logend; + group.spaces.erase(group.spaces.begin() + v); } }