mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 18:52:19 +00:00
formatting
This commit is contained in:
1 parent
1d3a8bcacd
commit
0afb62ee88
1 file changed
+11
-11
@@ -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
|
||||
|
||||
Reference in new issue
Block a user