cody: insert inherited call: begin/endundoblock

git-svn-id: trunk@34242 -
This commit is contained in:
mattias 2011-12-17 11:26:47 +00:00
parent ae11c87ef7
commit 94417f1fe6

View File

@ -287,15 +287,20 @@ begin
// move editor cursor in front of insert position
NewXY:=Point(GetPosInLine(Tool.Src,FromPos)+1,SrcEdit.CursorTextXY.Y);
//debugln(['InsertCallInherited NewXY=',dbgs(NewXY),' FromPos=',Tool.CleanPosToStr(FromPos),' ToPos=',Tool.CleanPosToStr(ToPos)]);
SrcEdit.CursorTextXY:=NewXY;
if not CodeToolBoss.SourceChangeCache.Replace(Gap,Gap,FromPos,ToPos,NewCode)
then begin
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Replace failed']);
exit;
end;
if not CodeToolBoss.SourceChangeCache.Apply then begin
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
exit;
SrcEdit.BeginUndoBlock;
try
SrcEdit.CursorTextXY:=NewXY;
if not CodeToolBoss.SourceChangeCache.Apply then begin
debugln(['InsertCallInherited CodeToolBoss.SourceChangeCache.Apply failed']);
exit;
end;
finally
SrcEdit.EndUndoBlock;
end;
except
on e: Exception do CodeToolBoss.HandleException(e);