SqlCtrl: ValueMap SqlCtrls::Get, ArrayCtrl: map based Set/Add, fixed some warnings and obsolete pragmas removed

git-svn-id: svn://ultimatepp.org/upp/trunk@6316 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-09-05 12:14:09 +00:00
parent 5b209ad363
commit 376c8fcd08
26 changed files with 84 additions and 23 deletions

View file

@ -1892,6 +1892,34 @@ void ArrayCtrl::Add(const Vector<Value>& v)
Set(array.GetCount(), v);
}
void ArrayCtrl::Set(int ii, const VectorMap<String, Value>& m)
{
for(int i = 0; i < m.GetCount(); i++) {
int j = GetPos(m.GetKey(i));
if(j >= 0)
Set(ii, j, m[i]);
}
}
void ArrayCtrl::Set(int ii, const ValueMap& m)
{
for(int i = 0; i < m.GetCount(); i++) {
int j = GetPos((String)m.GetKey(i));
if(j >= 0)
Set(ii, j, m.GetValue(i));
}
}
void ArrayCtrl::Add(const VectorMap<String, Value>& m)
{
Set(array.GetCount(), m);
}
void ArrayCtrl::Add(const ValueMap& m)
{
Set(array.GetCount(), m);
}
struct ArrayCtrlSeparatorDisplay : Display {
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const {
int y = r.top + r.GetHeight() / 2;