mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-20 21:49:22 +00:00
Fixed: conflict with auto-merge in CPTextView
This commit is contained in:
commit
9545e0145f
2 files changed
+15
-17
No files matched your search
+2
-4
@@ -120,22 +120,20 @@ CPKernAttributeName = @"CPKernAttributeName";
|
||||
{
|
||||
[self willChangeValueForKey:@"selectable"];
|
||||
_isSelectable = flag;
|
||||
[self didChangeValueForKey:@"selectable"];
|
||||
|
||||
if (!flag)
|
||||
[self setEditable:flag];
|
||||
|
||||
[self didChangeValueForKey:@"selectable"];
|
||||
}
|
||||
|
||||
- (void)setEditable:(BOOL)flag
|
||||
{
|
||||
[self willChangeValueForKey:@"editable"];
|
||||
_isEditable = flag;
|
||||
[self didChangeValueForKey:@"editable"];
|
||||
|
||||
if (flag)
|
||||
[self setSelectable:flag];
|
||||
|
||||
[self didChangeValueForKey:@"editable"];
|
||||
}
|
||||
|
||||
- (void)changeFont:(id)sender
|
||||
|
||||
@@ -270,20 +270,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
_copySelectionGranularity = _previousSelectionGranularity;
|
||||
[super copy:sender];
|
||||
|
||||
if ([self isRichText])
|
||||
{
|
||||
var selectedRange = [self selectedRange],
|
||||
pasteboard = [CPPasteboard generalPasteboard],
|
||||
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 selectedRange = [self selectedRange],
|
||||
pasteboard = [CPPasteboard generalPasteboard],
|
||||
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