Browse Source

* Patch from Tony Whyman, adding DisplayWidth stored modified to TFIeld properties (bug 27768)

git-svn-id: trunk@30468 -
michael 10 years ago
parent
commit
5f1553c1e7
2 changed files with 8 additions and 1 deletions
  1. 2 1
      packages/fcl-db/src/base/db.pas
  2. 6 0
      packages/fcl-db/src/base/fields.inc

+ 2 - 1
packages/fcl-db/src/base/db.pas

@@ -315,6 +315,7 @@ type
     procedure SetReadOnly(const AValue: Boolean);
     procedure SetVisible(const AValue: Boolean);
     function IsDisplayStored : Boolean;
+    function IsDisplayWidthStored: Boolean;
     function GetLookupList: TLookupList;
     procedure CalcLookupValue;
   protected
@@ -429,7 +430,7 @@ type
     property ConstraintErrorMessage: string read FConstraintErrorMessage write FConstraintErrorMessage;
     property DefaultExpression: string read FDefaultExpression write FDefaultExpression;
     property DisplayLabel : string read GetDisplayName write SetDisplayLabel stored IsDisplayStored;
-    property DisplayWidth: Longint read GetDisplayWidth write SetDisplayWidth;
+    property DisplayWidth: Longint read GetDisplayWidth write SetDisplayWidth stored IsDisplayWidthStored;
     property FieldKind: TFieldKind read FFieldKind write FFieldKind;
     property FieldName: string read FFieldName write FFieldName;
     property HasConstraints: Boolean read FHasConstraints;

+ 6 - 0
packages/fcl-db/src/base/fields.inc

@@ -632,6 +632,12 @@ begin
   Result:=(DisplayLabel<>FieldName);
 end;
 
+Function TField.IsDisplayWidthStored : Boolean;
+
+begin
+  Result:=(FDisplayWidth<>0);
+end;
+
 function TField.GetLookupList: TLookupList;
 begin
   if not Assigned(FLookupList) then