Update for GSSetLocale change

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-12-05 04:29:12 +00:00
parent f9917b89bd
commit 99319bc83e
2 changed files with 16 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2002-12-04 Adam Fedor <fedor@gnu.org>
* Source/NSPrintOperation.m: Update for change in GSSetLocale.
2002-12-04 Adam Fedor <fedor@gnu.org> 2002-12-04 Adam Fedor <fedor@gnu.org>
* Headers/gnustep/gui/DPSOperators.h (DPSPrintf): Remove inline * Headers/gnustep/gui/DPSOperators.h (DPSPrintf): Remove inline

View file

@ -54,6 +54,7 @@
#include <AppKit/PSOperators.h> #include <AppKit/PSOperators.h>
#include <gnustep/base/GSLocale.h> #include <gnustep/base/GSLocale.h>
#include <locale.h>
#define NSNUMBER(a) [NSNumber numberWithInt: (a)] #define NSNUMBER(a) [NSNumber numberWithInt: (a)]
#define NSFNUMBER(a) [NSNumber numberWithFloat: (a)] #define NSFNUMBER(a) [NSNumber numberWithFloat: (a)]
@ -939,10 +940,10 @@ scaleRect(NSRect rect, double scale)
} }
/* Reset the current locale to a generic C locale so numbers /* Reset the current locale to a generic C locale so numbers
get printed correctly for PostScript (maybe we should only get printed correctly for PostScriptl
set the numeric locale?). Save the current locale for later. */ Save the current locale for later. */
clocale = GSSetLocale(nil); clocale = GSSetLocale(LC_NUMERIC, nil);
GSSetLocale(@"C"); GSSetLocale(LC_NUMERIC, @"C");
/* Print the header information */ /* Print the header information */
[_view beginDocument]; [_view beginDocument];
@ -1010,7 +1011,7 @@ scaleRect(NSRect rect, double scale)
[_view _endSheet]; [_view _endSheet];
} }
[_view endDocument]; [_view endDocument];
GSSetLocale(clocale); GSSetLocale(LC_NUMERIC, clocale);
/* Setup/reset for next time */ /* Setup/reset for next time */
[dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage]; [dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage];
@ -1287,8 +1288,8 @@ scaleRect(NSRect rect, double scale)
/* Reset the current locale to a generic C locale so numbers /* Reset the current locale to a generic C locale so numbers
get printed correctly for PostScript (maybe we should only get printed correctly for PostScript (maybe we should only
set the numeric locale?). Save the current locale for later. */ set the numeric locale?). Save the current locale for later. */
clocale = GSSetLocale(nil); clocale = GSSetLocale(LC_NUMERIC, nil);
GSSetLocale(@"C"); GSSetLocale(LC_NUMERIC, @"C");
/* Save this for the view to look at. Seems like there should /* Save this for the view to look at. Seems like there should
be a better way to pass it to beginDocument */ be a better way to pass it to beginDocument */
@ -1299,7 +1300,7 @@ scaleRect(NSRect rect, double scale)
[_view displayRectIgnoringOpacity: _rect]; [_view displayRectIgnoringOpacity: _rect];
[_view endDocument]; [_view endDocument];
GSSetLocale(clocale); GSSetLocale(LC_NUMERIC, clocale);
} }
- (BOOL)isEPSOperation - (BOOL)isEPSOperation
@ -1383,12 +1384,12 @@ scaleRect(NSRect rect, double scale)
/* Reset the current locale to a generic C locale so numbers /* Reset the current locale to a generic C locale so numbers
get printed correctly for PostScript (maybe we should only get printed correctly for PostScript (maybe we should only
set the numeric locale?). Save the current locale for later. */ set the numeric locale?). Save the current locale for later. */
clocale = GSSetLocale(nil); clocale = GSSetLocale(LC_NUMERIC, nil);
GSSetLocale(@"C"); GSSetLocale(LC_NUMERIC, @"C");
[_view displayRectIgnoringOpacity: _rect]; [_view displayRectIgnoringOpacity: _rect];
GSSetLocale(clocale); GSSetLocale(LC_NUMERIC, clocale);
} }
- (BOOL)deliverResult - (BOOL)deliverResult