[longomatch] Fix exception when start equals stop



commit 4924434a45e203ee4f26149a971cf448511be9f5
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Feb 8 01:07:26 2012 +0100

    Fix exception when start equals stop

 LongoMatch.Addins.COE/TimelineSheet.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Addins.COE/TimelineSheet.cs b/LongoMatch.Addins.COE/TimelineSheet.cs
index d566653..57a576f 100644
--- a/LongoMatch.Addins.COE/TimelineSheet.cs
+++ b/LongoMatch.Addins.COE/TimelineSheet.cs
@@ -118,7 +118,11 @@ public class TimelineSheet
 				stop = TIMELINE_START + unit.Stop.Seconds / (float) 60;
 				
 				ws.Cells[row, (int) start].Value = stop - start;
-				cols = ws.Cells[row, (int)start, row, (int)stop];
+				
+				if ((int)start == (int)stop)
+					cols = ws.Cells [row, (int) start];
+				else
+					cols = ws.Cells[row, (int)start, row, (int)stop];
 				cols.Style.Fill.PatternType =  ExcelFillStyle.Solid;	
 				cols.Style.Fill.BackgroundColor.SetColor(Color.Green);
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]