From 51a3070bf7e4dbc5ef79e8ae2929ef02577fc1be Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sat, 14 May 2011 18:00:13 +0000 Subject: [PATCH] Partial fix for bug #32845 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33038 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 ++++++- Source/NSPrintOperation.m | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65dec19b3..aa378ddc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2011-05-11 Fred Kiefer +2011-05-14 Fred Kiefer + + * Source/NSPrintOperation.m: Add an extra context save and restore + at the sheet level. This is a partial fix for bug #32845. + +2011-05-12 Fred Kiefer * Source/GSXibLoader.m: Add support for the "array" and "dictionary" elements found in newer XIB files (Version >= 8). diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m index 6e40bbd1d..892cafd05 100644 --- a/Source/NSPrintOperation.m +++ b/Source/NSPrintOperation.m @@ -1100,6 +1100,7 @@ scaleRect(NSRect rect, double scale) { [_view drawSheetBorderWithSize: info.sheetBounds.size]; [_view _endSheet]; + DPSgrestore([self context]); } [_view endDocument]; @@ -1138,7 +1139,7 @@ scaleRect(NSRect rect, double scale) NSString *label; NSRect boundsForPage = info.sheetBounds; - if(knowsPageRange) + if (knowsPageRange) { boundsForPage = pageRect; } @@ -1147,6 +1148,7 @@ scaleRect(NSRect rect, double scale) if (info.nup == 1) label = [NSString stringWithFormat: @"%d", currentPage]; + DPSgsave(ctxt); [self beginPage: floor((currentPage - info.first)/info.nup)+1 label: label bBox: boundsForPage @@ -1157,7 +1159,7 @@ scaleRect(NSRect rect, double scale) DPStranslate(ctxt, 0, -info.paperSize.height); } - if(!knowsPageRange) + if (!knowsPageRange) { /* Also offset by margins */ DPStranslate(ctxt, NSMinX(info.paperBounds), NSMinY(info.paperBounds)); @@ -1232,6 +1234,7 @@ scaleRect(NSRect rect, double scale) { [self drawSheetBorderWithSize: info.sheetBounds.size]; [self _endSheet]; + DPSgrestore(ctxt); } }