From 502fe6953ebc27dde3622ea9fa8313364c412217 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 20 Aug 2011 10:00:50 +1000 Subject: Replace call available only on 10.6 with sequence that works on 10.5. --- cocoa/PlatCocoa.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cocoa/PlatCocoa.mm') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 75803e33b..e2e2915f5 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1378,7 +1378,10 @@ static NSImage* ImageFromXPM(XPM* pxpm) img = [NSImage alloc]; [img autorelease]; CGImageRef imageRef = surfaceIXPM->GetImage(); - [img initWithCGImage:imageRef size:NSZeroSize]; + [img initWithSize:NSZeroSize]; + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; + [img addRepresentation: bitmapRep]; + [bitmapRep release]; CGImageRelease(imageRef); delete surfaceXPM; } @@ -1836,7 +1839,10 @@ void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsig [img autorelease]; CGImageRef imageRef = ImageFromRGBA(width, height, pixelsImage, false); NSSize sz = {width, height}; - [img initWithCGImage:imageRef size:sz]; + [img initWithSize: sz]; + NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; + [img addRepresentation: bitmapRep]; + [bitmapRep release]; CGImageRelease(imageRef); [img retain]; ImageMap::iterator it=images.find(type); -- cgit v1.2.3 From 29eb86f8dc7d6b95c364135443bf71e0c77dfc6a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 20 Aug 2011 10:21:43 +1000 Subject: Specify that AutoCompletionDataSource implements NSTableViewDataSource protocol only when building for later than 10.5 so SDK has to know about that protocol. --- cocoa/PlatCocoa.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cocoa/PlatCocoa.mm') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index e2e2915f5..22eadec0f 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1462,7 +1462,10 @@ public: class ListBoxImpl; @interface AutoCompletionDataSource : -NSObject +NSObject +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 + +#endif { ListBoxImpl* box; } -- cgit v1.2.3 From 4d5260e36e1353b0d317e4538ca252fa430e14c2 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 20 Aug 2011 10:24:06 +1000 Subject: Fix memory leak with images in autocompletion list. --- cocoa/PlatCocoa.mm | 1 - 1 file changed, 1 deletion(-) (limited to 'cocoa/PlatCocoa.mm') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 22eadec0f..fd66f671f 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1882,7 +1882,6 @@ NSImage* ListBoxImpl::ImageForRow(NSInteger row) if (it != images.end()) { NSImage* img = it->second; - [img retain]; return img; } else -- cgit v1.2.3