Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005860 [JEDI VCL] 00 JVCL Components feature always 2012-04-19 16:30 2012-09-10 14:15
Reporter RHoek View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005860: When using JvInspector with Variant properties the TJvInspector VariantItem does not return 'empty' variant
Description When using variants, the JvInspector uses the TJvInspectorVariantItem class to edit the variant data.

First:
When typing an empty string (''), the empty string value is set in the variant.
I think is should be better for the control to set the value to 'Unassigned'.

Second:
When returning the variant value as a string, it's better to use the 'VarAsString' routine, instead of just assigning the variant tot the string.
Additional Information ORIGINAL CODE:

{ TJvInspectorVariantItem }

function TJvInspectorVariantItem.GetDisplayValue: string;
begin
  Result := Data.AsVariant;
end;

procedure TJvInspectorVariantItem.SetDisplayValue(const Value: string);
begin
  Data.AsVariant := Value;
end;


MODIFIED CODE:

{ TJvInspectorVariantItem }

function TJvInspectorVariantItem.GetDisplayValue: string;
begin
  // RH - 2012-04-19: Ensure correct string (Null, Empty)
  Result := VarToStr(Data.AsVariant);
end;

procedure TJvInspectorVariantItem.SetDisplayValue(const Value: string);
begin
  // RH - 2012-04-19: When displayvalue is empty string, then set Variant 'empty'
  if VarToStr(Value) = '' then
    Data.AsVariant := Unassigned
  else
    Data.AsVariant := Value;
end;
Tags No tags attached.
Attached Files zip file icon JVCL BUG - Variant property TJvInspector (empty string).zip [^] (151,372 bytes) 2012-06-13 12:30

- Relationships

-  Notes
(0019853)
obones (administrator)
2012-06-11 17:28

Please provide the zipped sources of a sample application showing this.
(0019945)
RHoek (reporter)
2012-06-13 12:31

I've uploaded the demo.

Please note: you need the modification of tracker isssue (5857) - which are included in the project - to make the variant property editing work at all.
(0019952)
obones (administrator)
2012-06-13 14:19

Thanks, this is now in SVN

- Issue History
Date Modified Username Field Change
2012-04-19 16:30 RHoek New Issue
2012-06-11 17:28 obones Note Added: 0019853
2012-06-11 17:28 obones Status new => feedback
2012-06-13 12:30 RHoek File Added: JVCL BUG - Variant property TJvInspector (empty string).zip
2012-06-13 12:31 RHoek Note Added: 0019945
2012-06-13 13:40 obones Status feedback => acknowledged
2012-06-13 14:19 obones Note Added: 0019952
2012-06-13 14:19 obones Status acknowledged => resolved
2012-06-13 14:19 obones Fixed in Version => Daily / SVN
2012-06-13 14:19 obones Resolution open => fixed
2012-06-13 14:19 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker