View Issue Details

IDProjectCategoryView StatusLast Update
0004802JEDI VCL00 JVCL Componentspublic2009-06-06 00:11
ReporterpharmaplusAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.36 
Target VersionFixed in Version3.37 
Summary0004802: TJvMemoryData.SortOnFields doesn't work in RAD Studio 2009 witht fields of type ftString.
DescriptionStrange behavior trying to sort the table just with fields of FieldType = ftString.
The problem could be in the function TJvMemoryData.CompareFields. With the next modification It works fine.

Old code:

function TJvMemoryData.CompareFields(Data1, Data2: Pointer;
  FieldType: TFieldType; CaseInsensitive: Boolean): Integer;
begin
  Result := 0;
  case FieldType of
    ftString:
      if CaseInsensitive then
        Result := AnsiCompareText(PChar(Data1), PChar(Data2))
      else
        Result := AnsiCompareStr(PChar(Data1), PChar(Data2));

New code:
function TJvMemoryData.CompareFields(Data1, Data2: Pointer;
  FieldType: TFieldType; CaseInsensitive: Boolean): Integer;
begin
  Result := 0;
  case FieldType of
    ftString:
      {$IFDEF COMPILER12_UP}
      if CaseInsensitive then
        Result := AnsiCompareText(PAnsiChar(Data1), PAnsiChar(Data2))
      else
        Result := AnsiCompareStr(PAnsiChar(Data1), PAnsiChar(Data2));
      {$ELSE}
      if CaseInsensitive then
        Result := AnsiCompareText(PChar(Data1), PChar(Data2))
      else
        Result := AnsiCompareStr(PChar(Data1), PChar(Data2));
      {$ENDIF COMPILER12_UP}
TagsNo tags attached.

Activities

obones

2009-06-04 13:28

administrator   ~0015604

Please try again with the daily zip (http://jvcl.sf.net/daily/), I believe this already fixed

pharmaplus

2009-06-04 15:41

reporter   ~0015605

I have installed jcl-1.105.0.3382 and JVCL3-2009-06-04 doing the same test with a table with 3000 records and It is not fixed. The same behavior.

AHUser

2009-06-06 00:11

developer   ~0015617

Fixed in SVN.

Issue History

Date Modified Username Field Change
2009-06-04 11:39 pharmaplus New Issue
2009-06-04 13:28 obones Note Added: 0015604
2009-06-04 13:28 obones Status new => feedback
2009-06-04 15:41 pharmaplus Note Added: 0015605
2009-06-06 00:11 AHUser Note Added: 0015617
2009-06-06 00:11 AHUser Status feedback => resolved
2009-06-06 00:11 AHUser Fixed in Version => Daily / SVN
2009-06-06 00:11 AHUser Resolution open => fixed
2009-06-06 00:11 AHUser Assigned To => AHUser