OSDN Git Service

・「2ちゃんねる」キャビネットで BBS を選択したときに右上ペインにゴミ項目が表示されていたのを修正。
authoryoffy <yoffy>
Wed, 19 Nov 2003 20:17:45 +0000 (20:17 +0000)
committeryoffy <yoffy>
Wed, 19 Nov 2003 20:17:45 +0000 (20:17 +0000)
Giko.pas

index 15c5728..876d28a 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -1038,6 +1038,8 @@ const
        TOOL_ICON_FAV_THREAD            = 32;           //\82¨\8bC\82É\93ü\82è\83X\83\8c\83A\83C\83R\83\93
 
        HTML_FILE_NAME  = 'temp_preview.html';
+       BBS_NAME_SIGNATURE = #$1B;                      // \83J\83e\83S\83\8a\82Ì\96¼\91O\82ð BBS \82Ì\96¼\91O\82Æ\82µ\82Ä\8e¯\95Ê\82·\82é\83V\83O\83l\83`\83\83
+                                                                                                                               // \90â\91Î\82É\83J\83e\83S\83\8a\96¼\82Æ\82µ\82Ä\82 \82è\93¾\82È\82¢\8bL\8d\86\82ð\8eg\82¤
 
 {$R *.DFM}
 
@@ -1816,8 +1818,6 @@ var
        BoardNode: TTreeNode;
        Category: TCategory;
        Board: TBoard;
-const
-       BBS_NAME_SIGNATURE = #$1B;      // \90â\91Î\82É\94Â\96¼\82Æ\82µ\82Ä\82 \82è\93¾\82È\82¢\8bL\8d\86\82ð\8eg\82¤
 begin
        // \94Â\83\8a\83X\83g\82Ì\90Ý\92è
        // \81¦\96{\93\96\82Í TBBS2ch \82ð\8cf\8e¦\94Â\82Ì\90\94\82¾\82¯\90\90¬\82·\82é\82×\82«\82¾\82ª
@@ -2073,10 +2073,26 @@ var
        Board: TBoard;
        ThreadItem: TThreadItem;
        RepStr: string;
+       i, b, index : Integer;
 begin
        if ActiveList is TBBS2ch then begin
                BBS := TBBS2ch(ActiveList);
 
+               // BBS \96¼\82Í\83J\83e\83S\83\8a\82Æ\82µ\82Ä\95`\89æ\82µ\82È\82¢\82Ì\82Å\94ò\82Î\82·
+               i                       := -1;
+               b                       := BBS.Count - 1;
+               index   := -1;
+               while (i < Item.Index) and (index < b) do begin
+                       Inc( index );
+
+                       if LeftStr( BBS.Items[ index ].Title, 1 ) <> BBS_NAME_SIGNATURE then
+                               Inc( i );
+               end;
+               if i < Item.Index then begin
+                       ListView.Items.Count := i + 1;
+                       Exit;
+               end;
+
                ListView.StateImages := nil;
 
                if BBS = nil then Exit;
@@ -2085,8 +2101,8 @@ begin
                if Item.Index > BBS.Count then Exit;
                if ListView.Items.Count = 0 then Exit;
 
-               if not (BBS.Items[Item.Index] is TCategory) then Exit;
-               Category := TCategory(BBS.Items[Item.Index]);
+               if not (BBS.Items[index] is TCategory) then Exit;
+               Category := TCategory(BBS.Items[index]);
 
                if Category = nil then Exit;