Browse Source

* Fix for mantis bug #8213

git-svn-id: trunk@6193 -
joost 18 years ago
parent
commit
6aa6d4389e
1 changed files with 21 additions and 0 deletions
  1. 21 0
      fcl/db/db.pp

+ 21 - 0
fcl/db/db.pp

@@ -783,17 +783,24 @@ type
 
   TIndexDef = class(TCollectionItem)
   Private
+    FCaseinsFields: string;
+    FDescFields: string;
     FExpression : String;
     FFields : String;
     FName : String;
     FOptions : TIndexOptions;
     FSource : String;
+  protected
+    procedure SetCaseInsFields(const AValue: string); virtual;
+    procedure SetDescFields(const AValue: string);
   public
     constructor Create(Owner: TIndexDefs; const AName, TheFields: string;
       TheOptions: TIndexOptions);
     destructor Destroy; override;
     property Expression: string read FExpression;
     property Fields: string read FFields write FFields;
+    property CaseInsFields: string read FCaseinsFields write SetCaseInsFields;
+    property DescFields: string read FDescFields write SetDescFields;
     property Name: string read FName write FName;
     property Options: TIndexOptions read FOptions write FOptions;
     property Source: string read FSource write FSource;
@@ -1860,6 +1867,20 @@ end;
 
 { TIndexDef }
 
+procedure TIndexDef.SetDescFields(const AValue: string);
+begin
+  if FDescFields=AValue then exit;
+  if AValue <> '' then FOptions:=FOptions + [ixDescending];
+  FDescFields:=AValue;
+end;
+
+procedure TIndexDef.SetCaseInsFields(const AValue: string);
+begin
+  if FCaseinsFields=AValue then exit;
+  if AValue <> '' then FOptions:=FOptions + [ixCaseInsensitive];
+  FCaseinsFields:=AValue;
+end;
+
 constructor TIndexDef.Create(Owner: TIndexDefs; const AName, TheFields: string;
       TheOptions: TIndexOptions);