< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 622,632 **** // same as above, but converts to RTFD - (NSData *)accessibleSelectedTextAsRTFD { NSString *selectedText = [self accessibleSelectedText]; NSAttributedString *styledText = [[NSAttributedString alloc] initWithString:selectedText]; ! NSData *rtfdData = [styledText RTFDFromRange:NSMakeRange(0, [styledText length]) documentAttributes:nil]; [styledText release]; return rtfdData; } // finds the focused accessible element, and if it is a text element, sets the text in it --- 622,633 ---- // same as above, but converts to RTFD - (NSData *)accessibleSelectedTextAsRTFD { NSString *selectedText = [self accessibleSelectedText]; NSAttributedString *styledText = [[NSAttributedString alloc] initWithString:selectedText]; ! NSData *rtfdData = [styledText RTFDFromRange:NSMakeRange(0, [styledText length]) ! documentAttributes:@{NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType}]; [styledText release]; return rtfdData; } // finds the focused accessible element, and if it is a text element, sets the text in it
*** 679,689 **** } if ([[pboard types] containsObject:NSRTFDPboardType]) { NSData *rtfdData = [pboard dataForType:NSRTFDPboardType]; ! NSAttributedString *styledText = [[NSAttributedString alloc] initWithRTFD:rtfdData documentAttributes:nil]; NSString *text = [styledText string]; [styledText release]; return [self replaceAccessibleTextSelection:text]; } --- 680,690 ---- } if ([[pboard types] containsObject:NSRTFDPboardType]) { NSData *rtfdData = [pboard dataForType:NSRTFDPboardType]; ! NSAttributedString *styledText = [[NSAttributedString alloc] initWithRTFD:rtfdData documentAttributes:NULL]; NSString *text = [styledText string]; [styledText release]; return [self replaceAccessibleTextSelection:text]; }
< prev index next >