From 8edf3a229f7b42e63f359d95773351a27378620a Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 22 Aug 1999 11:03:10 +0000 Subject: [PATCH] Minor fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4741 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSLayoutManager.m | 9 +++++---- Source/NSView.m | 10 ++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index aacd58f9f..21192fbbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Aug 22 11:52:00 1999 Richard Frith-Macdonald + + * Source/NSView.m: ([-viewWillMoveToWindow:]) fixed to call method + in subviews when new window is nil. + 1999-08-22 Gerrit van Dyk * Headers/NSProgressIndicator.h diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index f44738c30..4f4b9c1d8 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -1153,7 +1153,7 @@ Ghiradelli chocolate to he who puts all the pieces together :) */ for (i=0;i<[lines count];i++) { - NSRect aRect, *bRect; + NSRect aRect, bRect; float padding = [aContainer lineFragmentPadding]; NSRange ourRange; @@ -1175,9 +1175,10 @@ intValue]); // ask our textContainer to fix our lineFragment. - secondProposedRect = [aContainer lineFragmentRectForProposedRect:firstProposedRect - sweepDirection: NULL - movementDirection: NULL + secondProposedRect = [aContainer + lineFragmentRectForProposedRect: firstProposedRect + sweepDirection: NSLineSweepLeft + movementDirection: NSLineMoveLeft remainingRect: &bRect]; // set the line fragmentRect for this range. diff --git a/Source/NSView.m b/Source/NSView.m index 1b0f8e99c..ec1979158 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -481,9 +481,14 @@ GSSetDragTypes(NSView* obj, NSArray *types) super_view = newSuper; } +/* + * NOTE - this method is used when removing a view from a window + * (in which case, newWindow is nil) to let all the subviews know + * that they have also been removed from the window. + */ - (void) viewWillMoveToWindow: (NSWindow*)newWindow { - if (newWindow == window || !newWindow) + if (newWindow == window) return; if (_rFlags.has_draginfo) @@ -493,7 +498,8 @@ GSSetDragTypes(NSView* obj, NSArray *types) if (window != nil) [ctxt _removeDragTypes: t fromWindow: [window windowNumber]]; - [ctxt _addDragTypes: t toWindow: [newWindow windowNumber]]; + if (newWindow != nil) + [ctxt _addDragTypes: t toWindow: [newWindow windowNumber]]; } window = newWindow;