Issue 83963 - creating a dialog without title crashes openoffice when executing the dialog
Summary: creating a dialog without title crashes openoffice when executing the dialog
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, all
: P3 Trivial
Target Milestone: ---
Assignee: joerg.skottke
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-26 07:50 UTC by snoff
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description snoff 2007-11-26 07:50:40 UTC
Hello,

I tried to create a dialog using openoffice basic. I designed the dialog, and
set no title to my dialog. In fact i set a title but i had set the flag "Avec
barre de titre" to false. (I'm sorry but i use a french version). 

When i load my dialog, it crash openoffice. But if i set "Avec barre de titre"
to true, it works.

It may be usefull to check this for other programmers, because i lost two hours
to find why my dialog produced a crash.

Thanks
Comment 1 silvercapo 2007-12-11 13:33:37 UTC
I just had the same problem on OOo 2.3.1 release (regular English version) on
Windows XP, running OOoBasic code like:

DialogLibraries.loadLibrary("Standard")
oDialog = createUnoDialog(DialogLibraries.Standard.NoTitleDialog) '*

OOo crashes when creating the dialog, but will work fine again if you set the
dialog to show the title bar.
Comment 2 jsc 2007-12-19 06:56:27 UTC
jsc -> ab: seems to be one for you or for cd?
Comment 3 ab 2007-12-21 12:50:21 UTC
STARTED, OOo 2.4, -> cws ab42
Comment 4 ab 2008-01-09 14:36:15 UTC
The problem is that this "No title" property has only been designed
to create tab pages in the Dialog Editor to be used as option pages
for extensions. Maybe this is not documented sufficiently, I will
check this.

Anyway it makes no sense at all to disable the title bar if the de-
signed dialog should really be used as a dialog. Of course disabling
the title bar shouldn't lead to a crash anyway but a dialog cannot
be displayed without a title respectively a parent window in any case.
I fixed the problem for now by overriding the "no title" property
in case of usage with CreateUnoDialog and DialogProvider service:

oDlgProv = CreateUnoService("com.sun.star.awt.DialogProvider")
oDialog = oDlgProv.createDialog(
"vnd.sun.star.script:Standard.NoTitleDialog?location=application")	

Only when using the ContainerWindowProvider to instantiate the
Dialog respectively TabPage the property will be used.
Comment 5 ab 2008-01-11 13:43:49 UTC
ab->jsk: Please verify:
1. Open Dialog Editor in App/Standard lib and create a dialog Dialog1
2. Set dialog property "with title bar" to No
3. Paste the following test macro into Module1 and run it:

Sub Main
	oDlgProv = CreateUnoService("com.sun.star.awt.DialogProvider")
	oDialog = oDlgProv.createDialog(
"vnd.sun.star.script:Standard.Dialog1?location=application")	
	oDialog.execute
	
	oDialog2 = createUnoDialog(DialogLibraries.Standard.Dialog1) '*
	oDialog2.execute
End Sub

This shouldn't crash any more. The dialogs are displayed with an empty
title bar, even if a title is set. It's not possible to display a dialog completely
without title.
Comment 6 joerg.skottke 2008-01-16 12:23:13 UTC
It does not crash anymore. Verified with a few modifications and additional test
cases.
Comment 7 joerg.skottke 2008-03-12 09:11:48 UTC
Closed, seen good im ooh680m10