--- abi-0.7.8/src/af/xap/unix/xap_UnixPSGraphics.cpp.orig Thu May 25 17:26:41 2000 +++ abi-0.7.8/src/af/xap/unix/xap_UnixPSGraphics.cpp Fri May 26 15:30:18 2000 @@ -19,6 +19,7 @@ #include #include +#include #include "ut_types.h" #include "ut_assert.h" @@ -735,10 +736,11 @@ char buf[128]; // used for any averaging unsigned char newclr; + char *old_locale = setlocale (LC_NUMERIC, "C"); switch(m_cs) { case GR_Graphics::GR_COLORSPACE_COLOR: - sprintf(buf,"%.8f %.8f %.8f setrgbcolor\n", // TODO do we need to deal with locale for PS + sprintf(buf,"%.8f %.8f %.8f setrgbcolor\n", ((float) m_currentColor.m_red / (float) 255.0), ((float) m_currentColor.m_grn / (float) 255.0), ((float) m_currentColor.m_blu / (float) 255.0)); @@ -748,7 +750,7 @@ (float) m_currentColor.m_grn + (float) m_currentColor.m_blu ) / (float) 3.0); - sprintf(buf,"%.8f setgray\n", // TODO do we need to deal with locale for PS + sprintf(buf,"%.8f setgray\n", (float) newclr / (float) 255.0); break; case GR_Graphics::GR_COLORSPACE_BW: @@ -761,6 +763,7 @@ } m_ps->writeBytes(buf); + setlocale (LC_NUMERIC, old_locale); } GR_Image* PS_Graphics::createNewImage(const char* pszName, const UT_ByteBuf* pBBPNG, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight)