OSDN Git Service

レスポップアップのあぼ〜ん有効にしてても、透明あぼ〜んをスルーする不具合の修正。
authorh677 <h677>
Tue, 20 Apr 2004 14:53:57 +0000 (14:53 +0000)
committerh677 <h677>
Tue, 20 Apr 2004 14:53:57 +0000 (14:53 +0000)
使わない関数の削除。

AbonUnit.pas

index e4f6ef7..0f3c469 100644 (file)
@@ -63,10 +63,8 @@ type
     function ReLoadFromNGwordFile() : Boolean;
     procedure LoadFromStringList( bufstl : TStringList );
     function CheckAbonPopupRes(line : String) :Boolean;
-    function FindNGwords(line : String) : Boolean; overload;//1\83\89\83C\83\93\82¸\82Â\97p\81B
-    function FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean; overload;//1\83\89\83C\83\93\82¸\82Â\97p\81B
-    function FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; overload;//1\83\89\83C\83\93\82¸\82Â\97p\81B
-    function Cutoff(line : String) : Boolean; //CutOff\92l\88È\8fã\8cÂ\82Ì\93¯\82\89p\90\94\82ª\95À\82ñ\82Å\82¢\82½\82çtrue
+       function FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//1\83\89\83C\83\93\82¸\82Â\97p\81B
+       function Cutoff(line : String) : Boolean; //CutOff\92l\88È\8fã\8cÂ\82Ì\93¯\82\89p\90\94\82ª\95À\82ñ\82Å\82¢\82½\82çtrue
     //\82 \82Ú\81`\82ñ\8f\88\97\9d(NG\83\8f\81[\83h\82Å\82Ì\83t\83B\83\8b\83^\83\8a\83\93\83O)
     procedure Execute(var ThreadStrings : TStringList); overload;
     procedure Execute(var ThreadStrings : TStringList; NGwords : TStringList); overload;
@@ -80,15 +78,8 @@ type
     function GetAbonResCount() : Integer;
     function GetAbonResString(Num : Integer) : String;
     function CheckIndividualAbonList(ResNum : Integer) : Boolean;
-    //--
-    function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    function ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    function ReverseExecuteFile(datfilepath : String) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    function ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    function ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-    //--
-    procedure EditNGwords();  //NGword.txt\82ð\8aJ\82­\81B
+
+       procedure EditNGwords();  //NGword.txt\82ð\8aJ\82­\81B
     function ShowAllTokens() : String;  //\83f\83o\83b\83O\97p
     //--
     procedure GoHome();//List\82Ì\82P\8ds\96Ú\82ð\93Ç\82Þ
@@ -246,7 +237,7 @@ var
     pos : Integer;
     buftoken : String;
 begin
-    pos := 0;
+       pos := 0;
     bufstl := TStringList.Create;
     try
         if Length(argline) > 0 then begin
@@ -295,76 +286,78 @@ end;
 
 //****************************************************************************//
 //NG\83\8f\81[\83h\82ª\8aÜ\82Ü\82ê\82Ä\82½\82çtrue\82ð\95Ô\82·\81B
