mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 19:35:59 +02:00
gtk: a more safer code for dashes allocation
git-svn-id: trunk@22156 -
This commit is contained in:
parent
08748087fa
commit
83c67a0a1b
@ -8,7 +8,7 @@
|
||||
* *
|
||||
* This file is part of the Lazarus Component Library (LCL) *
|
||||
* *
|
||||
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
|
||||
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
|
||||
* for details about the copyright. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
|
@ -4013,9 +4013,13 @@ begin
|
||||
GObject^.GDIPenWidth := dwWidth;
|
||||
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
|
||||
GObject^.GDIPenDashesCount := dwStyleCount;
|
||||
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
||||
for i := 0 to dwStyleCount - 1 do
|
||||
GObject^.GDIPenDashes[i] := lpStyle[i];
|
||||
|
||||
if dwStyleCount > 0 then
|
||||
begin
|
||||
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
||||
for i := 0 to dwStyleCount - 1 do
|
||||
GObject^.GDIPenDashes[i] := lpStyle[i];
|
||||
end;
|
||||
|
||||
Result := HPEN(PtrUInt(GObject));
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user