View Issue Details

IDProjectCategoryView StatusLast Update
0003569JEDI VCL00 JVCL Componentspublic2006-03-10 02:57
Reporterivan_raAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.10 
Target VersionFixed in Version3.30 
Summary0003569: JvInterpreter: class fields support
Descriptionin 3.20 was introduced class fields support for JvInterpreter. Now if recognizes forms with fields. But assigning of values not works every time. This is patch to fix problem
TagsNo tags attached.

Activities

2006-03-09 10:00

 

JvInterpreterFm.pas.patch (2,359 bytes)
Index: run/JvInterpreterFm.pas
===================================================================
RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvInterpreterFm.pas,v
retrieving revision 1.31
diff -u -r1.31 JvInterpreterFm.pas
--- run/JvInterpreterFm.pas	17 Jan 2006 20:40:36 -0000	1.31
+++ run/JvInterpreterFm.pas	9 Mar 2006 17:03:30 -0000
@@ -473,6 +473,19 @@
 
 function TJvInterpreterFm.SetValue(const Identifier: string; const Value: Variant;
   var Args: TJvInterpreterArgs): Boolean;
+  // Class Fields support begin
+var
+  JvInterpreterForm: TJvInterpreterForm;
+
+  function SetFormValue(Form: TJvInterpreterForm): Boolean;
+  begin
+    result:=false;
+    with Form.FFieldList do
+    if FindVar('', Identifier) <> nil then
+      Result := SetValue(Identifier, Value, Args);
+  end;
+  // Class Fields support end
+
 begin
   if (Args.Obj = nil) and (CurInstance is TJvInterpreterForm) then
   begin
@@ -482,23 +495,33 @@
       Exit;
     end;
     // Class Fields support begin
-    with Form.FFieldList do
-    if FindVar('', Identifier) <> nil then
-    begin
-      Result := SetValue(Identifier, Value, Args);
-      Exit;
-    end;
+    { may be TForm field }
+    Result := SetFormValue(TJvInterpreterForm(CurInstance));
+    if not result then begin
     // Class Fields support end
-    { may be TForm method or published property }
-    Args.Obj := CurInstance;
-    Args.ObjTyp := varObject;
-    try
-      Result := inherited SetValue(Identifier, Value, Args);
-    finally
-      Args.Obj := nil;
-      Args.ObjTyp := 0;
+      { may be TForm method or published property }
+      Args.Obj := CurInstance;
+      Args.ObjTyp := varObject;
+      try
+        Result := inherited SetValue(Identifier, Value, Args);
+      finally
+        Args.Obj := nil;
+        Args.ObjTyp := 0;
+      end;
     end;
   end
+  // Class Fields support begin
+  else
+  if (Args.Obj <> nil) and (Args.ObjTyp = varObject) and
+    (Args.Obj is TJvInterpreterForm) then
+  try
+    JvInterpreterForm:=TJvInterpreterForm(Args.Obj);
+    Args.Obj:=nil;
+    Result := SetFormValue(JvInterpreterForm);
+  finally
+    Args.Obj:=JvInterpreterForm;
+  end
+  // Class Fields support end
   else
     Result := False;
   Result := Result or inherited SetValue(Identifier, Value, Args);

AHUser

2006-03-10 02:57

developer   ~0008645

Fixed in CVS.

Issue History

Date Modified Username Field Change
2006-03-09 09:59 ivan_ra New Issue
2006-03-09 10:00 ivan_ra File Added: JvInterpreterFm.pas.patch
2006-03-10 02:57 AHUser Status new => resolved
2006-03-10 02:57 AHUser Resolution open => fixed
2006-03-10 02:57 AHUser Assigned To => AHUser
2006-03-10 02:57 AHUser Note Added: 0008645