* Fixed accessing TCustomBufDataset.IndexName and CompareBookmarks from a new instance (bug 16695+adapted test)

git-svn-id: trunk@15412 -
This commit is contained in:
joost 2010-06-12 11:42:38 +00:00
parent 39adedb12a
commit fb3ede2ef7
2 changed files with 7 additions and 2 deletions

View File

@ -2206,7 +2206,10 @@ end;
function TCustomBufDataset.GetIndexName: String; function TCustomBufDataset.GetIndexName: String;
begin begin
result := FCurrentIndex.Name; if FIndexesCount>0 then
result := FCurrentIndex.Name
else
result := '';
end; end;
function TCustomBufDataset.GetBufUniDirectional: boolean; function TCustomBufDataset.GetBufUniDirectional: boolean;
@ -2633,7 +2636,7 @@ end;
function TCustomBufDataset.CompareBookmarks(Bookmark1, Bookmark2: TBookmark function TCustomBufDataset.CompareBookmarks(Bookmark1, Bookmark2: TBookmark
): Longint; ): Longint;
begin begin
if FCurrentIndex.CompareBookmarks(Bookmark1,Bookmark2) then if Assigned(FCurrentIndex) and FCurrentIndex.CompareBookmarks(Bookmark1,Bookmark2) then
Result := 0 Result := 0
else else
Result := -1; Result := -1;

View File

@ -543,6 +543,8 @@ var s : string;
begin begin
bufds := DBConnector.GetNDataset(5) as TCustomBufDataset; bufds := DBConnector.GetNDataset(5) as TCustomBufDataset;
s := bufds.IndexFieldNames; s := bufds.IndexFieldNames;
s := bufds.IndexName;
bufds.CompareBookmarks(nil,nil);
end; end;
procedure TTestDBBasics.TestCanModifySpecialFields; procedure TTestDBBasics.TestCanModifySpecialFields;