Home > Uncategorized > Ops…

Ops…

December 18th, 2009 Leave a comment Go to comments

I found this just now, in some formatting code:

if ((data.TotalPrice - data.TotalCost) < 0)
 {
 ApplyToCells(row, cell => cell.Style.ForeColor = Color.Red);
 }
 ApplyToCells(row, cell => cell.Style.ForeColor = Color.Black);

Problem is that it should have been

 if ((data.TotalPrice - data.TotalCost) < 0)
 {
 ApplyToCells(row, cell => cell.Style.ForeColor = Color.Red);
 }
 else
 {
 ApplyToCells( row, cell => cell.Style.ForeColor = Color.Black );
 }

This caused an infinate repainting loop, oh well. fixed now. Trouble is that no one tested the scenario when the row had negative.

Bookmark and Share
Tags:
  1. No comments yet.
  1. No trackbacks yet.