Fix a lot of bugs :
* Missing center in PreferencesPanel for categories suppression * Previous not checked operations needs to be inverted (positive if negative, and negative if positive) * New operation needs to be sorted before insertion in InsertIntoGrid (GridAccount.cpp)
This commit is contained in:
@@ -440,7 +440,7 @@ void GridAccount::DeleteOperation(const Operation& op)
|
||||
|
||||
void GridAccount::InsertIntoGrid(Operation& op)
|
||||
{
|
||||
int i;
|
||||
int i, a;
|
||||
User* user = _kiss->GetUser();
|
||||
|
||||
for(i=0; i<(int)_displayedOperations.size(); i++)
|
||||
@@ -468,9 +468,24 @@ void GridAccount::InsertIntoGrid(Operation& op)
|
||||
else if (!(_displayedOperations)[i].fix_cost && op.fix_cost)
|
||||
i --;
|
||||
|
||||
_operations->push_back(op);
|
||||
for (a=0; a<(int)_operations->size(); a++)
|
||||
{
|
||||
if ((*_operations)[a].fix_cost && !op.fix_cost) continue;
|
||||
if (!(*_operations)[a].fix_cost && op.fix_cost)
|
||||
{
|
||||
a--;
|
||||
break;
|
||||
}
|
||||
if ((*_operations)[a].day > op.day)
|
||||
{
|
||||
a--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_operations->insert(_operations->begin()+a, op);
|
||||
|
||||
InsertOperationWithWeek(user, (*_operations)[_operations->size()-1], i, op.fix_cost, _curMonth, _curYear);
|
||||
InsertOperationWithWeek(user, (*_operations)[a], i, op.fix_cost, _curMonth, _curYear);
|
||||
}
|
||||
|
||||
void GridAccount::RemoveMeta(Operation& op, int line, bool removeRoot, bool deleteOp)
|
||||
@@ -1234,6 +1249,8 @@ void GridAccount::Group()
|
||||
UpdateMeta(op);
|
||||
|
||||
InsertIntoGrid(op);
|
||||
|
||||
UpdateOperation(op);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user