• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision8fb597d13cdad42f021017653d7c60ba8939e37b (tree)
Time2008-05-10 23:05:32
Authorh677 <h677>
Commiterh677

Log Message

IDポップアップの処理見直し
件数取得を廃止

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -6771,11 +6771,9 @@ var
67716771 doc : IHTMLDocument2;
67726772 FOleInPlaceActiveObject: IOleInPlaceActiveObject;
67736773 p : TPoint;
6774- AID: string;
6775- stlist : TStringList;
6776- i, count: Integer;
6777- body : String;
6778- limited : Integer;
6774+ AID, body: string;
6775+ stlist, numbers : TStringList;
6776+ i, limited : Integer;
67796777 begin
67806778 result := true;
67816779 if not Assigned(FActiveContent) then
@@ -6823,22 +6821,26 @@ begin
68236821 stList.Free;
68246822 end;
68256823 end;
6826-
6827- count := GikoSys.GetSameIDResCount(AID, FActiveContent.Thread);
6828- limited := LIMIT;
6829- if not (GikoSys.Setting.LimitResCountMessage) then begin
6830- limited := -1;
6831- end else if (count > LIMIT) then begin
6832- if (GikoUtil.MsgBox(Handle,
6833- IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H',
6834- 'IDƒ|ƒbƒvƒAƒbƒvŒx',
6835- MB_YESNO or MB_ICONQUESTION) = ID_YES) then begin
6836- limited := -1;
6837- end
6838- end;
6839-
6840- body := GikoSys.GetSameIDResAnchor(AID, FActiveContent.Thread, limited);
6841- FActiveContent.IDAnchorPopup(body);
6824+ numbers := TStringList.Create;
6825+ try
6826+
6827+ GikoSys.GetSameIDRes(AID, FActiveContent.Thread, numbers);
6828+ limited := LIMIT;
6829+ if not (GikoSys.Setting.LimitResCountMessage) then begin
6830+ limited := -1;
6831+ end else if (numbers.Count > LIMIT) then begin
6832+ if (GikoUtil.MsgBox(Handle,
6833+ IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H',
6834+ 'IDƒ|ƒbƒvƒAƒbƒvŒx',
6835+ MB_YESNO or MB_ICONQUESTION) = ID_YES) then begin
6836+ limited := -1;
6837+ end
6838+ end;
6839+ body := GikoSys.CreateSameIDResAnchor(numbers, FActiveContent.Thread, limited);
6840+ FActiveContent.IDAnchorPopup(body);
6841+ finally
6842+ numbers.Free;
6843+ end;
68426844 end;
68436845 except
68446846 end;
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -2404,28 +2404,34 @@ const
24042404 LIMIT = 20;
24052405 var
24062406 ThreadItem : TThreadItem;
2407- No, count: Integer;
2407+ No : Integer;
24082408 body : string;
24092409 limited: Integer;
2410+ numbers : TStringList;
24102411 begin
24112412 No := GikoForm.KokoPopupMenu.Tag;
24122413 if No = 0 then Exit;
24132414 ThreadItem := GikoForm.GetActiveContent(True);
24142415 if ThreadItem = nil then Exit;
2415- count := GikoSys.GetSameIDResCount(No, GikoForm.ActiveContent.Thread);
2416- limited := LIMIT;
2417- if not (GikoSys.Setting.LimitResCountMessage) then begin
2418- limited := -1;
2419- end else if count > LIMIT then begin
2420- if ( GikoUtil.MsgBox(GikoForm.Handle,
2421- IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H',
2422- 'IDƒ|ƒbƒvƒAƒbƒvŒx',
2423- MB_YESNO or MB_ICONQUESTION) = ID_YES ) then begin
2416+ numbers := TStringList.Create;
2417+ try
2418+ GikoSys.GetSameIDRes(No, GikoForm.ActiveContent.Thread, numbers);
2419+ limited := LIMIT;
2420+ if not (GikoSys.Setting.LimitResCountMessage) then begin
24242421 limited := -1;
2422+ end else if numbers.Count > LIMIT then begin
2423+ if ( GikoUtil.MsgBox(GikoForm.Handle,
2424+ IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H',
2425+ 'IDƒ|ƒbƒvƒAƒbƒvŒx',
2426+ MB_YESNO or MB_ICONQUESTION) = ID_YES ) then begin
2427+ limited := -1;
2428+ end;
24252429 end;
2426- end;
2427- body := GikoSys.GetSameIDResAnchor(No, ThreadItem, limited);
2428- GikoForm.ActiveContent.IDAnchorPopup(body);
2430+ body := GikoSys.CreateSameIDResAnchor(numbers, ThreadItem, limited);
2431+ GikoForm.ActiveContent.IDAnchorPopup(body);
2432+ finally
2433+ numbers.Free;
2434+ end;
24292435 end;
24302436 // *************************************************************************
24312437 //! ‚±‚̃ŒƒX‚ ‚ځ`‚ñ@i’ʏíj
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -213,12 +213,9 @@ type
213213 procedure GetPopupResNumber(URL : string; var stRes, endRes : Int64);
214214
215215 property Bayesian : TGikoBayesian read FBayesian write FBayesian;
216- function GetSameIDResAnchor(const AID : string; ThreadItem: TThreadItem; limited: Integer):string; overload;
217- function GetSameIDResAnchor(AIDNum : Integer; ThreadItem: TThreadItem; limited: Integer):string; overload;
216+ function CreateSameIDResAnchor(var Numbers: TStringList; ThreadItem: TThreadItem; limited: Integer):string;
218217 procedure GetSameIDRes(const AID : string; ThreadItem: TThreadItem;var body: TStringList); overload;
219218 procedure GetSameIDRes(AIDNum : Integer; ThreadItem: TThreadItem;var body: TStringList); overload;
220- function GetSameIDResCount(const AID : string; ThreadItem: TThreadItem):Integer; overload;
221- function GetSameIDResCount(AIDNum : Integer; ThreadItem: TThreadItem):Integer; overload;
222219 function GetResID(AIDNum: Integer; ThreadItem: TThreadItem): String;
223220 //! ’PŒê‰ðÍ
224221 procedure SpamCountWord( const text : string; wordCount : TWordCount );
@@ -2751,20 +2748,18 @@ function TGikoSys.GetSambaFileName : string;
27512748 begin
27522749 Result := Setting.GetSambaFileName;
27532750 end;
2754-
27552751 {!
2756-\brief “¯‚¶“Še ID ‚ðŽ‚ÂƒŒƒX‚ðƒAƒ“ƒJ[‚É‚µ‚Ä—ñ‹“
2757-\param AID ŒÂl‚ð“Á’è‚·‚é“Še ID
2752+\brief —ñ‹“‚³‚ꂽƒŒƒX”ԍ†‚ւ̃Aƒ“ƒJ[—pHTMLì¬
2753+\param Numbers —ñ‹“‚³‚ꂽƒŒƒX”ԍ†
27582754 \param ThreadItem —ñ‹“‚·‚éƒXƒŒƒbƒh
27592755 \param limited —ñ‹“‚·‚鐔‚𐧌À‚·‚é‚È‚ç1ˆÈã
27602756 \return —ñ‹“‚³‚ꂽƒŒƒXƒAƒ“ƒJ[
27612757 }
2762-function TGikoSys.GetSameIDResAnchor(
2763- const AID : string; ThreadItem: TThreadItem;
2758+function TGikoSys.CreateSameIDResAnchor(
2759+ var Numbers: TStringList; ThreadItem: TThreadItem;
27642760 limited: Integer):string;
27652761 var
27662762 i: integer;
2767- body: TStringList;
27682763 Res: TResRec;
27692764 ResLink : TResLinkRec;
27702765 begin
@@ -2772,29 +2767,22 @@ begin
27722767 Res.FBody := '';
27732768 Res.FType := glt2chNew;
27742769
2775- Result := '';
2776- if (not IsNoValidID(AID)) and
2777- (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
2778- body := TStringList.Create;
2779- try
2780- GetSameIDRes(AID, ThreadItem, body);
2781- if (limited > 0) and (body.Count > limited) then begin
2782- for i := body.Count - limited to body.Count - 1 do begin
2783- Res.FBody := Res.FBody + '&gt;' + body[i] + ' ';
2784- end;
2785- end else begin
2786- for i := 0 to body.Count - 1 do begin
2787- Res.FBody := Res.FBody + '&gt;' + body[i] + ' ';
2788- end;
2789- end;
2790- finally
2791- body.Free;
2792- end;
2770+ Result := '';
2771+ if (Numbers <> nil) and (Numbers.Count > 0) then begin
2772+ if (limited > 0) and (Numbers.Count > limited) then begin
2773+ for i := Numbers.Count - limited to Numbers.Count - 1 do begin
2774+ Res.FBody := Res.FBody + '&gt;' + Numbers[i] + ' ';
2775+ end;
2776+ end else begin
2777+ for i := 0 to Numbers.Count - 1 do begin
2778+ Res.FBody := Res.FBody + '&gt;' + Numbers[i] + ' ';
2779+ end;
2780+ end;
27932781 ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
27942782 ResLink.FKey := ChangeFileExt(ThreadItem.FileName, '');
27952783 HTMLCreater.ConvRes(@Res, @ResLink, false);
27962784 Result := Res.FBody;
2797- end;
2785+ end;
27982786 end;
27992787
28002788 {!
@@ -2809,6 +2797,22 @@ var
28092797 ReadList: TStringList;
28102798 Res: TResRec;
28112799 boardPlugIn : TBoardPlugIn;
2800+
2801+ procedure CheckSameID(const AID:String; const Target: String; no: Integer);
2802+ var
2803+ pos: Integer;
2804+ begin
2805+ pos := AnsiPos('id:', LowerCase(Target));
2806+ if (pos > 0) then begin
2807+ if(AnsiPos(AID, Copy(Target, pos-1, Length(Target))) > 0) then begin
2808+ body.Add(IntToStr(no));
2809+ end;
2810+ end else begin
2811+ if(AnsiPos(AID, Target) > 0) then begin
2812+ body.Add(IntToStr(no));
2813+ end;
2814+ end;
2815+ end;
28122816 begin
28132817 if (not IsNoValidID(AID)) and
28142818 (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
@@ -2821,9 +2825,7 @@ begin
28212825 for i := 0 to threadItem.Count - 1 do begin
28222826 // ƒŒƒX
28232827 THTMLCreate.DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), i + 1), @Res);
2824- if(AnsiPos(AID, Res.FDateTime) > 0) then begin
2825- body.Add(IntToStr(i+1));
2826- end;
2828+ CheckSameID(AID, Res.FDateTime, i+1);
28272829 end;
28282830 end else begin
28292831 ReadList := TStringList.Create;
@@ -2831,9 +2833,7 @@ begin
28312833 ReadList.LoadFromFile(ThreadItem.GetThreadFileName);
28322834 for i := 0 to ReadList.Count - 1 do begin
28332835 THTMLCreate.DivideStrLine(ReadList[i], @Res);
2834- if AnsiPos(AID, Res.FDateTime) > 0 then begin
2835- body.Add(IntToStr(i+1));
2836- end;
2836+ CheckSameID(AID, Res.FDateTime, i+1);
28372837 end;
28382838 finally
28392839 ReadList.Free;
@@ -2846,50 +2846,6 @@ end;
28462846 \brief “¯‚¶“Še ID ‚ðŽ‚ÂƒŒƒX‚ð—ñ‹“
28472847 \param AIDNum ŒÂl‚ð“Á’è‚·‚é“Še ID
28482848 \param ThreadItem —ñ‹“‚·‚éƒXƒŒƒbƒh
2849-\param limited —ñ‹“‚·‚鐔‚𐧌À‚·‚é‚È‚ç1ˆÈã
2850-\return
2851-}
2852-function TGikoSys.GetSameIDResAnchor(AIDNum : Integer;
2853- ThreadItem: TThreadItem;
2854- limited: Integer):string;
2855-var
2856- i: integer;
2857- body: TStringList;
2858- Res: TResRec;
2859- ResLink : TResLinkRec;
2860-begin
2861- // bodyˆÈŠO‚ÍŽg—p‚µ‚È‚¢‚̂ŏ‰Šú‰»‚µ‚È‚¢
2862- Res.FBody := '';
2863- Res.FType := glt2chNew;
2864-
2865- Result := '';
2866- if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
2867- body := TStringList.Create;
2868- try
2869- GetSameIDRes(AIDNum, ThreadItem, body);
2870- if (limited > 0) and ( body.Count > limited) then begin
2871- for i := body.Count - 20 to body.Count - 1 do begin
2872- Res.FBody := Res.FBody + '&gt;' + body[i] + ' ';
2873- end;
2874- end else begin
2875- for i := 0 to body.Count - 1 do begin
2876- Res.FBody := Res.FBody + '&gt;' + body[i] + ' ';
2877- end;
2878- end;
2879- finally
2880- body.Free;
2881- end;
2882- ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
2883- ResLink.FKey := ChangeFileExt(ThreadItem.FileName, '');
2884- HTMLCreater.ConvRes(@Res, @ResLink, false);
2885- Result := Res.FBody;
2886- end;
2887-end;
2888-
2889-{!
2890-\brief “¯‚¶“Še ID ‚ðŽ‚ÂƒŒƒX‚ð—ñ‹“
2891-\param AIDNum ŒÂl‚ð“Á’è‚·‚é“Še ID
2892-\param ThreadItem —ñ‹“‚·‚éƒXƒŒƒbƒh
28932849 \param body OUT:—ñ‹“‚³‚ꂽƒŒƒX”ԍ†‚ª•Ô‚é
28942850 }
28952851 procedure TGikoSys.GetSameIDRes(AIDNum : Integer; ThreadItem: TThreadItem;var body: TStringList);
@@ -2950,51 +2906,6 @@ begin
29502906 end;
29512907 end;
29522908 end;
2953-{!
2954-\brief “¯‚¶“Še ID ‚ðŽ‚ÂƒŒƒX‚ðƒJƒEƒ“ƒg
2955-\param AID ŒÂl‚ð“Á’è‚·‚é“Še ID
2956-\param ThreadItem —ñ‹“‚·‚éƒXƒŒƒbƒh
2957-\return “¯‚¶ ID ‚ðŽ‚ÂƒŒƒX‚̐”
2958-}
2959-function TGikoSys.GetSameIDResCount(const AID : string; ThreadItem: TThreadItem):Integer;
2960-var
2961- body: TStringList;
2962-begin
2963- Result := 0;
2964- if (not IsNoValidID(AID))
2965- and (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
2966- body := TStringList.Create;
2967- try
2968- GetSameIDRes(AID, ThreadItem, body);
2969- Result := body.Count;
2970- finally
2971- body.Free;
2972- end;
2973- end;
2974-
2975-end;
2976-
2977-{!
2978-\brief “¯‚¶“Še ID ‚ðŽ‚ÂƒŒƒX‚ðƒJƒEƒ“ƒg
2979-\param AIDNum ŒÂl‚ð“Á’è‚·‚é“Še ID
2980-\param ThreadItem —ñ‹“‚·‚éƒXƒŒƒbƒh
2981-\return “¯‚¶ ID ‚ðŽ‚ÂƒŒƒX‚̐”
2982-}
2983-function TGikoSys.GetSameIDResCount(AIDNum : Integer; ThreadItem: TThreadItem):Integer;
2984-var
2985- body: TStringList;
2986-begin
2987- Result := 0;
2988- if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin
2989- body := TStringList.Create;
2990- try
2991- GetSameIDRes(AIDNum, ThreadItem, body);
2992- Result := body.Count;
2993- finally
2994- body.Free;
2995- end;
2996- end;
2997-end;
29982909
29992910 {!
30002911 \brief Žž‚ðŽ¦‚·•¶Žš—ñ‚Å‚Í–³‚¢‚©‚Ç‚¤‚©
@@ -3485,8 +3396,10 @@ begin
34853396 end;
34863397
34873398 procedure TGikoSys.ShowRefCount(msg: String; unk: IUnknown);
3399+{$IFDEF DEBUG}
34883400 var
34893401 count : integer;
3402+{$ENDIF}
34903403 begin
34913404 if not Assigned(unk) then
34923405 Exit;