You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2013/03/31 15:17:48 UTC

[Bug 119935] private:stream - load component from ByteArray crashes aoo34

https://issues.apache.org/ooo/show_bug.cgi?id=119935

--- Comment #8 from Ariel Constenla-Haile <ar...@apache.org> ---
Created attachment 80485
  --> https://issues.apache.org/ooo/attachment.cgi?id=80485&action=edit
Basic version of the Java code

The code is the same, but in Basic. It does not crash.

REM  *****  BASIC  *****

Option Explicit

Sub Main
Dim oFactory as Object
oFactory =     CreateUnoService("com.sun.star.embed.StorageFactory")

Dim oStorage as Object
oStorage = oFactory.createInstance()

Dim oStream as Object
oStream = oStorage.openStreamElement("test",
com.sun.star.embed.ElementModes.READWRITE)

Dim oOutputStream as Object
oOutputStream = oStream.getOutputStream()

Dim nContent%(8)
nContent(0) = 72
nContent(1) = 9
nContent(2) = 69
nContent(3) = 9
nContent(4) = 76
nContent(5) = 9
nContent(6) = 76
nContent(7) = 9
nContent(8) = 79

oOutputStream.writeBytes(nContent)
oOutputStream.flush()
oOutputStream.closeOutput()

Dim oMediaDesc(2) as new com.sun.star.beans.PropertyValue
oMediaDesc(0).Name = "InputStream"
oMediaDesc(0).Value = oStream.getInputStream()
oMediaDesc(1).Name = "FilterName"
oMediaDesc(1).Value = "Text - txt - csv (StarCalc)"
oMediaDesc(2).Name = "FilterOptions"
oMediaDesc(2).Value = "9,0,0,1"

Dim oDoc
oDoc = StarDesktop.loadComponentFromURL("private:stream","_blank",0,oMediaDesc)

oStream.getInputStream().closeInput()
oStorage.dispose()
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.