diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index ee78c59fa..d987679bc 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -267,18 +267,18 @@ var kDelegateRespondsTo_textShouldBeginEditing _copySelectionGranularity = _previousSelectionGranularity; [super copy:sender]; - if ([self isRichText]) - { - var stringForPasting = [_textStorage attributedSubstringFromRange:CPMakeRangeCopy(selectedRange)]; + if (![self isRichText]) + return; - // put rich representation on the pasteboad only if we have multliple attributes selected - if (stringForPasting._rangeEntries.length > 1) - { - var richData = [_CPRTFProducer produceRTF:stringForPasting documentAttributes:@{}]; - // [pasteboard declareTypes:[CPStringPboardType, CPRichStringPboardType] owner:nil]; // this does currently do not work due to limitations in cappuccino - [pasteboard setString:richData forType:CPStringPboardType]; // crude hack to make rich pasting possible in chrome and firefox: put rtf on the plain pasteboard - } - } + var stringForPasting = [_textStorage attributedSubstringFromRange:CPMakeRangeCopy(selectedRange)]; + + // put rich representation on the pasteboad only if we have multliple attributes selected + if (stringForPasting._rangeEntries.length > 1) + { + var richData = [_CPRTFProducer produceRTF:stringForPasting documentAttributes:@{}]; + // [pasteboard declareTypes:[CPStringPboardType, CPRichStringPboardType] owner:nil]; // this does currently do not work due to limitations in cappuccino + [pasteboard setString:richData forType:CPStringPboardType]; // crude hack to make rich pasting possible in chrome and firefox: put rtf on the plain pasteboard + } } - (void)paste:(id)sender