IDE: fixed crash in search form, when doing a hidden search, bug #25886

git-svn-id: trunk@44474 -
This commit is contained in:
mattias 2014-03-20 08:43:56 +00:00
parent e6966c2a2a
commit bc7b175f6d

View File

@ -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