mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:39:37 +02:00
(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:
parent
e05a24834f
commit
7da21924fb
@ -1370,6 +1370,7 @@ begin
|
||||
(lpLogFont^.lfFaceName= '') and
|
||||
(lpLogFont^.lfPitchAndFamily = 0) then
|
||||
begin
|
||||
FontType := 0;
|
||||
FontList := TStringList.create;
|
||||
try
|
||||
if QtGetFontFamilies(FontList) > 0 then
|
||||
|
@ -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;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user