Issue 75731 - textoutputstream.writeString crashes openoffice
Summary: textoutputstream.writeString crashes openoffice
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 2.2 RC4
Hardware: All All
: P3 Trivial (vote)
Target Milestone: 4.1.0
Assignee: jsc
QA Contact: zhaoshzh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 00:12 UTC by prahal
Modified: 2017-05-20 10:35 UTC (History)
4 users (show)

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


Attachments
runtime error (77.13 KB, image/png)
2014-02-27 02:53 UTC, zhaoshzh
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description prahal 2007-03-26 00:12:40 UTC
Dim b as Object
	b = createUnoService("com.sun.star.io.TextOutputStream")
	b.setEncoding("UTF-16")
	b.writeString("test1")

executing this code crashes all openoffice components. I am using rc4 from 
http://ftp.linux.cz/pub/localization/OpenOffice.org/devel/680/

Regards
Alban
Comment 1 prahal 2007-03-26 11:56:33 UTC
This issue may not be critical as I do not set an outputstream which is required.
As told in
http://api.openoffice.org/docs/common/ref/com/sun/star/io/TextOutputStream.html ...
Though it ought to raise an exception instead of crashing openoffice

Regards
Alban

Comment 2 Joost Andrae 2007-03-26 14:08:09 UTC
added jsc to cc list
Comment 3 jsc 2007-03-26 14:33:00 UTC
mmh, the documentation
(http://api.openoffice.org/docs/common/ref/com/sun/star/io/TextOutputStream.html)
says that the output stream has to be set initially with setOutputStream. I
would say it's a bad implementation, it should at least throw an exception if
the output stream is invalid. Seems to be a valid issue but no show-stopper.
Comment 4 Joost Andrae 2007-03-26 14:37:58 UTC
set target to 2.x
Comment 5 peter.junge 2007-06-15 06:48:10 UTC
Hi Joost,

I'm just reassigning this one to you, because i do not understand why you have
set a target without confirming.

Best regards from Beijing
Peter
Comment 6 Joost Andrae 2007-06-15 09:15:05 UTC
JA->JSC: as you already confirmed this issue I'll forward it to you
Comment 7 Joost Andrae 2007-06-15 09:15:31 UTC
.
Comment 8 jsc 2007-07-31 09:42:11 UTC
accepted
Comment 9 Martin Hollmichel 2007-11-09 16:52:00 UTC
change target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 10 jsc 2013-10-21 15:55:11 UTC
during reviewing issues assigned to me and playing with XCode debugging and MacOS 64 bit I stumbled over this old issue and fixed it.

IOException is now thrown that the output stream is not initialized and that setOutputStream have to be used first.
Comment 11 SVN Robot 2013-10-29 08:14:47 UTC
"jsc" committed SVN revision 1534248 into trunk:
#75731# check output stream and throw IOExceptioin if it is not intiliazed
svnbz message delay caused by perl problems after Bugzilla 4.4.1 update
Comment 12 zhaoshzh 2014-02-27 02:53:34 UTC
Created attachment 82727 [details]
runtime error

when run the macro ,error occurred.
Comment 13 zhaoshzh 2014-02-27 02:54:23 UTC
AOO410m1(build:9750) - rev:1566593
Comment 14 fanyuzhen 2014-02-27 10:51:21 UTC
Reopen per Shao Zhi Zhao's comment 12
Comment 15 jsc 2014-02-27 12:33:02 UTC
The runtime error in Basic is exactly the expected behaviour after the fix. The screenshot shows the thrown exception with detailed message that the output stream is not set. The user get the runtime error box but no crash.
Comment 16 jsc 2014-02-27 16:04:03 UTC
verified on MacOS, get the expected Basic runtime error but no crash
Comment 17 Oliver-Rainer Wittmann 2014-04-01 07:58:01 UTC
I can confirm the fix on local build of branch AOO410, rev. 1582710
Comment 18 Oliver-Rainer Wittmann 2014-04-02 11:06:43 UTC
Verified on Ubuntu 10.04 (64bit) with build from branch AOO410 (rev. 1583666)