OSDN Git Service

100レス表示で、先頭表示レス数を設定できるように変更。
[gikonavigoeson/gikonavi.git] / HTMLCreate.pas
index ff690d9..2917c2e 100644 (file)
@@ -67,7 +67,7 @@ type
              dat : boolean;    var s : String) : string;
         function getNumberString(const str: String;var index :Integer; var dbCharlen: Boolean;
              sLen :Integer): String;
-
+        function isOutsideRange(item: TThreadItem; index: Integer ): Boolean;
        public
                { Public \90é\8c¾ }
                procedure AddAnchorTag(PRes: PResRec);
@@ -637,7 +637,6 @@ begin
        PRes.FBody := PRes.FBody + res;
 
 end;
-
 //Plugin\82ð\97\98\97p\82·\82éBoard\82Ì\83X\83\8c\83b\83h\82ÌHTML\82ð\8dì\90¬\82µ\82Ädoc\82É\8f\91\82«\8d\9e\82Þ
 procedure THTMLCreate.CreateUsePluginHTML(html:TBufferedWebBrowser; ThreadItem: TThreadItem; var sTitle: string);
 var
@@ -660,17 +659,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                // \90V\92\85\83}\81[\83N
@@ -765,17 +756,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                // \90V\92\85\83}\81[\83N
@@ -862,18 +845,10 @@ begin
                for i := 0 to ReadList.Count - 1 do begin
                        // 1 \82Í\95K\82¸\95\\8e¦
                        if i <> 0 then begin
-                               // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                               case GikoSys.ResRange of
-                               Ord( grrKoko ):
-                                       if ThreadItem.Kokomade > (i + 1) then
-                                               Continue;
-                               Ord( grrNew ):
-                                       if NewReceiveNo > (i + 1) then
-                                               Continue;
-                               10..65535:
-                                       if (threadItem.Count - i) > GikoSys.ResRange then
-                                               Continue;
-                               end;
+                       // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
+                if (isOutsideRange(ThreadItem, i)) then begin
+                    Continue;
+                end;
                        end;
 
                        if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
@@ -932,17 +907,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
@@ -1617,6 +1584,31 @@ begin
        Result := Result + '</BODY></HTML>';
 
 end;
+{
+\brief  \95\\8e¦\94Í\88Í\8aO\83\8c\83X\94Ô\8d\86\94»\92è\8f\88\97\9d
+\param  item    \95\\8e¦\83X\83\8c\83b\83h
+\param  index   \83\8c\83X\94Ô\8d\86
+\return ture:\95\\8e¦\94Í\88Í\8aO false:\95\\8e¦\94Í\88Í\93à
+}
+function THTMLCreate.isOutsideRange( item: TThreadItem; index: Integer ): Boolean;
+begin
+    Result := False;
+    // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
+    case GikoSys.ResRange of
+    Ord( grrKoko ):
+        if item.Kokomade > (index + 1) then
+            Result := True;
+    Ord( grrNew ):
+        if item.NewReceive > (index + 1) then
+            Result := True;
+    10..65535:
+        if (GikoSys.Setting.HeadResCount) < (index + 1)  then begin
+            if (item.Count - index) > GikoSys.ResRange then begin
+                Result := True;
+            end;
+        end;
+    end;
+end;
 constructor TBufferedWebBrowser.Create(Browser: TWebBrowser; BuffSize: Integer);
 begin
        inherited Create;