-function TAbon.FindNGwords(line : String) : Boolean;
+{function TAbon.FindNGwords(const line : String) : Boolean;
 var
-    lines : Integer;
-    cells : Integer;
-    hit : Boolean;
-    bufline : String;
-begin
-    hit := false;
-    if AnsiPos(FAbonString,line) <> 1 then begin
-        for lines := 0 to High(Ftokens) do begin
-               hit := true;
-            bufline := line;
-            for cells := 0 to High(Ftokens[lines]) do begin
-                if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
-                       hit := false;
-                    break;
-                end else begin
-                       Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
-                end;
-            end;
-            if hit = true then begin
-               break;
-            end;
-        end;
-    end;
-    Result := hit;
+       lines : Integer;
+       cells : Integer;
+       hit : Boolean;
+
+       bufline : String;
+begin
+       hit := false;
+       if AnsiPos(FAbonString,line) <> 1 then begin
+               for lines := 0 to High(Ftokens) do begin
+                       hit := true;
+                       bufline := line;
+                       for cells := 0 to High(Ftokens[lines]) do begin
+                               if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
+                                       hit := false;
+                                       break;
+                               end else begin
+                                       Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
+                               end;
+                       end;
+                       if hit = true then begin
+                               break;
+                       end;
+               end;
+       end;
+       Result := hit;
 end;
 //NG\83\8f\81[\83h\82ª\8aÜ\82Ü\82ê\82Ä\82¢\82½\82çtrue\82ð\95Ô\82µ\81A\82»\82ÌNG\83\8f\81[\83h\82Ì\8ds\90\94\82ðNGwordsLineNum\82É\93ü\82ê\82Ä\95Ô\82·
-function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean;
+function TAbon.FindNGwords(const line : String; var NGwordsLineNum : Integer) : Boolean;
 var
-    lines : Integer;
-    cells : Integer;
-    hit : Boolean;
-    bufline : String;
-begin
-    hit := false;
-    if AnsiPos(FAbonString,line) <> 1 then begin
-        for lines := 0 to High(Ftokens) do begin
-               hit := true;
-            bufline := line;
-            for cells := 0 to High(Ftokens[lines]) do begin
-                if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
-                       hit := false;
-                    break;
-                end else begin
-                       Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
-                end;
-            end;
-            if hit = true then begin
-                NGwordsLineNum := lines + 1;
-               break;
-            end;
-        end;
-    end;
-    Result := hit;
-end;
+       lines : Integer;
+       cells : Integer;
+       hit : Boolean;
+       bufline : String;
+begin
+       hit := false;
+       if AnsiPos(FAbonString,line) <> 1 then begin
+               for lines := 0 to High(Ftokens) do begin
+                       hit := true;
+                       bufline := line;
+                       for cells := 0 to High(Ftokens[lines]) do begin
+                               if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
+                                       hit := false;
+                                       break;
+                               end else begin
+                                       Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
+                               end;
+                       end;
+                       if hit = true then begin
+                               NGwordsLineNum := lines + 1;
+                               break;
+                       end;
+               end;
+       end;
+       Result := hit;
+end;
+}
 //NG\83\8f\81[\83h\82ª\8aÜ\82Ü\82ê\82Ä\82¢\82½\82çtrue\82ð\95Ô\82µ\81A\82»\82ÌNG\83\8f\81[\83h\82Ì\8ds\90\94\82ðNGwordsLineNum\82É\93ü\82ê\82Ä\95Ô\82·\81B
 //\82à\82µ\82à\93§\96¾\82 \82Ú\81`\82ñ\82É\82·\82é\82È\82çInbisible\82ðtrue\82É\82µ\82Ä\95Ô\82·
-function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1\83\89\83C\83\93\82¸\82Â\97p\81B
+function TAbon.FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1\83\89\83C\83\93\82¸\82Â\97p\81B
 var
-    lines : Integer;
-    cells : Integer;
-    hit : Boolean;
-    bufline : String;
-    start : Integer;
-begin
-    hit := false;
-    if AnsiPos(FAbonString,line) <> 1 then begin
-        for lines := 0 to High(Ftokens) do begin
-               hit := true;
+       lines : Integer;
+       cells : Integer;
+       hit : Boolean;
+       bufline : String;
+       start : Integer;
+begin
+       hit := false;
+       if AnsiPos(FAbonString,line) <> 1 then begin
+               for lines := 0 to High(Ftokens) do begin
+                       hit := true;
             bufline := line;
             if Ftokens[lines][0] <> ''  then begin
                 Invisible := false;
@@ -422,7 +415,7 @@ var
 begin
     for i:=0 to ThreadStrings.Count - 1 do begin
         NGwordsLine := 0;
-        if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse  then begin
+               if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse  then begin
             if invisi = true then begin
                 ThreadStrings.Strings[i] := '';
             end else begin
@@ -512,201 +505,11 @@ begin
         SetTokens(i , buf.Strings[i]);
     end;
     Execute(ThreadStrings);
-    buf.Free;
+       buf.Free;
 end;
 
 
 //****************************************************************************//
