From: <el...@us...> - 2006-04-23 10:14:25
|
Revision: 10553 Author: elahn Date: 2006-04-23 03:14:10 -0700 (Sun, 23 Apr 2006) ViewCVS: http://svn.sourceforge.net/jvcl/?rev=10553&view=rev Log Message: ----------- Mantis #3657 Modified Paths: -------------- trunk/jvcl/run/JvDBSearchComboBox.pas Modified: trunk/jvcl/run/JvDBSearchComboBox.pas =================================================================== --- trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-23 09:42:11 UTC (rev 10552) +++ trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-23 10:14:10 UTC (rev 10553) @@ -363,7 +363,8 @@ if Assigned(FDataLink.DataSet) then for I := 0 to Items.Count - 1 do FDataLink.DataSet.FreeBookmark(Pointer(Items.Objects[I])); - Items.Clear; + if not (csDestroying in ComponentState) then + Items.Clear; end; function TJvDBCustomSearchComboBox.GetResult: Variant; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2006-04-24 17:09:30
|
Revision: 10563 Author: ahuser Date: 2006-04-24 10:09:19 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/jvcl/?rev=10563&view=rev Log Message: ----------- Fixed Mantis #3657: Error in JvDBSearchcomboBox Modified Paths: -------------- trunk/jvcl/run/JvDBSearchComboBox.pas Modified: trunk/jvcl/run/JvDBSearchComboBox.pas =================================================================== --- trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-23 13:05:58 UTC (rev 10562) +++ trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-24 17:09:19 UTC (rev 10563) @@ -68,6 +68,7 @@ FDataLink: TJvSearchComboBoxLink; FChanging: Boolean; FDataResult: string; + FBookmarks: TList; function GetDataField: string; function GetDataSource: TDataSource; procedure SetDataField(const Value: string); @@ -252,6 +253,7 @@ constructor TJvDBCustomSearchComboBox.Create(AOwner: TComponent); begin inherited Create(AOwner); + FBookmarks := TList.Create; FDataLink := TJvSearchComboBoxLink.Create(Self); FChanging := False; end; @@ -259,6 +261,7 @@ destructor TJvDBCustomSearchComboBox.Destroy; begin ClearList; + FBookmarks.Free; FDataLink.Free; FDataLink := nil; // Notification() is called by inherited Destroy inherited Destroy; @@ -329,7 +332,7 @@ N, CurIndex: Integer; begin if (FDataLink.DataField = nil) or (FDataLink.DataSet = nil) or - (not FDataLink.DataSet.Active) then + (not FDataLink.DataSet.Active) then Exit; ClearList; CurIndex := -1; @@ -342,7 +345,8 @@ First; while not EOF do begin - Items.AddObject(FieldByName(FDataLink.FDataFieldName).DisplayText, GetBookmark); + FBookmarks.Add(GetBookmark); + Items.AddObject(FieldByName(FDataLink.FDataFieldName).DisplayText, FBookmarks.Last); if Bookmark = Bmrk then CurIndex := N; Inc(N); @@ -361,9 +365,9 @@ I: Integer; begin if Assigned(FDataLink.DataSet) then - for I := 0 to Items.Count - 1 do - FDataLink.DataSet.FreeBookmark(Pointer(Items.Objects[I])); - if not (csDestroying in ComponentState) then + for I := 0 to FBookmarks.Count - 1 do + FDataLink.DataSet.FreeBookmark(FBookmarks[I]); + if HandleAllocated then // TCustomComboBox uses SendMessage(Handle, ...) to obtain count Items.Clear; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ah...@us...> - 2006-04-24 19:55:53
|
Revision: 10564 Author: ahuser Date: 2006-04-24 12:55:35 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/jvcl/?rev=10564&view=rev Log Message: ----------- Fixed Mantis Fixed Mantis #3657: (2) Error in JvDBSearchcomboBox Modified Paths: -------------- trunk/jvcl/run/JvDBSearchComboBox.pas Modified: trunk/jvcl/run/JvDBSearchComboBox.pas =================================================================== --- trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-24 17:09:19 UTC (rev 10563) +++ trunk/jvcl/run/JvDBSearchComboBox.pas 2006-04-24 19:55:35 UTC (rev 10564) @@ -261,10 +261,10 @@ destructor TJvDBCustomSearchComboBox.Destroy; begin ClearList; - FBookmarks.Free; FDataLink.Free; FDataLink := nil; // Notification() is called by inherited Destroy inherited Destroy; + FBookmarks.Free; end; procedure TJvDBCustomSearchComboBox.Notification(Component: TComponent; Operation: TOperation); @@ -367,7 +367,8 @@ if Assigned(FDataLink.DataSet) then for I := 0 to FBookmarks.Count - 1 do FDataLink.DataSet.FreeBookmark(FBookmarks[I]); - if HandleAllocated then // TCustomComboBox uses SendMessage(Handle, ...) to obtain count + FBookmarks.Clear; + if HandleAllocated and not (csDestroying in ComponentState) then // TCustomComboBox uses SendMessage(Handle, ...) to clear items Items.Clear; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |