Issue 3603 - Print is not valid postscript
Summary: Print is not valid postscript
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 641
Hardware: PC Linux, all
: P2 Trivial (vote)
Target Milestone: ---
Assignee: philipp.lohmann
QA Contact: issues@sw
URL:
Keywords:
: 3703 (view as issue list)
Depends on:
Blocks:
 
Reported: 2002-03-21 02:35 UTC by tange
Modified: 2004-11-25 17:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Print to sxw-file gives non-valid postscript (38.22 KB, application/octet-stream)
2002-03-21 02:38 UTC, tange
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tange 2002-03-21 02:35:59 UTC
When printing this document the result cannot be shown by ghostscript.
Comment 1 tange 2002-03-21 02:38:20 UTC
Created attachment 1257 [details]
Print to sxw-file gives non-valid postscript
Comment 2 tange 2002-03-22 12:08:30 UTC
I had a PostScrit guy look at it:

---
readpath
V009D0155A6EC0A0000AEE40~
0.15686 0 0.5: setrgbcolor
fill
---

For some reason the blue channel is set to '0.5:' which is not 
valid. It should be '0.5'.


Comment 3 tange 2002-03-22 12:25:37 UTC
I just tried running this:

  perl -pe 's/ 0.5: / 0.5 /g'

on the resulting .ps-file. And marvelously it actually works! So 
bug is 0.5: should be printed as 0.5


Comment 4 tange 2002-03-22 23:46:42 UTC
Ahh.. The ':' is actually int(10) + '0'.

It is probably due to some (wrong) rounding in strhelper.cxx:
            *pBuffer++ = nInt + '0';
If f is almost 10.0 then nInt will be 10 which will result in a ':'.

Untestet fix for strhelper.cxx:
*pBuffer++ = (nInt + '0' > '9') ? '9' : (nInt + '0');

Comment 5 Joost Andrae 2002-03-29 14:57:15 UTC
Joost->Philipp: please have a look at this
Comment 6 philipp.lohmann 2002-04-03 11:12:11 UTC
Ole: actually 0.5: should be 0.6. nInt should never have been 10. This
happens only on Intel platforms and i have to assume that this is a
hardware rounding issue. So i built in that if the remainder of the
float division is actually 1.0 (as happens on intel), the current nInt
is increased by 1.

This is fixed in the top level version (since last december; the 641c
really begins to show age by now) of strhelper.cxx and should be in 641d.
Comment 7 philipp.lohmann 2002-06-17 08:57:18 UTC
*** Issue 3703 has been marked as a duplicate of this issue. ***
Comment 8 philipp.lohmann 2004-11-25 17:29:22 UTC
closing