From 556422516cc6be4fa87f0e3f577b862b40f6ad2c Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 24 Jan 2011 15:01:29 +0000 Subject: [PATCH] merge 1.3 r892:893 into 1.4 and trunk --- lib/platform/COSXKeyState.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/platform/COSXKeyState.cpp b/lib/platform/COSXKeyState.cpp index 5f3f7f88..c77f0941 100644 --- a/lib/platform/COSXKeyState.cpp +++ b/lib/platform/COSXKeyState.cpp @@ -270,20 +270,17 @@ COSXKeyState::mapKeyFromEvent(CKeyIDs& ids, return 0; } - const bool layoutValid = false; - const UCKeyboardLayout* layout; - // translate via uchr resource #if defined(MAC_OS_X_VERSION_10_5) CFDataRef ref = (CFDataRef) TISGetInputSourceProperty(currentKeyboardLayout, kTISPropertyUnicodeKeyLayoutData); - layout = (const UCKeyboardLayout*) CFDataGetBytePtr(ref); - layoutValid = (layout != null); + const UCKeyboardLayout* layout = (const UCKeyboardLayout*) CFDataGetBytePtr(ref); + const bool layoutValid = (layout != NULL); #else const void* resource; int err = KLGetKeyboardLayoutProperty(currentKeyboardLayout, kKLuchrData, &resource); - layoutValid == (err == noErr); - layout = (const UCKeyboardLayout*)resource; + const bool layoutValid == (err == noErr); + const UCKeyboardLayout* layout = (const UCKeyboardLayout*)resource; #endif if (layoutValid) { @@ -423,7 +420,7 @@ COSXKeyState::getKeyMap(CKeyMap& keyMap) // NB: not sure why support for KCHR was // remvoed in 10.5 version? - #if defined(MAC_OS_X_VERSION_10_5) + #if !defined(MAC_OS_X_VERSION_10_5) // try KCHR resource if (KLGetKeyboardLayoutProperty(m_groups[g], kKLKCHRData, &resource) == noErr) {