lcl: review some exception raising code

git-svn-id: trunk@26662 -
This commit is contained in:
paul 2010-07-15 11:30:21 +00:00
parent 8851d2a322
commit 262184b138
3 changed files with 11 additions and 22 deletions

View File

@ -3428,7 +3428,7 @@ var
procedure RaiseInvalidSide;
begin
raise Exception.Create('TAnchorSide.GetSidePosition invalid Side');
raise Exception.Create('TAnchorSide.CheckSidePosition invalid Side');
end;
function GetNextCentered(ReferenceControl: TControl; Side: TAnchorKind;

View File

@ -342,7 +342,7 @@ end;
procedure TDockZone.Remove(ChildZone: TDockZone);
begin
if ChildZone.Parent<>Self then
if ChildZone.Parent <> Self then
raise Exception.Create('TDockZone.Remove');
if ChildZone=FFirstChildZone then FFirstChildZone:=ChildZone.FNextSibling;
if ChildZone.FNextSibling<>nil then

View File

@ -7513,19 +7513,12 @@ end;
decreases the BoundsLockCount
------------------------------------------------------------------------------}
procedure TWinControl.EndUpdateBounds;
procedure RaiseTooManyEndUpdates;
begin
raise Exception.Create('TWinControl.EndUpdateBounds '+DbgSName(Self)
+' too many calls.');
end;
begin
if FBoundsLockCount<=0 then RaiseTooManyEndUpdates;
if FBoundsLockCount <= 0 then
raise EInvalidOperation.CreateFmt('TWinControl.EndUpdateBounds %s too many calls.', [DbgSName(Self)]);
dec(FBoundsLockCount);
if FBoundsLockCount=0 then begin
SetBounds(Left,Top,Width,Height);
end;
if FBoundsLockCount = 0 then
SetBounds(Left, Top, Width, Height);
end;
procedure TWinControl.LockRealizeBounds;
@ -7667,16 +7660,12 @@ procedure TWinControl.SetBounds(ALeft, ATop, AWidth, AHeight: integer);
procedure CheckDesignBounds;
begin
if FRealizeBoundsLockCount>0 then exit;
if FRealizeBoundsLockCount > 0 then Exit;
// the user changed the bounds
if aWidth<0 then
raise Exception.Create(
'TWinControl.SetBounds ('+DbgSName(Self)+'): Negative width '
+dbgs(aWidth)+' not allowed.');
if aHeight<0 then
raise Exception.Create(
'TWinControl.SetBounds ('+DbgSName(Self)+'): Negative height '
+dbgs(aHeight)+' not allowed.');
if AWidth < 0 then
raise EInvalidOperation.CreateFmt('TWinControl.SetBounds (%s): Negative width %d not allowed.', [DbgSName(Self), AWidth]);
if AHeight < 0 then
raise EInvalidOperation.CreateFmt('TWinControl.SetBounds (%s): Negative height %d not allowed.', [DbgSName(Self), AHeight]);
end;
var