OSDN Git Service

This commit was manufactured by cvs2svn to create branch 'Bb62'.
[gikonavigoeson/gikonavi.git] / ListViewUtils.pas
index dfe415c..59612e8 100644 (file)
@@ -572,7 +572,7 @@ begin
                        BoardCnt := 0;
        end;
 
-       if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
+       if (BoardCnt <= 0) or (Item = nil) or (Item.Index >= BoardCnt)
                or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;
 
        //\89ü\91P\82·\82×\82«\83u\83\8d\83b\83N/////////////////////////////////////////////////////
@@ -673,17 +673,20 @@ begin
                                Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.LastModified);
                gbcVigor:
                        begin
-                               if (Thread.AgeSage <> gasArch) then begin
-                                       spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
-                               end else begin
-                                       spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
-                               end;
-                               if (spanday > 0) then begin
-                                       Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+                               if (Thread.CreateDate <> ZERO_DATE)  then begin
+                                       if (Thread.AgeSage <> gasArch) then begin
+                                               spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
+                                       end else begin
+                                               spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
+                                       end;
+                                       if (spanday > 0) then begin
+                                               Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+                                       end else begin
+                                               Item.SubItems[ idx ] := '';
+                                       end;
                                end else begin
                                        Item.SubItems[ idx ] := '';
                                end;
-
                        end;
                end;
                Inc( idx );
@@ -719,18 +722,21 @@ begin
                        Item.SubItems[ idx ] := '';
                gbcVigor:
                        begin
-                               if (Thread.AgeSage <> gasArch) then begin
-                                       spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
-                               end else begin
-                                       spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
-                               end;
+                               if (Thread.CreateDate <> ZERO_DATE)  then begin
+                                       if (Thread.AgeSage <> gasArch) then begin
+                                               spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
+                                       end else begin
+                                               spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
+                                       end;
 
-                               if (spanday > 0) then begin
-                                       Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+                                       if (spanday > 0) then begin
+                                               Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+                                       end else begin
+                                               Item.SubItems[ idx ] := '';
+                                       end;
                                end else begin
                                        Item.SubItems[ idx ] := '';
                                end;
-
                        end;
                else
                        Item.SubItems[ idx ] := '';