View Issue Details

IDProjectCategoryView StatusLast Update
0003666JEDI VCL00 JVCL Componentspublic2006-05-03 05:19
Reporterivan_raAssigned Toivan_ra 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.30 
Summary0003666: JvInterpreterFm: MakeForm function does not work
DescriptionAfter introdice of Class Fields support for interpreted forms MakeForm function raises exception
This is example for bug
Additional InformationAnd this is fix: because now JvInterpreterFm requires FForm.FClassIdentifier we must find form class in unit. Fix is very simple, more accurate fix must read form class from DFM stream
TagsNo tags attached.

Activities

2006-04-28 08:07

 

FormsExample.zip (2,766 bytes)

2006-04-28 08:08

 

JvInterpreterFm.pas.patch (1,152 bytes)
Index: JvInterpreterFm.pas
===================================================================
--- JvInterpreterFm.pas	(revision 10546)
+++ JvInterpreterFm.pas	(working copy)
@@ -356,6 +356,7 @@
 var
   Stream: TStream;
   SrcClass: TJvInterpreterIdentifier;                // Class Fields support
+  i: integer;
 begin
   FForm := AForm;
   Form.FJvInterpreterFm := Self;
@@ -365,11 +366,19 @@
   finally
     FreeDfmStream(Stream);
   end;
+  // find form class
+  for i:=0 to Adapter.SrcClassList.Count-1 do
+  if cmp(TJvInterpreterIdentifier(Adapter.SrcClassList[i]).UnitName,FForm.FUnitName) then
+  begin
+    FForm.FClassIdentifier := TJvInterpreterIdentifier(Adapter.SrcClassList[i]).Identifier;
+    Break;
+  end;
   // Class Fields support begin
   // copy form fields from pattern
   SrcClass := TJvInterpreterAdapterAccessProtected(Adapter).GetSrcClass(
     AForm.FClassIdentifier);
-  AForm.FFieldList.Assign(TJvInterpreterClass(SrcClass).ClassFields);
+  if assigned(SrcClass) then
+    AForm.FFieldList.Assign(TJvInterpreterClass(SrcClass).ClassFields);
   // Class Fields support end
   try
     if Assigned(Form.OnCreate) then

ivan_ra

2006-04-28 20:59

developer   ~0009199

Sorry, I forget 1 string in patch:
if FForm.FClassIdentifier = '' then
... and so on

obones

2006-05-02 01:38

administrator   ~0009224

Ivan, I tried to send you an email, but your email provider blocked my SMTP server IP address. I'll try again this evening from another SMTP server, in the meantime if you want to contact me via another email address, please do.
Cheers
Olivie

ivan_ra

2006-05-03 05:16

developer   ~0009246

this is now in SVN

Issue History

Date Modified Username Field Change
2006-04-28 08:05 ivan_ra New Issue
2006-04-28 08:07 ivan_ra File Added: FormsExample.zip
2006-04-28 08:08 ivan_ra File Added: JvInterpreterFm.pas.patch
2006-04-28 20:59 ivan_ra Note Added: 0009199
2006-05-02 01:38 obones Note Added: 0009224
2006-05-02 01:38 obones Status new => feedback
2006-05-03 05:16 ivan_ra Note Added: 0009246
2006-05-03 05:17 ivan_ra Status feedback => closed
2006-05-03 05:19 ivan_ra Status closed => resolved
2006-05-03 05:19 ivan_ra Resolution open => fixed
2006-05-03 05:19 ivan_ra Assigned To => ivan_ra