Fix a bug that prevented changing the color of the selected text of a

text view via drag and drop.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-01-09 09:09:57 +00:00
parent 83ce1aeeca
commit db53bb1c7f
2 changed files with 17 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2010-01-09 Wolfgang Lux <wolfgang.lux@mail.com>
* Source/NSTextView.m (-performDragOperation:): Fix a bug that
prevented changing the color of the selected text of a text view
via drag and drop.
2010-01-08 Riccardo Mottola <rmottola@users.sf.net>
* Source/NSScroller: init scrollerWidth to 0.0, so that GSTheme
@ -710,7 +716,7 @@
* Source/NSDocumentController.m (+initialize): Don't ignore types
without an associated document class.
* Source/NSDocument.m (+reaableTypes, +writableTypes):
* Source/NSDocument.m (+readableTypes, +writableTypes):
* Source/NSDocumentController.m(-_readableTypesForClass:,
-_writableTypesForClass:): Add the exportable types to the
writable types. Rename private NSDocumentController methods.

View file

@ -4819,10 +4819,17 @@ other than copy/paste or dragging. */
- (BOOL) performDragOperation: (id <NSDraggingInfo>)sender
{
/* In general, the position where the dragging source was dropped is given by
_dragTargetLocation. However, when dragging a color onto a text view, the
cursor is not updated, since the color change always effects the current
selection and hence _dragTargetLocation==NSNotFound in that case. */
NSRange sourceRange = [self selectedRange];
NSRange changeRange = NSMakeRange(_dragTargetLocation, 0);
[self _draggingReleaseInsertionPoint];
[self setSelectedRange: changeRange];
if (_dragTargetLocation != NSNotFound)
{
NSRange changeRange = NSMakeRange(_dragTargetLocation, 0);
[self _draggingReleaseInsertionPoint];
[self setSelectedRange: changeRange];
}
if ([sender draggingSource] == self &&
([sender draggingSourceOperationMask] & NSDragOperationGeneric))