diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-08-07 09:55:47 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-08-07 09:55:47 +0000 |
commit | 74916b2d8a62d3ab3723e1ea42d7c842d5e7c972 (patch) | |
tree | 1c8a32712a10b3d9a1e001cda9aef23a6433b029 /xmlscript/test | |
parent | 23427dd5d9c5c4b86c49f382afb1310788869bf3 (diff) |
#90513# event revision
Diffstat (limited to 'xmlscript/test')
-rw-r--r-- | xmlscript/test/imexp.cxx | 85 | ||||
-rw-r--r-- | xmlscript/test/test.xml | 6 |
2 files changed, 48 insertions, 43 deletions
diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx index d3bc4cd125dc..e1c056786659 100644 --- a/xmlscript/test/imexp.cxx +++ b/xmlscript/test/imexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: imexp.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: dbo $ $Date: 2001-05-11 13:53:34 $ + * last change: $Author: dbo $ $Date: 2001-08-07 10:55:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,9 +86,6 @@ #include <com/sun/star/registry/XImplementationRegistration.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> -#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> - #include <com/sun/star/awt/XToolkit.hpp> #include <com/sun/star/awt/XControlModel.hpp> @@ -108,7 +105,7 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager() try { - ::rtl::OUString localRegistry = ::comphelper::getPathToUserRegistry(); + ::rtl::OUString localRegistry = OUString::createFromAscii( "xmlscript.rdb" ); //"::comphelper::getPathToUserRegistry(); ::rtl::OUString systemRegistry = ::comphelper::getPathToSystemRegistry(); Reference< registry::XSimpleRegistry > xLocalRegistry( ::cppu::createSimpleRegistry() ); @@ -149,55 +146,59 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager() Reference< XInterface >() ); } - Reference < registry::XImplementationRegistration > xReg( - xContext->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ), xContext ), UNO_QUERY ); + Reference< XInterface > x( xContext->getServiceManager()->createInstanceWithContext( + OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), xContext ) ); + if (! x.is()) // register only once + { + Reference < registry::XImplementationRegistration > xReg( + xContext->getServiceManager()->createInstanceWithContext( + OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ), xContext ), UNO_QUERY ); #ifdef SAL_W32 - OUString aDllName = OUString::createFromAscii( "sax.dll" ); + OUString aDllName = OUString::createFromAscii( "sax.dll" ); #else - OUString aDllName = OUString::createFromAscii( "libsax.so" ); + OUString aDllName = OUString::createFromAscii( "libsax.so" ); #endif - xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), - aDllName, Reference< registry::XSimpleRegistry > () ); + xReg->registerImplementation( + OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + aDllName, Reference< registry::XSimpleRegistry > () ); #ifdef SAL_W32 - aDllName = OUString::createFromAscii( "tk" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( "mi.dll" ); + aDllName = OUString::createFromAscii( "tk" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( "mi.dll" ); #else - aDllName = OUString::createFromAscii( "libtk" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( ".so" ); + aDllName = OUString::createFromAscii( "libtk" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( ".so" ); #endif - xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), - aDllName, Reference< registry::XSimpleRegistry > () ); + xReg->registerImplementation( + OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + aDllName, Reference< registry::XSimpleRegistry > () ); #ifdef SAL_W32 - aDllName = OUString::createFromAscii( "svt" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( "mi.dll" ); + aDllName = OUString::createFromAscii( "svt" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( "mi.dll" ); #else - aDllName = OUString::createFromAscii( "libsvt" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( ".so" ); + aDllName = OUString::createFromAscii( "libsvt" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( ".so" ); #endif - xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), - aDllName, Reference< registry::XSimpleRegistry > () ); + xReg->registerImplementation( + OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + aDllName, Reference< registry::XSimpleRegistry > () ); #ifdef SAL_W32 - aDllName = OUString::createFromAscii( "i18n" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( "mi.dll" ); + aDllName = OUString::createFromAscii( "i18n" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( "mi.dll" ); #else - aDllName = OUString::createFromAscii( "libi18n" ); - aDllName += OUString::valueOf( (sal_Int32)SUPD ); - aDllName += OUString::createFromAscii( ".so" ); + aDllName = OUString::createFromAscii( "libi18n" ); + aDllName += OUString::valueOf( (sal_Int32)SUPD ); + aDllName += OUString::createFromAscii( ".so" ); #endif - xReg->registerImplementation( - OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), - aDllName, Reference< registry::XSimpleRegistry > () ); - + xReg->registerImplementation( + OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + aDllName, Reference< registry::XSimpleRegistry > () ); + } } catch( Exception& rExc ) diff --git a/xmlscript/test/test.xml b/xmlscript/test/test.xml index ad32e10997fa..6ac6d7dcc06b 100644 --- a/xmlscript/test/test.xml +++ b/xmlscript/test/test.xml @@ -3,6 +3,7 @@ <window xmlns="http://openoffice.org/2000/dialog" xmlns:dlg="http://openoffice.org/2000/dialog" + xmlns:script="http://openoffice.org/2000/script" style-id="dialog" id="window1" title="Test-Dialog" left="50" top="50" height="690" width="400"> @@ -16,7 +17,10 @@ <dlg:bulletinboard xmlns:ns="http://www.fake" xmlns:dlg="http://openoffice.org/2000/dialog"> <button dlg:id="button1" ns:value="hallo" dlg:left="50" ns:top="50" width="50" height="50" style-id="bla3" xmlns:ns="http://openoffice.org/2000/dialog"> - <event listener-type="type" event-method="clicked" script-type="basic" script-code="code" param="testi"/> + <dlg:event listener-type="com.sun.star.awt.XKeyListener" event-method="keyReleased" script-type="StarBasic" script-code="application:ExecutingMacro"/> + <script:event script:event-name="on-rowchange" script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic"/> + <script:listener-event script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic" script:listener-type="com.sun.star.awt.XMouseListener" script:listener-method="mouseEntered"/> + <script:listener-event script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic" script:listener-type="com.sun.star.awt.XMouseListener" script:listener-method="mousePressed" script:listener-param="parameter0, so this will never ever be a script:event, but always a script:listener-event element!"/> </button> <button dlg:id="button3" ns:value="hallo2" dlg:left="250" ns:top="50" width="50" height="50" style-id="bla" xmlns:ns="http://openoffice.org/2000/dialog"/> |