diff options
| author | Neil Hodgson <nyamatongwe@gmail.com> | 2017-06-07 16:23:06 +1000 |
|---|---|---|
| committer | Neil Hodgson <nyamatongwe@gmail.com> | 2017-06-07 16:23:06 +1000 |
| commit | 7401309e8c5e8caa1e8ce4d1872cb70030fc7f64 (patch) | |
| tree | b81231fd2812837015b5d74a10ccd5a7365ad326 /cocoa/PlatCocoa.mm | |
| parent | 74977b1699cdf34bf8146b65a6daf7c48b288ee5 (diff) | |
| download | scintilla-mirror-7401309e8c5e8caa1e8ce4d1872cb70030fc7f64.tar.gz | |
Using modern Objective C literals and indexing.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
| -rw-r--r-- | cocoa/PlatCocoa.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 238e1c741..aaf714e52 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1315,7 +1315,7 @@ void Window::SetTitle(const char* s) if ([idWin isKindOfClass: [NSWindow class]]) { NSWindow* win = idWin; - NSString* sTitle = [NSString stringWithUTF8String:s]; + NSString* sTitle = @(s); [win setTitle:sTitle]; } } @@ -1829,7 +1829,7 @@ void ListBoxImpl::RegisterImage(int type, const char* xpm_data) { XPM xpm(xpm_data); NSImage* img = ImageFromXPM(&xpm); - [images setObject:img forKey:@(type)]; + images[@(type)] = img; } void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) @@ -1837,7 +1837,7 @@ void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsig CGImageRef imageRef = ImageCreateFromRGBA(width, height, pixelsImage, false); NSImage *img = [[NSImage alloc] initWithCGImage:imageRef size: NSZeroSize]; CGImageRelease(imageRef); - [images setObject:img forKey:@(type)]; + images[@(type)] = img; } void ListBoxImpl::ClearRegisteredImages() @@ -1860,7 +1860,7 @@ NSString* ListBoxImpl::TextForRow(NSInteger row) const char* textString = ld.GetString(row); NSString* sTitle; if (unicodeMode) - sTitle = [NSString stringWithUTF8String:textString]; + sTitle = @(textString); else sTitle = [NSString stringWithCString:textString encoding:NSWindowsCP1252StringEncoding]; return sTitle; |
