diff --git a/ChangeLog b/ChangeLog index 79499b912..c854b40da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-04-06 Adam Fedor + + * Source/NSView.m (-_cleanupPrinting): Private method to cleanup + after an exception. + * Source/NSPrintOperation.m (-_runOperation): Use it. + 2002-04-03 Fred Kiefer * Images/common_RightTabStop.tiff diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m index 6dfca8dcb..afea689b8 100644 --- a/Source/NSPrintOperation.m +++ b/Source/NSPrintOperation.m @@ -88,6 +88,10 @@ typedef struct _page_info_t { - (void) _endSheet; @end +@interface NSView (NPrintOperationPrivate) +- (void) _cleanupPrinting; +@end + // Subclass for the regular printing @interface GSPrintOperation: NSPrintOperation { @@ -478,6 +482,7 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey"; } NS_HANDLER { + [_view _cleanupPrinting]; [NSGraphicsContext setCurrentContext: oldContext]; NSRunAlertPanel(@"Error", @"Printing error: %@", @"OK", NULL, NULL, localException); diff --git a/Source/NSView.m b/Source/NSView.m index 7d2fb93e8..8621de83c 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3142,6 +3142,13 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) viewIsPrinting = nil; } +/* An exception occured while printing. Clean up */ +- (void) _cleanupPrinting +{ + [self _invalidateCoordinates]; + viewIsPrinting = nil; +} + /* * NSCoding protocol */