mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +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) *
|
* 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. *
|
* for details about the copyright. *
|
||||||
* *
|
* *
|
||||||
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
@ -4013,9 +4013,13 @@ begin
|
|||||||
GObject^.GDIPenWidth := dwWidth;
|
GObject^.GDIPenWidth := dwWidth;
|
||||||
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
|
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
|
||||||
GObject^.GDIPenDashesCount := dwStyleCount;
|
GObject^.GDIPenDashesCount := dwStyleCount;
|
||||||
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
|
||||||
for i := 0 to dwStyleCount - 1 do
|
if dwStyleCount > 0 then
|
||||||
GObject^.GDIPenDashes[i] := lpStyle[i];
|
begin
|
||||||
|
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
||||||
|
for i := 0 to dwStyleCount - 1 do
|
||||||
|
GObject^.GDIPenDashes[i] := lpStyle[i];
|
||||||
|
end;
|
||||||
|
|
||||||
Result := HPEN(PtrUInt(GObject));
|
Result := HPEN(PtrUInt(GObject));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user