Issue 7031 - CreateUnoDialog and loadComponent crashes
Summary: CreateUnoDialog and loadComponent crashes
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows 2000
: P5 (lowest) Trivial
Target Milestone: ---
Assignee: martho
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-16 08:42 UTC by martho
Modified: 2013-02-24 21:07 UTC (History)
1 user (show)

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


Attachments
A form on which the error occured. (2.63 KB, application/octet-stream)
2003-01-21 12:09 UTC, martho
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description martho 2002-08-16 08:42:18 UTC
Code is StarBasic.

OpenOffice crashes after doing the loop 4 up to about 20 times:
---------------------------------------------------------------
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
for i = 0 to 40
	oDocument = oDesktop.loadComponentFromURL
("file:///G:/Test.sxw", "_blank", 0, mArgs)
	oDlgPrint = DialogLibraries.Standard.DiaPrint
	oDlg = CreateUnoDialog(oDlgPrint)
	oDlg.execute
	oDocument.dispose
next i

Works fine:
-----------
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
for i = 0 to 40
	oDocument = oDesktop.loadComponentFromURL
("file:///G:/Test.sxw", "_blank", 0, mArgs)
	oDocument.dispose
next i

Works fine:
-----------
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
oDocument = oDesktop.loadComponentFromURL("file:///G:/Test.sxw", "_blank", 0, 
mArgs)
	for i = 0 to 40
		oDlgPrint = DialogLibraries.Standard.DiaPrint
		oDlg = CreateUnoDialog(oDlgPrint)
		oDlg.execute
	next i
oDocument.dispose

Works fine:
-----------
oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
oDlgPrint = DialogLibraries.Standard.DiaPrint
oDlg = CreateUnoDialog(oDlgPrint)
	
for i = 0 to 0
        oDocument = oDesktop.loadComponentFromURL
("file:///G:/Test.sxw", "_blank", 0, mArgs)'
	oDlg.execute
	oDocument.dispose
next i
Comment 1 martho 2002-08-28 10:28:44 UTC
It also works when doing the dialog-initialition-stuff BEFORE the 
loading. The problem is then that the dialog belongs to the document 
which was before the active one:

oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
	
for i = 0 to 40
	oDlgPrint = DialogLibraries.Standard.DiaPrint
	oDlg = CreateUnoDialog(oDlgPrint)
	oDocument = oDesktop.loadComponentFromURL
("file:///G:/Test.sxw", "_blank", 0, mArgs)'
	oDlg.execute
	oDocument.dispose
next i
Comment 2 martho 2002-10-21 10:51:41 UTC
It seems also to work when loading the dialog like this (this code is 
from the help files, but the tutorial still suggests the other way):

Function LoadDialog(Libname as String, DialogName as String, Optional 
oLibContainer)
	Dim oLib as Object
	Dim oLibDialog as Object
	Dim oRuntimeDialog as Object
	If IsMissing(oLibContainer ) then
		oLibContainer = DialogLibraries
	End If
	oLibContainer.LoadLibrary(LibName)
	oLib = oLibContainer.GetByName(Libname)
	oLibDialog = oLib.GetByName(DialogName)
	oRuntimeDialog = CreateUnoDialog(oLibDialog)
	LoadDialog() = oRuntimeDialog
End Function
Comment 3 ooo 2002-12-19 11:37:40 UTC
implementation issue
Comment 4 thomas.benisch 2003-01-06 15:56:34 UTC
TBE->AB: I guess this is something for you.
Comment 5 ab 2003-01-21 12:02:13 UTC
AB->MARTHO: I couldn't reproduce it with my current StarOffice 
version but maybe it only works with your dialog and/or your test 
document. Could you please provide them in the files section? You can 
find your dialog in office/user/basic/Standard/DiaPrint.xdl
Comment 6 ab 2003-01-21 12:06:00 UTC
ab->martho: I couldn't reproduce the problem with my current 
StarOffice version. Maybe it only occurs with your test doc and/or 
dialog. Please provide them in the "files" section. The dialog is 
stored in Office\user\basic\Standard\DiaPrint.xdl.
Comment 7 martho 2003-01-21 12:09:06 UTC
Created attachment 4387 [details]
A form on which the error occured.
Comment 8 martho 2003-01-21 12:10:17 UTC
It seems for me that the error doesn't depend on the form because I 
can't make any form work correctly.
Comment 9 ab 2003-02-18 14:06:41 UTC
I could reproduce it on OpenOffice 1.0.1, but not in StarOffice 6.1 
pre Beta versions. So the issue will be solved in OOo 1.1 Beta.
Comment 10 Martin Hollmichel 2004-10-04 16:02:40 UTC
close issue.