mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 01:39:18 +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
|
if ItemIndex < 0 then
|
||||||
ItemIndex := 0;
|
ItemIndex := 0;
|
||||||
|
|
||||||
MeasureItemStruct.itemID := ItemIndex;
|
MeasureItemStruct.itemID := UINT(ItemIndex);
|
||||||
MeasureItemStruct.itemWidth := width^;
|
MeasureItemStruct.itemWidth := UINT(width^);
|
||||||
MeasureItemStruct.itemHeight := height^;
|
MeasureItemStruct.itemHeight := UINT(height^);
|
||||||
Msg.Msg := LM_MEASUREITEM;
|
Msg.Msg := LM_MEASUREITEM;
|
||||||
Msg.MeasureItemStruct := @MeasureItemStruct;
|
Msg.MeasureItemStruct := @MeasureItemStruct;
|
||||||
DeliverMessage(AWinControl, Msg);
|
DeliverMessage(AWinControl, Msg);
|
||||||
width^ := MeasureItemStruct.itemWidth;
|
width^ := gint(MeasureItemStruct.itemWidth);
|
||||||
height^ := MeasureItemStruct.itemHeight;
|
height^ := gint(MeasureItemStruct.itemHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GtkCellRendererStateToListViewDrawState(CellState: TGtkCellRendererState): TCustomDrawState;
|
function GtkCellRendererStateToListViewDrawState(CellState: TGtkCellRendererState): TCustomDrawState;
|
||||||
@ -271,7 +271,7 @@ begin
|
|||||||
try
|
try
|
||||||
FillChar(Msg.DrawListItemStruct^,SizeOf(TDrawListItemStruct),0);
|
FillChar(Msg.DrawListItemStruct^,SizeOf(TDrawListItemStruct),0);
|
||||||
with Msg.DrawListItemStruct^ do begin
|
with Msg.DrawListItemStruct^ do begin
|
||||||
ItemID:=ItemIndex;
|
ItemID:=UINT(ItemIndex);
|
||||||
Area:=AreaRect;
|
Area:=AreaRect;
|
||||||
//DebugLn(['LCLIntfCellRenderer_Render Widget=',GetWidgetDebugReport(Widget^.parent),' Area=',dbgs(Area)]);
|
//DebugLn(['LCLIntfCellRenderer_Render Widget=',GetWidgetDebugReport(Widget^.parent),' Area=',dbgs(Area)]);
|
||||||
DCWidget:=Widget;
|
DCWidget:=Widget;
|
||||||
|
@ -7687,7 +7687,7 @@ begin
|
|||||||
dec(R.Bottom);
|
dec(R.Bottom);
|
||||||
QPainter_setClipRect(TQTDeviceContext(Msg.DC).Widget, @R);
|
QPainter_setClipRect(TQTDeviceContext(Msg.DC).Widget, @R);
|
||||||
|
|
||||||
DrawStruct.ItemID := CurrIndex;
|
DrawStruct.ItemID := UINT(CurrIndex);
|
||||||
DrawStruct.Area := R;
|
DrawStruct.Area := R;
|
||||||
DrawStruct.DC := Msg.DC;
|
DrawStruct.DC := Msg.DC;
|
||||||
|
|
||||||
@ -8811,7 +8811,7 @@ var
|
|||||||
begin
|
begin
|
||||||
QPainter_save(painter);
|
QPainter_save(painter);
|
||||||
State := QStyleOption_state(option);
|
State := QStyleOption_state(option);
|
||||||
DrawStruct.ItemID := QModelIndex_row(index);
|
DrawStruct.ItemID := UINT(QModelIndex_row(index));
|
||||||
|
|
||||||
DrawStruct.Area := visualRect(index);
|
DrawStruct.Area := visualRect(index);
|
||||||
DrawStruct.DC := HDC(TQtDeviceContext.CreateFromPainter(painter));
|
DrawStruct.DC := HDC(TQtDeviceContext.CreateFromPainter(painter));
|
||||||
@ -11029,7 +11029,7 @@ begin
|
|||||||
QPaintEvent_Rect(QPaintEventH(Event), ClipRect);
|
QPaintEvent_Rect(QPaintEventH(Event), ClipRect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ItemStruct^.itemID := ID;
|
ItemStruct^.itemID := UINT(ID);
|
||||||
ItemStruct^._hDC := BeginPaint(THandle(Self), AStruct);
|
ItemStruct^._hDC := BeginPaint(THandle(Self), AStruct);
|
||||||
FContext := ItemStruct^._hDC;
|
FContext := ItemStruct^._hDC;
|
||||||
ItemStruct^.rcItem := PaintData.ClipRect^;
|
ItemStruct^.rcItem := PaintData.ClipRect^;
|
||||||
@ -12593,14 +12593,14 @@ var
|
|||||||
Msg: TLMMeasureItem;
|
Msg: TLMMeasureItem;
|
||||||
MeasureItemStruct: TMeasureItemStruct;
|
MeasureItemStruct: TMeasureItemStruct;
|
||||||
begin
|
begin
|
||||||
MeasureItemStruct.itemID := QModelIndex_row(index);
|
MeasureItemStruct.itemID := UINT(QModelIndex_row(index));
|
||||||
MeasureItemStruct.itemWidth := Size^.cx;
|
MeasureItemStruct.itemWidth := UINT(Size^.cx);
|
||||||
MeasureItemStruct.itemHeight := Size^.cy;
|
MeasureItemStruct.itemHeight := UINT(Size^.cy);
|
||||||
Msg.Msg := LM_MEASUREITEM;
|
Msg.Msg := LM_MEASUREITEM;
|
||||||
Msg.MeasureItemStruct := @MeasureItemStruct;
|
Msg.MeasureItemStruct := @MeasureItemStruct;
|
||||||
DeliverMessage(Msg);
|
DeliverMessage(Msg);
|
||||||
Size^.cx := MeasureItemStruct.itemWidth;
|
Size^.cx := Longint(MeasureItemStruct.itemWidth);
|
||||||
Size^.cy := MeasureItemStruct.itemHeight;
|
Size^.cy := Longint(MeasureItemStruct.itemHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtAbstractItemView.ItemDelegatePaint(painter: QPainterH;
|
procedure TQtAbstractItemView.ItemDelegatePaint(painter: QPainterH;
|
||||||
|
@ -433,7 +433,7 @@ type
|
|||||||
|
|
||||||
TLMMouse = record
|
TLMMouse = record
|
||||||
Msg : Cardinal;
|
Msg : Cardinal;
|
||||||
Keys: PtrInt;
|
Keys: PtrUInt;
|
||||||
case Integer of
|
case Integer of
|
||||||
0: (
|
0: (
|
||||||
XPos: SmallInt;
|
XPos: SmallInt;
|
||||||
|
Loading…
Reference in New Issue
Block a user