View Issue Details

IDProjectCategoryView StatusLast Update
0006221JEDI VCL00 JVCL Componentspublic2014-12-04 16:30
ReporterStregorAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionsuspended 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0006221: JvAppStorage always store Variants as String
DescriptionI want store TcxSpinEdit.Value. Value is stored properly, but when restored, TcxSpinEdit.Value setter is called. Then, setter ignore my stored value, because accept only numeric values.

procedure TJvCustomAppStorage.ReadProperty ALWAYS read variants as strings. Problem can be resolved simply : we can check previous type of property, read new value to temp variant variable and convert that temp variable to necessary type.

Solution:

procedure TJvCustomAppStorage.ReadProperty

1. add two variables:
  TmpVariantValue: Variant;
  VT: TVarType;

2. change case tkVariant -
code before:

tkVariant:
      SetVariantProp(PersObj, PropName, ReadString(Path, VarToStr(GetVariantProp(PersObj, PropName))));

code after:

tkVariant:
      begin
        TmpVariantValue := GetPropValue(PersObj, Propname);
        VT := VarType(TmpVariantValue);
        TmpVariantValue := ReadString(Path, VarToStr(GetVariantProp(PersObj, PropName)));
        TmpVariantValue := VarAsType(TmpVariantValue, vt);
        SetVariantProp(PersObj, PropName, TmpVariantValue);
      end;
        TmpVariantValue := VarAsType(TmpVariantValue, vt);
        SetVariantProp(PersObj, PropName, TmpVariantValue);
      end;
TagsNo tags attached.

Activities

Stregor

2013-10-24 11:44

reporter   ~0020687

Sorry, code after will be:

tkVariant:
      begin
        TmpVariantValue := GetPropValue(PersObj, Propname);
        VT := VarType(TmpVariantValue);
        TmpVariantValue := ReadString(Path, VarToStr(GetVariantProp(PersObj, PropName)));
        TmpVariantValue := VarAsType(TmpVariantValue, vt);
        SetVariantProp(PersObj, PropName, TmpVariantValue);
      end;

obones

2013-12-13 11:09

administrator   ~0020747

Please try with the latest JVCL version in GIT (or daily zip) and then send us a zipped file containing the sources of an application showing the issue.

obones

2014-12-04 16:30

administrator   ~0021110

No news, suspending the issue

Issue History

Date Modified Username Field Change
2013-10-24 11:40 Stregor New Issue
2013-10-24 11:44 Stregor Note Added: 0020687
2013-12-13 11:09 obones Note Added: 0020747
2013-12-13 11:09 obones Status new => feedback
2014-12-04 16:30 obones Note Added: 0021110
2014-12-04 16:30 obones Status feedback => resolved
2014-12-04 16:30 obones Resolution open => suspended
2014-12-04 16:30 obones Assigned To => obones