cocoa: cleaning up compiler warnings

git-svn-id: trunk@58833 -
This commit is contained in:
dmitry 2018-09-02 23:08:24 +00:00
parent 7f94fae32a
commit 8032ce639a
4 changed files with 9 additions and 6 deletions

View File

@ -164,6 +164,7 @@ begin
Result := 0
else
begin
Result := 0; // getting rid of compiler warning
for y := 0 to ImageRep.pixelsHigh - 1 do
for x := 0 to ImageRep.pixelsWide - 1 do
begin

View File

@ -2089,6 +2089,7 @@ var
lView: NSView;
begin
Obj := NSObject(Handle);
Result := 0; // should return 0, if function fails
if Assigned(Obj) and NSApp.isActive then
begin
Result := HWND(NSApp.keyWindow);
@ -2098,9 +2099,7 @@ begin
begin
lView := GetNSObjectView(Obj);
if lView <> nil then
lView.window.makeKeyWindow
else
Result := 0;
lView.window.makeKeyWindow;
end;
end;
end;

View File

@ -1138,6 +1138,8 @@ begin
// the window doesn't have screen assigned.
// figuring out the placement based of the Left/Top of the rect
// and NSrects;
fnd := false;
srect := NSMakeRect(0,0,0,0); // making the compiler happy
p.x:=r.Left;
p.y:=r.Top;
for sc in NSScreen.screens do begin

View File

@ -784,6 +784,10 @@ begin
SendChar := False;
VKKeyCode := VK_UNKNOWN;
UTF8Character := '';
KeyChar := #0;
VKKeyChar := #0;
IsSysKey := (Event.modifierFlags and NSCommandKeyMask) <> 0;
KeyData := (Ord(Event.isARepeat) + 1) or Event.keyCode shl 16;
if (Event.modifierFlags and NSAlternateKeyMask) <> 0 then
@ -934,8 +938,6 @@ begin
end;
procedure TLCLCommonCallback.KeyEvBeforeDown(var AllowCocoaHandle: boolean);
var
OrigChar: AnsiString;
begin
// create the CN_KEYDOWN message
if _IsSysKey then
@ -979,7 +981,6 @@ begin
// send the UTF8 keypress
OrigChar := _UTF8Character;
if Target.IntfUTF8KeyPress(_UTF8Character, 1, _IsSysKey) then
begin
// the LCL has handled the key