mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-02 11:32:49 +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
|
||||
Lines := Lines + SrcEdit.Lines[i-1] + LineEnding;
|
||||
Lines:=ChompOneLineEndAtEnd(Lines);
|
||||
Progress.OnAddMatch(TheFileName,
|
||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||
SrcEdit.CursorTextXY,Lines);
|
||||
if (Progress<>nil)
|
||||
and (Progress.OnAddMatch<>nil) then begin
|
||||
Progress.OnAddMatch(TheFileName,
|
||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||
SrcEdit.CursorTextXY,Lines);
|
||||
end;
|
||||
|
||||
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
||||
//DebugLn(['DoReplaceLine FoundStartPos=',dbgs(FoundStartPos),' FoundEndPos=',dbgs(FoundEndPos),' aLastLineLength=',aLastLineLength,' LastReplaceLine=',LastReplaceLine,' LastReplaceColOffset=',LastReplaceColOffset,' ReplaceLineOffset=',ReplaceLineOffset]);
|
||||
@ -460,10 +463,13 @@ var
|
||||
Lines:=ChompOneLineEndAtEnd(Lines);
|
||||
aLineCount:=LineEndCount(AReplace,aLastLineLength);
|
||||
if aLineCount = 0 then aLastLineLength := aLastLineLength + FoundStartPos.X;
|
||||
Progress.OnAddMatch(TheFileName,
|
||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||
Point(aLastLineLength, FoundStartPos.Y + aLineCount + ReplaceLineOffset),
|
||||
Lines);
|
||||
if (Progress<>nil)
|
||||
and (Progress.OnAddMatch<>nil) then begin
|
||||
Progress.OnAddMatch(TheFileName,
|
||||
Point(FoundStartPos.x, FoundStartPos.y + ReplaceLineOffset),
|
||||
Point(aLastLineLength, FoundStartPos.Y + aLineCount + ReplaceLineOffset),
|
||||
Lines);
|
||||
end;
|
||||
|
||||
inc(ReplaceLineOffset,aLineCount-(FoundEndPos.Y-FoundStartPos.Y));
|
||||
end;
|
||||
@ -612,7 +618,10 @@ begin
|
||||
and (Progress.OnAddMatch<>nil) then begin
|
||||
Lines:=OriginalFile.GetLines(FoundStartPos.Y,FoundEndPos.Y);
|
||||
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 else begin
|
||||
|
Loading…
Reference in New Issue
Block a user