Bug in previous patch ...

This commit is contained in:
Grégory Soutadé 2010-12-04 10:43:40 +01:00
parent b0ecbe7b89
commit 80ef4f640a

View File

@ -705,6 +705,11 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
if (value.Length())
{
value.ToDouble(&new_op.amount);
if (new_op.amount < 0)
{
new_op.amount *= -1.0;
SetCellValue(row, DEBIT, wxString::Format(wxT("%.2lf"), new_op.amount));
}
if (new_op.amount != 0.0) new_op.amount *= -1.0;
op_complete--;
wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, DEBIT);
@ -712,17 +717,21 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
pEditor->DecRef();
}
value = GetCellValue(row, CREDIT);
value = GetCellValue(row, CREDIT);
if (value.Length())
{
value.ToDouble(&new_op.amount);
if (new_op.amount < 0)
{
new_op.amount *= -1.0;
SetCellValue(row, CREDIT, wxString::Format(wxT("%.2lf"), new_op.amount));
}
op_complete--;
wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, CREDIT);
new_op.formula = pEditor->GetFormula();
pEditor->DecRef();
}
if (new_op.amount < 0) new_op.amount *= -1;
value = GetCellValue(row, CATEGORY);
if (value.Length())