diff --git a/ChangeLog b/ChangeLog index 3854868c6..b2780f012 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-01 Fred Kiefer + + * Source/NSTextView.m (-dragSelectionWithEvent:...): Correct + computation of attachment cell frame. + * Source/NSParagraphStyle.m (NSMutableParagraphStyle + -setParagraphStyle:): Set only existing text blocks and text lists. + 2009-01-31 Richard Frith-Macdonald * Source/GSDisplayServer.m: Fix typo diff --git a/Source/NSParagraphStyle.m b/Source/NSParagraphStyle.m index b5455d8c0..e1d99c19f 100644 --- a/Source/NSParagraphStyle.m +++ b/Source/NSParagraphStyle.m @@ -220,15 +220,14 @@ static NSParagraphStyle *defaultStyle = nil; int i; for (i = 0; i < 12; i++) - { - NSTextTab *tab; + { + NSTextTab *tab; - /* FIXME: (i * 1) ? */ - tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType - location: (i * 1) * 28.0]; - [style->_tabStops addObject: tab]; - RELEASE(tab); - } + tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType + location: (i + 1) * 28.0]; + [style->_tabStops addObject: tab]; + RELEASE(tab); + } defaultStyle = style; } return defaultStyle; @@ -782,8 +781,10 @@ static NSParagraphStyle *defaultStyle = nil; [_tabStops removeAllObjects]; [_tabStops addObjectsFromArray: p->_tabStops]; - [self setTextBlocks: [p textBlocks]]; - [self setTextLists: [p textLists]]; + if (p->_textBlocks) + [self setTextBlocks: p->_textBlocks]; + if (p->_textLists) + [self setTextLists: p->_textLists]; _alignment = p->_alignment; _firstLineHeadIndent = p->_firstLineHeadIndent; diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 2814a4dad..9e94cd957 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -4811,12 +4811,17 @@ other than copy/paste or dragging. */ if (cell != nil) { NSRect cellFrame; + NSRect lfRect; + lfRect = [_layoutManager lineFragmentRectForGlyphAtIndex: startIndex + effectiveRange: NULL]; cellFrame.origin = [_layoutManager locationForGlyphAtIndex: startIndex]; cellFrame.size = [_layoutManager attachmentSizeForGlyphAtIndex: startIndex]; cellFrame.origin.y -= cellFrame.size.height; + cellFrame.origin.x += lfRect.origin.x; + cellFrame.origin.y += lfRect.origin.y; /* TODO: What about the insertion point ? */ if ([cell wantsToTrackMouseForEvent: theEvent