Issue 85073 - Option AutoHScroll in css.awt.UnoControlEditModel crashed dialog
Summary: Option AutoHScroll in css.awt.UnoControlEditModel crashed dialog
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: carsten.driesner
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-08 09:50 UTC by tobiaskrais
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

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


Attachments
Example Java application to simulate the crash (3.21 KB, text/plain)
2008-01-08 09:52 UTC, tobiaskrais
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tobiaskrais 2008-01-08 09:50:22 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);
	}

}
-----%<-----
Comment 1 tobiaskrais 2008-01-08 09:52:38 UTC
Created attachment 50729 [details]
Example Java application to simulate the crash
Comment 2 jsc 2008-01-08 14:12:13 UTC
jsc -> cd: seems to be one for you
Comment 3 carsten.driesner 2008-01-09 10:44:37 UTC
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
Comment 4 tobiaskrais 2008-01-09 13:23:08 UTC
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
Comment 5 carsten.driesner 2008-01-09 13:38:58 UTC
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.
Comment 6 tobiaskrais 2008-01-09 19:57:27 UTC
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
Comment 7 tobiaskrais 2008-01-10 07:20:00 UTC
tobiaskrais -> cd: I filed a bug against Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/181700
Comment 8 carsten.driesner 2008-01-10 08:00:29 UTC
cd: Resolve issue as WORKSFORME.
Comment 9 carsten.driesner 2008-01-10 08:01:18 UTC
cd: Closed.
Comment 10 tobiaskrais 2008-03-10 09:35:09 UTC
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.