From 865013eeb919e7ea8f8c2c10ee0fd808266a3f9f Mon Sep 17 00:00:00 2001 From: Juha Date: Tue, 28 Sep 2021 14:22:48 +0300 Subject: [PATCH] IDE: Remove unused and duplicate resource strings. Fix exception messages. --- designer/jitforms.pp | 5 +++-- ide/lazarusidestrconsts.pas | 1 - lcl/include/control.inc | 4 ++-- lcl/include/wincontrol.inc | 2 +- lcl/lclstrconsts.pas | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/designer/jitforms.pp b/designer/jitforms.pp index a8a3acbbe8..9994a2b1ea 100644 --- a/designer/jitforms.pp +++ b/designer/jitforms.pp @@ -967,7 +967,7 @@ begin end; except on E: Exception do begin - HandleException(E,'[TJITComponentList.AddJITChildComponentFromStream] ERROR reading form stream' + HandleException(E,'[TJITComponentList.AddJITComponentFromStream] ERROR reading form stream' +' of Class "'+NewClassName+'"',Action); if Result>=0 then begin // try freeing the unfinished thing @@ -1383,7 +1383,8 @@ begin end; except on E: Exception do begin - HandleException(E,'[TJITComponentList.AddJITChildComponentFromStream] ERROR reading form stream of Class "'+ComponentClass.ClassName+'"',Action); + HandleException(E,'[TJITComponentList.AddJITChildComponentFromStream] ERROR reading form stream' + +' of Class "'+ComponentClass.ClassName+'"',Action); end; end; FCurReadStreamClass:=nil; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 79b8f42189..97d12e814f 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -6006,7 +6006,6 @@ resourcestring lisFindMissingUnit = 'Find missing unit'; lisSearchUnit = 'Search Unit "%s"'; lisEmpty = 'Empty'; - lisNotAValidPascalIdentifier = 'Not a valid Pascal identifier'; lisThereIsAlreadyAComponentWithThisName = 'There is already a component ' +'with this name'; lisTheOwnerHasThisName = 'The owner has this name'; diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 920de0b151..dbf443ddd9 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -1624,7 +1624,7 @@ end; function TControl.GetClientOrigin: TPoint; begin if Parent = nil then - raise EInvalidOperation.CreateFmt(rsControlHasNoParentWindow, [Name]); + raise EInvalidOperation.CreateFmt(sParentRequired, [Name]); Result := Parent.ClientOrigin; Inc(Result.X, FLeft); Inc(Result.Y, FTop); @@ -5281,7 +5281,7 @@ end; function TControl.GetDeviceContext(var WindowHandle: HWND): HDC; begin if Parent = nil then - raise EInvalidOperation.CreateFmt(rsControlHasNoParentWindow, [Name]); + raise EInvalidOperation.CreateFmt(sParentRequired, [Name]); Result := Parent.GetDeviceContext(WindowHandle); MoveWindowOrgEx(Result, Left, Top); diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index b971dbfadf..3b1e90b4c3 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -7535,7 +7535,7 @@ begin if (WndParent = 0) and (Style and WS_CHILD <> 0) then begin DebugLn(['TWinControl.CreateWnd ',DbgSName(Self),' Parent=',DbgSName(Parent),' ERROR WndParent=0']); - raise EInvalidOperation.CreateFmt(rsControlHasNoParentWindow, [Name]); + raise EInvalidOperation.CreateFmt(sParentRequired, [Name]); end; end; diff --git a/lcl/lclstrconsts.pas b/lcl/lclstrconsts.pas index 9a4f22cecc..4154a9ba43 100644 --- a/lcl/lclstrconsts.pas +++ b/lcl/lclstrconsts.pas @@ -251,7 +251,6 @@ resourceString rsGridHasNoRows = 'Cannot insert columns into a grid when it has no rows'; rsGridHasNoCols = 'Cannot insert rows into a grid when it has no columns'; rsAControlCanNotHaveItselfAsParent = 'A control can''t have itself as a parent'; - rsControlHasNoParentWindow = 'Control ''%s'' has no parent window'; rsControlHasNoParentFormOrFrame = 'Control ''%s'' has no parent form or frame'; rsControlIsNotAParent = '''%s'' is not a parent of ''%s'''; rsControlClassCantContainChildClass = 'Control of class ''%s'' can''t have control of class ''%s'' as a child';