* added const to SetIndex declaration

* implemented TField.GetClassDesc
 * TBlobField.AsString now returns an empty string if the field is null, and displaytext returns (blob)

git-svn-id: trunk@6280 -
This commit is contained in:
joost 2007-01-31 23:04:59 +00:00
parent 8865987fb3
commit 03c9f47f2d
2 changed files with 16 additions and 5 deletions

View File

@ -274,7 +274,7 @@ type
FProviderFlags : TProviderFlags; FProviderFlags : TProviderFlags;
Function GetIndex : longint; Function GetIndex : longint;
procedure SetAlignment(const AValue: TAlignMent); procedure SetAlignment(const AValue: TAlignMent);
procedure SetIndex(AValue: Integer); procedure SetIndex(const AValue: Integer);
Procedure SetDataset(AValue : TDataset); Procedure SetDataset(AValue : TDataset);
function GetDisplayText: String; function GetDisplayText: String;
function GetEditText: String; function GetEditText: String;
@ -305,6 +305,7 @@ type
function GetOldValue: variant; virtual; function GetOldValue: variant; virtual;
function GetAsString: string; virtual; function GetAsString: string; virtual;
function GetCanModify: Boolean; virtual; function GetCanModify: Boolean; virtual;
function GetClassDesc: String; virtual;
function GetDataSize: Word; virtual; function GetDataSize: Word; virtual;
function GetDefaultWidth: Longint; virtual; function GetDefaultWidth: Longint; virtual;
function GetDisplayName : String; function GetDisplayName : String;

View File

@ -474,7 +474,7 @@ end;
function TField.GetAsString: string; function TField.GetAsString: string;
begin begin
Raise AccessError(SString); Result := GetClassDesc;
end; end;
function TField.GetOldValue: Variant; function TField.GetOldValue: Variant;
@ -545,6 +545,16 @@ begin
end; end;
end; end;
function TField.GetClassDesc: String;
var ClassN : string;
begin
ClassN := copy(ClassName,2,pos('Field',ClassName)-2);
if isNull then
result := '(' + LowerCase(ClassN) + ')'
else
result := '(' + UpperCase(ClassN) + ')';
end;
function TField.GetData(Buffer: Pointer): Boolean; function TField.GetData(Buffer: Pointer): Boolean;
begin begin
@ -637,7 +647,7 @@ begin
end; end;
end; end;
procedure TField.SetIndex(AValue: Integer); procedure TField.SetIndex(const AValue: Integer);
begin begin
if FFields <> nil then FFields.SetFieldIndex(Self, AValue) if FFields <> nil then FFields.SetFieldIndex(Self, AValue)
end; end;
@ -2228,7 +2238,7 @@ begin
Free Free
end end
else else
Result := '(blob)'; Result := '';
end; end;
function TBlobField.GetAsVariant: Variant; function TBlobField.GetAsVariant: Variant;
@ -2280,7 +2290,7 @@ end;
procedure TBlobField.GetText(var TheText: string; ADisplayText: Boolean); procedure TBlobField.GetText(var TheText: string; ADisplayText: Boolean);
begin begin
TheText:=GetAsString; TheText:=inherited GetAsString;
end; end;