Apache OpenOffice (AOO) Bugzilla – Issue 85073
Option AutoHScroll in css.awt.UnoControlEditModel crashed dialog
Last modified: 2013-02-24 21:09:17 UTC
Please see the following code. When setting the AutoHScroll or AutoVScroll value, my dialog crashes. -----%<----- package de.designtouse.test; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.comp.helper.Bootstrap; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XDesktop; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import de.twc.oocom.oo.OOWorkbench; import de.twc.oocom.utils.OOUtils; public class DialogCrashTest { /** * @param args */ public static void main(String[] args) { try { XComponentContext xComponentContext = Bootstrap.bootstrap(); XMultiComponentFactory xMCF = xComponentContext.getServiceManager(); Object desktop = xMCF.createInstanceWithContext( "com.sun.star.frame.Desktop", xComponentContext); XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop); PropertyValue[] myProperties = new PropertyValue[1]; myProperties[0] = new PropertyValue(); // open document but do not show user interface myProperties[0].Name = "Hidden"; myProperties[0].Value = new Boolean(false); XComponent xComponent = xComponentLoader.loadComponentFromURL( "private:factory/swriter", "_blank", 0, myProperties); // create the dialog model and set the properties Object dialogModel = xMCF.createInstanceWithContext( "com.sun.star.awt.UnoControlDialogModel", xComponentContext); XPropertySet xPSetDialog = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, dialogModel); xPSetDialog.setPropertyValue("PositionX", new Integer(0)); xPSetDialog.setPropertyValue("PositionY", new Integer(0)); xPSetDialog.setPropertyValue("Width", new Integer(200)); xPSetDialog.setPropertyValue("Height", new Integer(200)); xPSetDialog.setPropertyValue("Title", new String("Fehler!")); XMultiServiceFactory xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, dialogModel); Object inputModel01 = xMSF.createInstance("com.sun.star.awt.UnoControlEditModel"); XPropertySet xPSetInput01 = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, inputModel01); xPSetInput01.setPropertyValue("PositionX", new Integer(5)); xPSetInput01.setPropertyValue("PositionY", new Integer(5)); xPSetInput01.setPropertyValue("Width", new Integer(190)); xPSetInput01.setPropertyValue("Height", new Integer(120)); xPSetInput01.setPropertyValue("MultiLine", true); // Application crashes next line with exception xPSetInput01.setPropertyValue("AutoHScroll", true); xPSetInput01.setPropertyValue("AutoVScroll", true); xPSetInput01.setPropertyValue("ReadOnly", true); xPSetInput01.setPropertyValue("Text", "CrashText"); xPSetInput01.setPropertyValue("Name", "CrashText"); } catch(Exception e) { e.printStackTrace(); } System.exit(0); } } -----%<-----
Created attachment 50729 [details] Example Java application to simulate the crash
jsc -> cd: seems to be one for you
cd->tobiaskrais: I am sorry but I cannot reproduce the crash using OpenOffice.org 2.3 final and your Java application (I had to remove the two imports de.twc.oocom.oo.OOWorkbench and de.twc.oocom.utils.OOUtils). Could you please test the following Basic script which does the same as your Java program. REM ***** BASIC ***** Sub Main rem create the dialog model and set the properties dialogModel = createUnoService( "com.sun.star.awt.UnoControlDialogModel" ) dialogModel.setPropertyValue( "PositionX", 0 ) dialogModel.setPropertyValue( "PositionY", 0 ) dialogModel.setPropertyValue( "Width", 200 ) dialogModel.setPropertyValue( "Height", 200 ) dialogModel.setPropertyValue( "Title", "Fehler!" ) inputModel01 = dialogModel.createInstance( "com.sun.star.awt.UnoControlEditModel" ) inputModel01.setPropertyValue("PositionX", 5 ) inputModel01.setPropertyValue("PositionY", 5 ) inputModel01.setPropertyValue("Width", 190 ) inputModel01.setPropertyValue("Height", 120 ) inputModel01.setPropertyValue("MultiLine", true) rem Application crashes next line with exception inputModel01.setPropertyValue("AutoHScroll", true) inputModel01.setPropertyValue("AutoVScroll", true) inputModel01.setPropertyValue("ReadOnly", true) inputModel01.setPropertyValue("Text", "CrashText") inputModel01.setPropertyValue("Name", "CrashText") End Sub
Hi Carsten, I tested your Basic Script. When setting the AutoHScroll value an exception comes up. It says: -----%<----- BASIC Laufzeitfehler. Es ist eine Exception aufgetreten. Type: com.sun.star.beans.UnknownPropertyException Message: . -----%<----- Do you have an Ubuntu Gutsy arround for testing? Maybe a live CD? Im sorry, Tobias
cd->tobiaskrais: Tobias, currently I have no access to a Ubuntu Gutsy CD. Do you use the OpenOffice.org version from your distribution? May be that's the problem as this version has a strange problem with the old properties called HSCROLL and VSCROLL. Your example shows me that these two properties are unknown (UnknownPropertyException) which is definitely not the case with the official OpenOffice.org 2.3 version.
tobiaskrais -> cd: Hi Carsten, I use the OOo packages from the distribution, for I have a 64 bit system. In this case I should file an issue against Ubuntu Gutsy. Please close the issue. Thx, Tobias
tobiaskrais -> cd: I filed a bug against Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/181700
cd: Resolve issue as WORKSFORME.
cd: Closed.
Just a note: also resolved in Ubuntu Hardy Heron. Reason: OOo in Ubuntu is no more compiled against GCJ Java, but now against OpenJDK. That adds the functionality in Ubuntu OOo.