Fixes a crash on qt when the owner of a common dialog isn't a TWinControl.

git-svn-id: trunk@10103 -
This commit is contained in:
sekelsenmat 2006-10-25 01:01:19 +00:00
parent f6026e16c4
commit ddb0dca64d
2 changed files with 8 additions and 7 deletions

View File

@ -889,7 +889,7 @@ begin
Pixmap := TQtPixmap.Create(PScreenSize);
try
GetMem(NewRawImage.Mask, 1); // Creates a dummy mask
NewRawImage.Mask := GetMem(1); // Creates a dummy mask
Pixmap.grabWindow(WinID);
@ -899,7 +899,7 @@ begin
NewRawImage.DataSize := QImage_numBytes(Image);
GetMem(NewRawImage.Data, QImage_numBytes(Image));
NewRawImage.Data := GetMem(QImage_numBytes(Image));
Move(QImage_bits(Image)^, NewRawImage.Data^, QImage_numBytes(Image));
finally
@ -913,9 +913,9 @@ begin
end
else
begin
GetMem(NewRawImage.Mask, 1); // Creates a dummy mask
NewRawImage.Mask := GetMem(1); // Creates a dummy mask
GetMem(NewRawImage.Data, 1); // Creates a dummy data
NewRawImage.Data := GetMem(1); // Creates a dummy data
NewRawImage.Description.Width := SrcWidth;
NewRawImage.Description.Height := SrcHeight;

View File

@ -117,7 +117,7 @@ implementation
------------------------------------------------------------------------------}
class function TQtWSCommonDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
begin
Result := 1000;
Result := 0;
end;
{------------------------------------------------------------------------------
@ -143,8 +143,9 @@ begin
{------------------------------------------------------------------------------
Initialization of the dialog´s options
------------------------------------------------------------------------------}
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget;
if ACommonDialog.Owner is TWinControl then
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget
else Parent := nil;
ReturnText := '';
TmpFilter := '';