Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
5976 00 JVCL Components minor always 2012-08-31 17:44 2019-05-21 00:29
Arioch  
 
normal  
acknowledged  
open  
none    
none  
0005976: procedure TJvDockServer.CreateDockPanelAndSplitter; - time to clean ?
procedure TJvDockServer.CreateDockPanelAndSplitter;

  function CreatePanel(AParent: TWinControl; Align: TAlign; Name: string): TJvDockPanel;
  begin
    if (FDockPanelClass <> nil) and
      (FDockPanelClass <> TJvDockPanelClass(ClassType)) then
    begin
      Result := FDockPanelClass.Create({Owner} Self);
      // (ahuser) Delphi 5's TComponent.Notification() will fail if Owner=Self.Owner
      Result.Parent := AParent; {ParentForm;}
1: since Delphi 5 is no more supported, i think the workaround should be removed.
It would be natural to make panels owned by the form, not by dock server.

2: this lines just makes me pull my hair.
(FDockPanelClass <> TJvDockPanelClass(ClassType))

Self.Classtype should be TJvDockServer or descendant.
It can never be TJvDockPanelClass
So why that hackers method to disable type checking ?

Even if needed won't more clean approach be
   (TClass(FDockPanelClass) <> TClass(ClassType)) ?

But i still think that is to be just removed. It seems liek some ugly hack with hardly to determine reasoning.
Issue History
2012-08-31 17:44 Arioch New Issue
2013-01-15 15:27 obones Note Added: 0020355
2013-01-15 15:27 obones Status new => feedback
2013-12-13 11:16 obones Status feedback => acknowledged
2013-12-13 12:26 Arioch Note Added: 0020812
2013-12-16 13:24 obones Note Added: 0020864
2013-12-16 13:24 obones Status acknowledged => feedback
2014-12-04 16:34 obones Status feedback => acknowledged
2019-05-20 21:26 mh Note Added: 0021846
2019-05-21 00:29 Arioch Note Added: 0021848
2019-05-21 00:31 Arioch Note Edited: 0021848

Notes
(0020355)
obones   
2013-01-15 15:27   
Yes, seems like it, please provide a patch file for it.
(0020812)
Arioch   
2013-12-13 12:26   
won't have time before February and also the hackerish code is dangerous to touch.

perhaps postpone it and then carefully evaluate why all that weird typecasts were needed ?
(0020864)
obones   
2013-12-16 13:24   
Take your time, there is no hurry
(0021846)
mh   
2019-05-20 21:26   
Any news on that one?
(0021848)
Arioch   
2019-05-21 00:29   
(edited on: 2019-05-21 00:31)
i no more use Delphi 5 and no one picked the challenge when i quit

frankly, it is looooong time that Delphi does not support D5/BCB5

w.r.t. #2 - the "TJvDockPanelClass(ClassType)" is unsafe typecase, with about the same semantics as would be "pointer(ClassType)" or "integer(ClassType)".

unless Delphi (FPC?) optimizing compiler can totally remove this comparison, "evaluating" in compile-time basing upon data types alone, like it would remove "cardinal-var < 0" comparisons, the data type to me seemsdoing nothing at all.

w.r.t. 0000001 - i kind of thinkn that whatever be made wit hthe comment - the ahuser's comment better remain. It is of those pieces of knowledge that you only get when they byte you from behind, and because of that might be worth keeping despite D5 unsupported