-//DAT\82ð\92¼\82É\82¢\82\82é\93z\82ç===========================================================
-//NG\83\8f\81[\83h\82ð\8aÜ\82Þ\83\8c\83X\82Ì\90æ\93ª\82É\82 \82Ú\81[\82ñ\82ð\91}\93ü
-function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    ret : Boolean;
-    i : Integer;
-begin
-    datstl := TStringList.Create;
-    ret := true;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            for i := 0 to datstl.Count -1 do begin
-                if FindNGwords(datstl.Strings[i]) = true  then begin
-                    datstl.Strings[i] := FAbonString + datstl.Strings[i]
-                end;
-            end;
-
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-
-end;
-//\8ew\92è\82³\82ê\82½\83\8c\83X\94Ô\82Ì\90æ\93ª\82É\82 \82Ú\81[\82ñ\91}\93ü
-function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    ret : Boolean;
-begin
-    ret := true;
-    datstl := TStringList.Create;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            if (resnum > 0) and (resnum <= datstl.Count) then begin
-                if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
-                    datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
-                end;
-            end;
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-end;
-//firstres\82©\82çcount\8cÂ\82Ì\83\8c\83X\82Ì\90æ\93ª\82É\82 \82Ú\81[\82ñ\91}\93ü
-function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    i : Integer;
-    endnum : Integer; //\8fI\82í\82è\82Ì\83\8c\83X\94Ô
-    ret : Boolean;
-begin
-    ret := true;
-    datstl := TStringList.Create;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            if (firstres > 0) and (firstres <= datstl.Count) then begin
-                if firstres + count -1 > datstl.Count then begin
-                    endnum := datstl.Count;
-                end else if count <= 0 then begin
-                    endnum := firstres + 1;
-                end else begin
-                    endnum := firstres + count -1;
-                end;
-
-                for i := firstres to endnum do begin
-                    if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
-                        datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
-                    end;
-                end;
-            end;
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-end;
-//DAT\82ð\92¼\82É\82¢\82\82é\93z\82ç==========\82±\82±\82Ü\82Å=========================================
-
-//\8c³\82É\96ß\82·\93z\82ç==================================================================
-function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    i : Integer;
-    buf : String;
-    ret : Boolean;
-begin
-    ret := true;
-    datstl := TStringList.Create;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            for i:=0 to datstl.Count -1  do begin
-                if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
-                    buf := datstl.Strings[i];
-                    Delete(buf,1,Length(FAbonString));
-                    datstl.Strings[i] := buf;
-                end;
-            end;
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-
-end;
-function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    buf : String;
-    ret : Boolean;
-begin
-    ret := true;
-    datstl := TStringList.Create;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            if (resnum > 0) and (resnum <= datstl.Count) then begin
-                if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
-                    buf := datstl.Strings[resnum-1];
-                    Delete(buf,1,Length(FAbonString));
-                    datstl.Strings[resnum-1] := buf;
-                end;
-            end;
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-
-end;
-function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT\83t\83@\83C\83\8b\82ð\92¼\82É\82¢\82\82é
-var
-    datstl : TStringList;
-    i : Integer;
-    endnum : Integer; //\8fI\82í\82è\82Ì\83\8c\83X\94Ô
-    buf : String;
-    ret : Boolean;
-begin
-    ret := true;
-    datstl := TStringList.Create;
-    try
-        try
-            datstl.LoadFromFile(datfilepath);
-            if (firstres > 0) and (firstres <= datstl.Count) then begin
-                if firstres + count -1 > datstl.Count then begin
-                    endnum := datstl.Count;
-                end else if count <= 0 then begin
-                    endnum := firstres + 1;
-                end else begin
-                    endnum := firstres + count -1;
-                end;
-                for i := firstres to endnum do begin
-                    if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
-                        buf := datstl.Strings[i-1];
-                        Delete(buf,1,Length(FAbonString));
-                        datstl.Strings[i-1] := buf;
-                    end;
-                end;
-            end;
-            datstl.SaveToFile(datfilepath);
-        except
-            ret := false;
-        end;
-    finally
-        datstl.Free;
-    end;
-    Result := ret;
-end;
-//\8c³\82É\96ß\82·\93z\82ç=================\82±\82±\82Ü\82Å=========================================
 //\8c»\8dÝ\83Z\83b\83g\82³\82ê\82Ä\82¢\82éNGword.txt\82ð\8aJ\82­
 procedure TAbon.EditNGwords();
 begin
@@ -714,9 +517,12 @@ begin
 end;
 //\83|\83b\83v\83A\83b\83v\97p\94»\92è\8aÖ\90\94
 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
+var
+       i: Integer;
+       v: boolean;
 begin
-    if AbonPopupRes = true then begin
-        Result := FindNGwords(line);
+       if AbonPopupRes = true then begin
+               Result := FindNGwords(line, i ,v);
     end else begin
         Result := false;
     end;