Apache OpenOffice (AOO) Bugzilla – Issue 7031
CreateUnoDialog and loadComponent crashes
Last modified: 2013-02-24 21:07:37 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
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
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
implementation issue
TBE->AB: I guess this is something for you.
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
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.
Created attachment 4387 [details] A form on which the error occured.
It seems for me that the error doesn't depend on the form because I can't make any form work correctly.
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.
close issue.