mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
LCL: TLMMouse.Keys:PtrInt becomes TLMMouse.Keys: PtrUInt to avoid range check errors.
Qt, Gtk2: added various type casts to avoid range check errors. Patches by Juha Manninen. fixes #17531 git-svn-id: trunk@27786 -
This commit is contained in:
parent
16f53a6e50
commit
28632554b9
@ -127,14 +127,14 @@ begin
|
||||
if ItemIndex < 0 then
|
||||
ItemIndex := 0;
|
||||
|
||||
MeasureItemStruct.itemID := ItemIndex;
|
||||
MeasureItemStruct.itemWidth := width^;
|
||||
MeasureItemStruct.itemHeight := height^;
|
||||
MeasureItemStruct.itemID := UINT(ItemIndex);
|
||||
MeasureItemStruct.itemWidth := UINT(width^);
|
||||
MeasureItemStruct.itemHeight := UINT(height^);
|
||||
Msg.Msg := LM_MEASUREITEM;
|
||||
Msg.MeasureItemStruct := @MeasureItemStruct;
|
||||
DeliverMessage(AWinControl, Msg);
|
||||
width^ := MeasureItemStruct.itemWidth;
|
||||
height^ := MeasureItemStruct.itemHeight;
|
||||
width^ := gint(MeasureItemStruct.itemWidth);
|
||||
height^ := gint(MeasureItemStruct.itemHeight);
|
||||
end;
|
||||
|
||||
function GtkCellRendererStateToListViewDrawState(CellState: TGtkCellRendererState): TCustomDrawState;
|
||||
@ -271,7 +271,7 @@ begin
|
||||
try
|
||||
FillChar(Msg.DrawListItemStruct^,SizeOf(TDrawListItemStruct),0);
|
||||
with Msg.DrawListItemStruct^ do begin
|
||||
ItemID:=ItemIndex;
|
||||
ItemID:=UINT(ItemIndex);
|
||||
Area:=AreaRect;
|
||||
//DebugLn(['LCLIntfCellRenderer_Render Widget=',GetWidgetDebugReport(Widget^.parent),' Area=',dbgs(Area)]);
|
||||
DCWidget:=Widget;
|
||||
|
@ -7687,7 +7687,7 @@ begin
|
||||
dec(R.Bottom);
|
||||
QPainter_setClipRect(TQTDeviceContext(Msg.DC).Widget, @R);
|
||||
|
||||
DrawStruct.ItemID := CurrIndex;
|
||||
DrawStruct.ItemID := UINT(CurrIndex);
|
||||
DrawStruct.Area := R;
|
||||
DrawStruct.DC := Msg.DC;
|
||||
|
||||
@ -8811,7 +8811,7 @@ var
|
||||
begin
|
||||
QPainter_save(painter);
|
||||
State := QStyleOption_state(option);
|
||||
DrawStruct.ItemID := QModelIndex_row(index);
|
||||
DrawStruct.ItemID := UINT(QModelIndex_row(index));
|
||||
|
||||
DrawStruct.Area := visualRect(index);
|
||||
DrawStruct.DC := HDC(TQtDeviceContext.CreateFromPainter(painter));
|
||||
@ -11029,7 +11029,7 @@ begin
|
||||
QPaintEvent_Rect(QPaintEventH(Event), ClipRect);
|
||||
end;
|
||||
|
||||
ItemStruct^.itemID := ID;
|
||||
ItemStruct^.itemID := UINT(ID);
|
||||
ItemStruct^._hDC := BeginPaint(THandle(Self), AStruct);
|
||||
FContext := ItemStruct^._hDC;
|
||||
ItemStruct^.rcItem := PaintData.ClipRect^;
|
||||
@ -12593,14 +12593,14 @@ var
|
||||
Msg: TLMMeasureItem;
|
||||
MeasureItemStruct: TMeasureItemStruct;
|
||||
begin
|
||||
MeasureItemStruct.itemID := QModelIndex_row(index);
|
||||
MeasureItemStruct.itemWidth := Size^.cx;
|
||||
MeasureItemStruct.itemHeight := Size^.cy;
|
||||
MeasureItemStruct.itemID := UINT(QModelIndex_row(index));
|
||||
MeasureItemStruct.itemWidth := UINT(Size^.cx);
|
||||
MeasureItemStruct.itemHeight := UINT(Size^.cy);
|
||||
Msg.Msg := LM_MEASUREITEM;
|
||||
Msg.MeasureItemStruct := @MeasureItemStruct;
|
||||
DeliverMessage(Msg);
|
||||
Size^.cx := MeasureItemStruct.itemWidth;
|
||||
Size^.cy := MeasureItemStruct.itemHeight;
|
||||
Size^.cx := Longint(MeasureItemStruct.itemWidth);
|
||||
Size^.cy := Longint(MeasureItemStruct.itemHeight);
|
||||
end;
|
||||
|
||||
procedure TQtAbstractItemView.ItemDelegatePaint(painter: QPainterH;
|
||||
|
@ -433,7 +433,7 @@ type
|
||||
|
||||
TLMMouse = record
|
||||
Msg : Cardinal;
|
||||
Keys: PtrInt;
|
||||
Keys: PtrUInt;
|
||||
case Integer of
|
||||
0: (
|
||||
XPos: SmallInt;
|
||||
|
Loading…
Reference in New Issue
Block a user