Better fix for previous bug
This commit is contained in:
parent
585ed0ce18
commit
ac96255b3c
|
@ -662,33 +662,33 @@ bool Database::LoadOperation(User* user, const wxString& id)
|
||||||
op.formula = set.GetAsString(wxT("formula"));
|
op.formula = set.GetAsString(wxT("formula"));
|
||||||
op.meta = set.GetBool(wxT("meta"));
|
op.meta = set.GetBool(wxT("meta"));
|
||||||
|
|
||||||
if (!user->_operations[op.year])
|
if (user->_operations[op.year])
|
||||||
user->_operations[op.year] = new std::map<unsigned int, std::vector<Operation> >();
|
|
||||||
|
|
||||||
for (it = (*user->_operations[op.year])[op.month].begin();
|
|
||||||
it != (*user->_operations[op.year])[op.month].end();
|
|
||||||
it++)
|
|
||||||
{
|
{
|
||||||
if (!op.fix_cost && it->fix_cost) continue;
|
for (it = (*user->_operations[op.year])[op.month].begin();
|
||||||
if (op.fix_cost && !it->fix_cost)
|
it != (*user->_operations[op.year])[op.month].end();
|
||||||
|
it++)
|
||||||
{
|
{
|
||||||
it--;
|
if (!op.fix_cost && it->fix_cost) continue;
|
||||||
break;
|
if (op.fix_cost && !it->fix_cost)
|
||||||
}
|
{
|
||||||
if (it->day > op.day)
|
it--;
|
||||||
{
|
break;
|
||||||
it--;
|
}
|
||||||
break;
|
if (it->day > op.day)
|
||||||
|
{
|
||||||
|
it--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (it == (*user->_operations[op.year])[op.month].end())
|
||||||
|
(*user->_operations[op.year])[op.month].push_back(op);
|
||||||
|
else
|
||||||
|
(*user->_operations[op.year])[op.month].insert(it, op);
|
||||||
|
// if (op.fix_cost)
|
||||||
|
// else
|
||||||
|
// (*user->_operations[op.year])[op.month].push_back(op);
|
||||||
|
ret = true;
|
||||||
}
|
}
|
||||||
if (it == (*user->_operations[op.year])[op.month].end())
|
|
||||||
(*user->_operations[op.year])[op.month].push_back(op);
|
|
||||||
else
|
|
||||||
(*user->_operations[op.year])[op.month].insert(it, op);
|
|
||||||
// if (op.fix_cost)
|
|
||||||
// else
|
|
||||||
// (*user->_operations[op.year])[op.month].push_back(op);
|
|
||||||
ret = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set.Finalize();
|
set.Finalize();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user