formatting

This commit is contained in:
daboe01 committed 2015-09-30 19:46:18 +02:00
1 parent 1d3a8bcacd
commit 0afb62ee88
1 file changed
+11 -11
+11 -11
View File
@@ -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