(Qt): Commited workaround for issue #9746 (ListOutOfBounds in TCustomListView), fixed warning about uninitialized variable in EnumFontFamiliesEx()

git-svn-id: trunk@12117 -
This commit is contained in:
zeljko 2007-09-21 18:53:38 +00:00
parent e05a24834f
commit 7da21924fb
2 changed files with 18 additions and 0 deletions

View File

@ -1370,6 +1370,7 @@ begin
(lpLogFont^.lfFaceName= '') and
(lpLogFont^.lfPitchAndFamily = 0) then
begin
FontType := 0;
FontList := TStringList.create;
try
if QtGetFontFamilies(FontList) > 0 then

View File

@ -910,11 +910,28 @@ end;
class procedure TQtWSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer);
var
TW: QTreeWidgetH;
QtItem: QTreeWidgetItemH;
Item: TListItem;
begin
if not WSCheckHandleAllocated(ALV, 'ItemDelete') then
Exit;
TW := QTreeWidgetH(TQtTreeWidget(ALV.Handle).Widget);
QTreeWidget_takeTopLevelItem(TW, AIndex);
{$note FIXME workaround issue #9746}
{workaround for ListOutOfBounds in some cases. Described with issue #9746}
QtItem := QTreeWidget_currentItem(TW);
if QtItem <> nil then
begin
Item := ALV.Selected;
if Assigned(Item) then
begin
if Item.Index <> QTreeWidget_indexOfTopLevelItem(TW, QtItem) then
TListView(ALV).Items[QTreeWidget_indexOfTopLevelItem(TW, QtItem)].Selected := True;
end;
end;
end;
{------------------------------------------------------------------------------