mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 07:36:19 +02:00
IDE: fixed crash in search form, when doing a hidden search, bug #25886
git-svn-id: trunk@44474 -
This commit is contained in:
parent
e6966c2a2a
commit
bc7b175f6d
@ -426,9 +426,12 @@ var
|
|||||||
for i := SrcEditStartPos.Y to SrcEditStartPos.Y + aLineCount do
|
for i := SrcEditStartPos.Y to SrcEditStartPos.Y + aLineCount do
|
||||||
Lines := Lines + SrcEdit.Lines[i-1] + LineEnding;
|
Lines := Lines + SrcEdit.Lines[i-1] + LineEnding;
|
||||||
Lines:=ChompOneLineEndAtEnd(Lines);
|
Lines:=ChompOneLineEndAtEnd(Lines);
|
||||||
Progress.OnAddMatch(TheFileName,
|
if (Progress<>nil)
|
||||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
and (Progress.OnAddMatch<>nil) then begin
|
||||||
SrcEdit.CursorTextXY,Lines);
|
Progress.OnAddMatch(TheFileName,
|
||||||
|
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||||
|
SrcEdit.CursorTextXY,Lines);
|
||||||
|
end;
|
||||||
|
|
||||||
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
||||||
//DebugLn(['DoReplaceLine FoundStartPos=',dbgs(FoundStartPos),' FoundEndPos=',dbgs(FoundEndPos),' aLastLineLength=',aLastLineLength,' LastReplaceLine=',LastReplaceLine,' LastReplaceColOffset=',LastReplaceColOffset,' ReplaceLineOffset=',ReplaceLineOffset]);
|
//DebugLn(['DoReplaceLine FoundStartPos=',dbgs(FoundStartPos),' FoundEndPos=',dbgs(FoundEndPos),' aLastLineLength=',aLastLineLength,' LastReplaceLine=',LastReplaceLine,' LastReplaceColOffset=',LastReplaceColOffset,' ReplaceLineOffset=',ReplaceLineOffset]);
|
||||||
@ -460,10 +463,13 @@ var
|
|||||||
Lines:=ChompOneLineEndAtEnd(Lines);
|
Lines:=ChompOneLineEndAtEnd(Lines);
|
||||||
aLineCount:=LineEndCount(AReplace,aLastLineLength);
|
aLineCount:=LineEndCount(AReplace,aLastLineLength);
|
||||||
if aLineCount = 0 then aLastLineLength := aLastLineLength + FoundStartPos.X;
|
if aLineCount = 0 then aLastLineLength := aLastLineLength + FoundStartPos.X;
|
||||||
Progress.OnAddMatch(TheFileName,
|
if (Progress<>nil)
|
||||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
and (Progress.OnAddMatch<>nil) then begin
|
||||||
Point(aLastLineLength, FoundStartPos.Y + aLineCount + ReplaceLineOffset),
|
Progress.OnAddMatch(TheFileName,
|
||||||
Lines);
|
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||||
|
Point(aLastLineLength, FoundStartPos.Y + aLineCount + ReplaceLineOffset),
|
||||||
|
Lines);
|
||||||
|
end;
|
||||||
|
|
||||||
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
||||||
end;
|
end;
|
||||||
@ -612,7 +618,10 @@ begin
|
|||||||
and (Progress.OnAddMatch<>nil) then begin
|
and (Progress.OnAddMatch<>nil) then begin
|
||||||
Lines:=OriginalFile.GetLines(FoundStartPos.Y,FoundEndPos.Y);
|
Lines:=OriginalFile.GetLines(FoundStartPos.Y,FoundEndPos.Y);
|
||||||
Lines:=ChompOneLineEndAtEnd(Lines);
|
Lines:=ChompOneLineEndAtEnd(Lines);
|
||||||
Progress.OnAddMatch(TheFileName,FoundStartPos,FoundEndPos,Lines);
|
if (Progress<>nil)
|
||||||
|
and (Progress.OnAddMatch<>nil) then begin
|
||||||
|
Progress.OnAddMatch(TheFileName,FoundStartPos,FoundEndPos,Lines);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
|
Loading…
Reference in New Issue
Block a user