summaryrefslogtreecommitdiff
path: root/xmlscript
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2001-02-27 11:45:17 +0000
committerDaniel Boelzle <dbo@openoffice.org>2001-02-27 11:45:17 +0000
commit8661d7233e9a335588b740133d684188ec28914b (patch)
tree432e1e79b85aca32dd96153ecc9acd686060f19e /xmlscript
parent1cd5fc353a5e0befdb9f703208da945b4fff60d6 (diff)
further impl; bugfixing
Diffstat (limited to 'xmlscript')
-rw-r--r--xmlscript/inc/xmlscript/xml_helper.hxx21
-rw-r--r--xmlscript/inc/xmlscript/xmldlg_imexp.hxx38
-rw-r--r--xmlscript/source/xmldlg_imexp/imp_share.hxx36
-rw-r--r--xmlscript/source/xmldlg_imexp/makefile.mk7
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx144
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx103
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx61
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx49
-rw-r--r--xmlscript/test/imexp.cxx160
-rw-r--r--xmlscript/test/test.xml204
10 files changed, 453 insertions, 370 deletions
diff --git a/xmlscript/inc/xmlscript/xml_helper.hxx b/xmlscript/inc/xmlscript/xml_helper.hxx
index 44f573858c4c..3ee63792eecb 100644
--- a/xmlscript/inc/xmlscript/xml_helper.hxx
+++ b/xmlscript/inc/xmlscript/xml_helper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xml_helper.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dbo $ $Date: 2001-02-16 14:14:47 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,13 +61,22 @@
#ifndef _XMLSCRIPT_XML_HELPER_HXX_
#define _XMLSCRIPT_XML_HELPER_HXX_
+#ifndef _RTL_BYTESEQ_HXX_
#include <rtl/byteseq.hxx>
+#endif
+#ifndef _COM_SUN_STAR_XML_XIMPORTER_HXX_
#include <com/sun/star/xml/XImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HXX_
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_
#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HXX_
#include <com/sun/star/io/XOutputStream.hpp>
+#endif
namespace xmlscript
@@ -85,7 +94,7 @@ struct NameSpaceUid
};
//==================================================================================================
-::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >
+SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >
SAL_CALL createDocumentHandler(
NameSpaceUid const * pNamespaceUids, sal_Int32 nNameSpaceUids,
sal_Int32 nUnknownNamespaceUid,
@@ -94,12 +103,12 @@ SAL_CALL createDocumentHandler(
throw ();
//==================================================================================================
-::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
SAL_CALL createInputStream(
::rtl::ByteSequence const & rInData )
throw ();
//==================================================================================================
-::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
+SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
SAL_CALL createOutputStream(
::rtl::ByteSequence * pOutData )
throw ();
diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx
index 4ac42b439690..328b4c3e8a1b 100644
--- a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx
+++ b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_imexp.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ab $ $Date: 2001-02-26 12:59:16 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,6 +71,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#endif
+
namespace xmlscript
{
@@ -80,30 +81,35 @@ namespace xmlscript
//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL exportDialogModel(
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel,
- ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut )
+SAL_DLLEXPORT void
+SAL_CALL exportDialogModels(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > > const & rInModels )
throw (::com::sun::star::uno::Exception);
-
//==================================================================================================
SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >
-SAL_CALL importDialogModel(
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel )
+SAL_CALL importDialogModels(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > > * pOutModels )
throw (::com::sun::star::uno::Exception);
//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL exportDialogModelToByteSequence(
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel,
- ::com::sun::star::uno::Sequence< sal_Int8 >& aDestSequence )
+SAL_DLLEXPORT void
+SAL_CALL exportDialogModelsToByteSequence(
+ ::com::sun::star::uno::Sequence< sal_Int8 > * pOutBytes,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > > const & rInModels )
throw (::com::sun::star::uno::Exception);
-
//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL importDialogModelFromByteSequence(
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel,
- ::com::sun::star::uno::Sequence< sal_Int8 > const& aSourceSequence )
+SAL_DLLEXPORT void
+SAL_CALL importDialogModelsFromByteSequence(
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameContainer > > * pOutModels,
+ ::com::sun::star::uno::Sequence< sal_Int8 > const & rInBytes )
throw (::com::sun::star::uno::Exception);
};
#endif
-
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 8cab38857e34..9f091601d98f 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: imp_share.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dbo $ $Date: 2001-02-21 20:49:26 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -151,6 +151,8 @@ struct DialogImport
vector< OUString > _styleNames;
vector< Reference< xml::XImportContext > > _styles;
+ Reference< lang::XMultiServiceFactory > _xMgr;
+ Sequence< Reference< container::XNameContainer > > * _pOutModels;
public:
Reference< container::XNameContainer > _xDialogModel;
Reference< lang::XMultiServiceFactory > _xDialogModelFactory;
@@ -164,10 +166,14 @@ public:
throw ();
inline DialogImport(
- Reference< container::XNameContainer > const & xDialogModel )
- : _xDialogModel( xDialogModel )
- , _xDialogModelFactory( xDialogModel, UNO_QUERY )
- {}
+ Reference< lang::XMultiServiceFactory > const & xMgr,
+ Sequence< Reference< container::XNameContainer > > * pOutModels )
+ throw ()
+ : _xMgr( xMgr )
+ , _pOutModels( pOutModels )
+ { *_pOutModels = Sequence< Reference< container::XNameContainer > >(); }
+ virtual ~DialogImport()
+ throw ();
// XImporter
virtual void SAL_CALL startDocument()
@@ -390,6 +396,24 @@ public:
Reference< xml::sax2::XExtendedAttributes > const & xAttributes );
};
//==================================================================================================
+class DialogsElement
+ : public ControlElement
+{
+public:
+ virtual Reference< xml::XImportContext > SAL_CALL createChildContext(
+ sal_Int32 nUid, OUString const & rLocalName,
+ Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
+ throw (xml::sax::SAXException, RuntimeException);
+
+ inline DialogsElement(
+ OUString const & rLocalName,
+ Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
+ ElementBase * pParent, DialogImport * pImport )
+ throw ()
+ : ControlElement( rLocalName, xAttributes, pParent, pImport )
+ {}
+};
+//==================================================================================================
class WindowElement
: public ControlElement
{
diff --git a/xmlscript/source/xmldlg_imexp/makefile.mk b/xmlscript/source/xmldlg_imexp/makefile.mk
index a161f70db7c6..7a0f3137e2ab 100644
--- a/xmlscript/source/xmldlg_imexp/makefile.mk
+++ b/xmlscript/source/xmldlg_imexp/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: dbo $ $Date: 2001-02-16 14:14:48 $
+# last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -78,7 +78,8 @@ SLOFILES = \
$(SLO)$/xmldlg_import.obj \
$(SLO)$/xmldlg_impmodels.obj \
$(SLO)$/xmldlg_export.obj \
- $(SLO)$/xmldlg_expmodels.obj
+ $(SLO)$/xmldlg_expmodels.obj \
+ $(SLO)$/xmldlg_addfunc.obj
# --- Targets ------------------------------------------------------
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx
new file mode 100644
index 000000000000..af1f1da7e3e5
--- /dev/null
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: xmldlg_addfunc.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+
+#include <comphelper/processfactory.hxx>
+#include <xmlscript/xml_helper.hxx>
+#include <xmlscript/xmldlg_imexp.hxx>
+
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+namespace xmlscript
+{
+
+//==================================================================================================
+SAL_DLLEXPORT void SAL_CALL exportDialogModelsToByteSequence(
+ Sequence< sal_Int8 > * pOutBytes,
+ Sequence< Reference< container::XNameContainer > > const & rInModels )
+ throw (Exception)
+{
+ Reference< lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() );
+ if (! xSMgr.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no service manager available!") ),
+ Reference< XInterface >() );
+ }
+
+ Reference< xml::sax::XExtendedDocumentHandler > xHandler( xSMgr->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
+ OSL_ASSERT( xHandler.is() );
+ if (! xHandler.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("could not create sax-writer component!") ),
+ Reference< XInterface >() );
+ }
+
+ Reference< io::XActiveDataSource > xSource( xHandler, UNO_QUERY );
+ xSource->setOutputStream( createOutputStream( reinterpret_cast< ByteSequence * >( pOutBytes ) ) );
+
+ xHandler->startDocument();
+ exportDialogModels( xHandler, rInModels );
+ xHandler->endDocument();
+}
+
+//==================================================================================================
+SAL_DLLEXPORT void SAL_CALL importDialogModelsFromByteSequence(
+ Sequence< Reference< container::XNameContainer > > * pOutModels,
+ Sequence< sal_Int8 > const & rInBytes )
+ throw (Exception)
+{
+ Reference< lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() );
+ if (! xSMgr.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no service manager available!") ),
+ Reference< XInterface >() );
+ }
+
+ Reference< xml::sax::XParser > xParser( xSMgr->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser") ) ), UNO_QUERY );
+ OSL_ASSERT( xParser.is() );
+ if (! xParser.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("could not create sax-parser component!") ),
+ Reference< XInterface >() );
+ }
+
+ // error handler, entity resolver omitted for this helper function
+ xParser->setDocumentHandler( importDialogModels( pOutModels ) );
+
+ xml::sax::InputSource source;
+ source.aInputStream = createInputStream( * reinterpret_cast< ByteSequence const * >( &rInBytes ) );
+ source.sSystemId = OUString( RTL_CONSTASCII_USTRINGPARAM("virtual file") );
+
+ xParser->parseStream( source );
+}
+
+};
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index b16937ec5dae..ab14e8c6af6c 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_export.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: ab $ $Date: 2001-02-26 09:54:48 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,18 +72,11 @@
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWidth.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/XParser.hpp>
-
-#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
-#include <comphelper/processfactory.hxx>
-#endif
-
-
#include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
#include <xmlscript/xml_helper.hxx>
@@ -920,9 +913,9 @@ void ElementDescriptor::dump( Reference< xml::sax::XExtendedDocumentHandler > co
}
//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL exportDialogModel(
- Reference< container::XNameContainer > const & xDialogModel,
- Reference< xml::sax::XExtendedDocumentHandler > const & xOut )
+static void exportDialogModel(
+ Reference< xml::sax::XExtendedDocumentHandler > const & xOut,
+ Reference< container::XNameContainer > const & xDialogModel )
throw (Exception)
{
StyleBag all_styles;
@@ -1135,7 +1128,7 @@ SAL_DLLEXPORT void SAL_CALL exportDialogModel(
}
else
{
- throw Exception(
+ throw RuntimeException(
OUString( RTL_CONSTASCII_USTRINGPARAM("unknown control type: ") ) + aControlType,
Reference< XInterface >() );
}
@@ -1153,8 +1146,6 @@ SAL_DLLEXPORT void SAL_CALL exportDialogModel(
OUString aWindowName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":window") );
ElementDescriptor * pWindow = new ElementDescriptor( xProps, xPropState, aWindowName );
Reference< xml::sax::XAttributeList > xWindow( pWindow );
- pWindow->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ),
- OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) );
pWindow->readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":label") ) );
pWindow->readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ),
@@ -1192,71 +1183,31 @@ SAL_DLLEXPORT void SAL_CALL exportDialogModel(
}
}
-
//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL exportDialogModelToByteSequence(
- uno::Reference< container::XNameContainer > const & xDialogModel,
- uno::Sequence< sal_Int8 >& aDestSequence )
- throw (uno::Exception)
+SAL_DLLEXPORT void SAL_CALL exportDialogModels(
+ Reference< xml::sax::XExtendedDocumentHandler > const & xOut,
+ Sequence< Reference< container::XNameContainer > > const & rInModels )
+ throw (Exception)
{
- Reference< lang::XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() );
- if( !xSMgr.is() )
- return;
+ // open up dialogs
+ OUString aDialogsName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":dialogs") );
+ ElementDescriptor * pDialogs = new ElementDescriptor( aDialogsName );
+ Reference< xml::sax::XAttributeList > xDialogs( pDialogs );
+ pDialogs->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) );
+ xOut->ignorableWhitespace( OUString() );
+ xOut->startElement( aDialogsName, xDialogs );
- Reference< xml::sax::XExtendedDocumentHandler >
- xHandler( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
- OSL_ASSERT( xHandler.is() );
- if (! xHandler.is())
+ // write windows
+ Reference< container::XNameContainer > const * pModels = rInModels.getConstArray();
+ for ( sal_Int32 nPos = 0; nPos < rInModels.getLength(); ++nPos )
{
- OSL_ENSURE( 0, "### couln't create sax-writer component\n" );
+ exportDialogModel( xOut, pModels[ nPos ] );
}
- Reference< io::XActiveDataSource > xSource( xHandler, UNO_QUERY );
- xSource->setOutputStream( ::xmlscript::createOutputStream( (ByteSequence*)&aDestSequence ) );
-
- xHandler->startDocument();
-
- ::xmlscript::exportDialogModel(
- xDialogModel, Reference< xml::sax::XExtendedDocumentHandler >::query( xHandler ) );
-
- xHandler->endDocument();
-}
-
-//==================================================================================================
-SAL_DLLEXPORT void SAL_CALL importDialogModelFromByteSequence(
- uno::Reference< container::XNameContainer > const & xDialogModel,
- uno::Sequence< sal_Int8 > const& aSourceSequence )
- throw (uno::Exception)
-{
- Reference< lang::XMultiServiceFactory > xSMgr( comphelper::getProcessServiceFactory() );
- if( !xSMgr.is() )
- return;
-
- Reference< xml::sax::XParser > xParser( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser") ) ), UNO_QUERY );
- if (xParser.is())
- {
- //ErrorHandler * pHandler = new ErrorHandler();
- //xParser->setErrorHandler( (xml::sax::XErrorHandler *)pHandler );
- //xParser->setEntityResolver( (xml::sax::XEntityResolver *)pHandler );
-
- OSL_ASSERT( xDialogModel.is() );
- xParser->setDocumentHandler( ::xmlscript::importDialogModel( xDialogModel ) );
-
-
- xml::sax::InputSource source;
- source.aInputStream = ::xmlscript::createInputStream( *(ByteSequence*)&aSourceSequence );
- source.sSystemId = OUString::createFromAscii( "virtual file" );
-
- // start parsing
- xParser->parseStream( source );
- }
- else
- {
- OSL_ENSURE( 0, "### couln't create sax-parser component\n" );
- }
+ // end dialogs
+ xOut->ignorableWhitespace( OUString() );
+ xOut->endElement( aDialogsName );
}
-
};
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 1c926874fb4f..fc727062c388 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_impmodels.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dbo $ $Date: 2001-02-21 20:49:27 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1555,4 +1555,61 @@ void WindowElement::endElement()
}
}
+//##################################################################################################
+
+// dialogs
+//__________________________________________________________________________________________________
+Reference< xml::XImportContext > DialogsElement::createChildContext(
+ sal_Int32 nUid, OUString const & rLocalName,
+ Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
+ throw (xml::sax::SAXException, RuntimeException)
+{
+ if (XMLNS_DIALOGS_UID != nUid)
+ {
+ throw xml::sax::SAXException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ),
+ Reference< XInterface >(), Any() );
+ }
+ // window
+ else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("window") ))
+ {
+ // new model
+ _pImport->_xDialogModel = Reference< container::XNameContainer >::query( _pImport->_xMgr->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialogModel") ) ) );
+ OSL_ASSERT( _pImport->_xDialogModel.is() );
+ if (! _pImport->_xDialogModel.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("could not instanciate dialog model!") ),
+ Reference< XInterface >() );
+ }
+
+ _pImport->_xDialogModelFactory = Reference< lang::XMultiServiceFactory >::query(
+ _pImport->_xDialogModel );
+ OSL_ASSERT( _pImport->_xDialogModelFactory.is() );
+ if (! _pImport->_xDialogModel.is())
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("could not query for dialog model factory!") ),
+ Reference< XInterface >() );
+ }
+
+ // new style set
+ _pImport->_styleNames.clear();
+ _pImport->_styles.clear();
+
+ sal_Int32 nSize = _pImport->_pOutModels->getLength();
+ _pImport->_pOutModels->realloc( nSize +1 );
+ _pImport->_pOutModels->getArray()[ nSize ] = _pImport->_xDialogModel;
+
+ return new WindowElement( rLocalName, xAttributes, this, _pImport );
+ }
+ else
+ {
+ throw xml::sax::SAXException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("expected window element, not ") ) +
+ rLocalName, Reference< XInterface >(), Any() );
+ }
+}
+
};
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index a0f1df001f22..34d28a5e1e19 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_import.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dbo $ $Date: 2001-02-21 20:49:27 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,6 +66,7 @@
#include <rtl/ustrbuf.hxx>
#include <xmlscript/xml_helper.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/CharSet.hpp>
#include <com/sun/star/awt/FontFamily.hpp>
@@ -879,7 +880,7 @@ void ControlImportContext::importEvents(
getStringAttr( &descr.ScriptType,
OUString( RTL_CONSTASCII_USTRINGPARAM("script-type") ),
xEvent );
- getStringAttr( &descr.ScriptType,
+ getStringAttr( &descr.ScriptCode,
OUString( RTL_CONSTASCII_USTRINGPARAM("script-code") ),
xEvent );
getStringAttr( &descr.AddListenerParam,
@@ -980,6 +981,11 @@ ElementBase::~ElementBase()
{
_pParent->release();
}
+
+#ifdef DEBUG
+ OString aStr( OUStringToOString( _aLocalName, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_TRACE( "ElementBase::~ElementBase(): %s\n", aStr.getStr() );
+#endif
}
//##################################################################################################
@@ -1017,18 +1023,32 @@ Reference< xml::XImportContext > DialogImport::createRootContext(
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException)
{
- if (nUid == XMLNS_DIALOGS_UID &&
- rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("window") ))
+ if (XMLNS_DIALOGS_UID != nUid)
+ {
+ throw xml::sax::SAXException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ),
+ Reference< XInterface >(), Any() );
+ }
+ // dialogs
+ else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dialogs") ))
{
- return new WindowElement( rLocalName, xAttributes, 0, this );
+ return new DialogsElement( rLocalName, xAttributes, 0, this );
}
else
{
throw xml::sax::SAXException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("illegal root element given for dialog: ") ) +
+ OUString( RTL_CONSTASCII_USTRINGPARAM("illegal root element (expected dialogs) given: ") ) +
rLocalName, Reference< XInterface >(), Any() );
}
}
+//__________________________________________________________________________________________________
+DialogImport::~DialogImport()
+ throw ()
+{
+#ifdef DEBUG
+ OSL_TRACE( "DialogImport::~DialogImport().\n" );
+#endif
+}
//__________________________________________________________________________________________________
void DialogImport::addStyle(
@@ -1057,19 +1077,26 @@ Reference< xml::XImportContext > DialogImport::getStyle(
//##################################################################################################
//==================================================================================================
-SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel(
- Reference< container::XNameContainer > const & xDialogModel )
+SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModels(
+ Sequence< Reference< container::XNameContainer > > * pOutModels )
throw (Exception)
{
- NameSpaceUid arNamespaceUids[] =
+ Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ if (! xMgr.is())
{
+ throw Exception(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no service manager available!") ),
+ Reference< XInterface >() );
+ }
+
+ NameSpaceUid arNamespaceUids[] = {
NameSpaceUid( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ), XMLNS_DIALOGS_UID )
};
return ::xmlscript::createDocumentHandler(
arNamespaceUids, sizeof(arNamespaceUids) / sizeof(NameSpaceUid),
-1 /* unknown namespace id */,
- static_cast< xml::XImporter * >( new DialogImport( xDialogModel ) ) );
+ static_cast< xml::XImporter * >( new DialogImport( xMgr, pOutModels ) ) );
}
};
diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx
index 203c0c56249e..c83d1c75f756 100644
--- a/xmlscript/test/imexp.cxx
+++ b/xmlscript/test/imexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: imexp.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dbo $ $Date: 2001-02-20 14:05:25 $
+ * last change: $Author: dbo $ $Date: 2001-02-27 12:45:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,52 +99,6 @@ using namespace ::com::sun::star::uno;
-//-----------------------------------------
-// The document handler, which is needed for the saxparser
-// The Documenthandler for reading sax
-//-----------------------------------------
-class ErrorHandler :
- public WeakImplHelper2< xml::sax::XEntityResolver , xml::sax::XErrorHandler >
-{
-public:
- ErrorHandler()
- {}
-
-public: // Error handler
- virtual void SAL_CALL error(const Any& aSAXParseException) throw (xml::sax::SAXException, RuntimeException)
- {
- OSL_ENSURE( 0, "Error !\n" );
- Exception exc;
- OSL_VERIFY( aSAXParseException >>= exc );
- throw exc;
- }
- virtual void SAL_CALL fatalError(const Any& aSAXParseException) throw (xml::sax::SAXException, RuntimeException)
- {
- OSL_ENSURE( 0, "Fatal Error !\n" );
- Exception exc;
- OSL_VERIFY( aSAXParseException >>= exc );
- throw exc;
- }
- virtual void SAL_CALL warning(const Any& aSAXParseException) throw (xml::sax::SAXException, RuntimeException)
- {
- OSL_ENSURE( 0, "Warning !\n" );
- Exception exc;
- OSL_VERIFY( aSAXParseException >>= exc );
- throw exc;
- }
-
- virtual xml::sax::InputSource SAL_CALL resolveEntity(
- const OUString& sPublicId,
- const OUString& sSystemId)
- throw (xml::sax::SAXException,RuntimeException)
- {
- OSL_ENSURE( 0, "not impl !\n" );
- return xml::sax::InputSource();
- }
-};
-
-
-
Reference< lang::XMultiServiceFactory > createApplicationServiceManager()
{
Reference< lang::XMultiServiceFactory > xReturn = createServiceFactory();
@@ -255,87 +209,43 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager()
// -----------------------------------------------------------------------
-Reference< container::XNameContainer > importFile(
- char const * fname,
- Reference< lang::XMultiServiceFactory > const & xSMgr )
+Sequence< Reference< container::XNameContainer > > importFile(
+ char const * fname )
{
- Reference< xml::sax::XParser > xParser( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser") ) ), UNO_QUERY );
- if (xParser.is())
+ // create the input stream
+ FILE *f = ::fopen( fname, "rb" );
+ if (f)
{
- ErrorHandler * pHandler = new ErrorHandler();
- xParser->setErrorHandler( (xml::sax::XErrorHandler *)pHandler );
- xParser->setEntityResolver( (xml::sax::XEntityResolver *)pHandler );
-
- Reference< container::XNameContainer > xModel( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel") ) ), UNO_QUERY );
- OSL_ASSERT( xModel.is() );
- xParser->setDocumentHandler( ::xmlscript::importDialogModel( xModel ) );
-
- // create the input stream
- FILE *f = ::fopen( fname, "rb" );
- if (f)
- {
- ::fseek( f, 0 ,SEEK_END );
- int nLength = ::ftell( f );
- ::fseek( f, 0, SEEK_SET );
+ ::fseek( f, 0 ,SEEK_END );
+ int nLength = ::ftell( f );
+ ::fseek( f, 0, SEEK_SET );
- ByteSequence seqIn( nLength );
- ::fread( seqIn.getArray(), nLength, 1, f );
- ::fclose( f );
+ Sequence< sal_Int8 > bytes( nLength );
+ ::fread( bytes.getArray(), nLength, 1, f );
+ ::fclose( f );
- xml::sax::InputSource source;
- source.aInputStream = ::xmlscript::createInputStream( seqIn );
- source.sSystemId = OUString::createFromAscii( fname );
-
- // start parsing
- xParser->parseStream( source );
- return xModel;
- }
- else
- {
- OSL_ENSURE( 0, "### Cannot read file!\n" );
- }
+ Sequence< Reference< container::XNameContainer > > models;
+ ::xmlscript::importDialogModelsFromByteSequence( &models, bytes );
+ return models;
}
else
{
- OSL_ENSURE( 0, "### couln't create sax-parser component\n" );
+ throw Exception( OUString( RTL_CONSTASCII_USTRINGPARAM("### Cannot read file!") ),
+ Reference< XInterface >() );
}
- return Reference< container::XNameContainer >();
}
-bool exportToFile(
+void exportToFile(
char const * fname,
- Reference< container::XNameContainer > const & xModel,
- Reference< lang::XMultiServiceFactory > const & xSMgr )
+ Sequence< Reference< container::XNameContainer > > const & models )
{
- Reference< xml::sax::XExtendedDocumentHandler > xHandler(
- xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
- OSL_ASSERT( xHandler.is() );
- if (! xHandler.is())
- {
- OSL_ENSURE( 0, "### couln't create sax-writer component\n" );
- return false;
- }
-
- ByteSequence seq;
- Reference< io::XActiveDataSource > xSource( xHandler, UNO_QUERY );
- xSource->setOutputStream( ::xmlscript::createOutputStream( &seq ) );
-
- xHandler->startDocument();
-
- ::xmlscript::exportDialogModel(
- xModel,
- Reference< xml::sax::XExtendedDocumentHandler >::query( xHandler ) );
-
- xHandler->endDocument();
+ Sequence< sal_Int8 > bytes;
+ ::xmlscript::exportDialogModelsToByteSequence( &bytes, models );
FILE * f = ::fopen( fname, "w" );
- ::fwrite( seq.getConstArray(), 1 ,seq.getLength(), f );
+ ::fwrite( bytes.getConstArray(), 1, bytes.getLength(), f );
::fflush( f );
::fclose( f );
- return true;
}
@@ -369,25 +279,29 @@ void MyApp::Main()
Reference< awt::XToolkit> xToolkit( xMSF->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.ExtToolkit" ) ) ), UNO_QUERY );
- // import dialog
+ // import dialogs
OString aParam1( OUStringToOString( OUString( GetCommandLineParam( 0 ) ), RTL_TEXTENCODING_ASCII_US ) );
- Reference< container::XNameContainer > xImport( importFile( aParam1.getStr(), xMSF ) );
+ Sequence< Reference< container::XNameContainer > > models( importFile( aParam1.getStr() ) );
if (GetCommandLineParamCount() == 2)
{
// write and read again dialogs
OString aParam2( OUStringToOString( OUString( GetCommandLineParam( 1 ) ), RTL_TEXTENCODING_ASCII_US ) );
- exportToFile( aParam2.getStr(), xImport, xMSF );
+ exportToFile( aParam2.getStr(), models );
// re-import
- xImport = importFile( aParam2.getStr(), xMSF );
+ models = importFile( aParam2.getStr() );
}
- Reference< awt::XControl > xDlg( xMSF->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), UNO_QUERY );
- xDlg->setModel( Reference< awt::XControlModel >::query( xImport ) );
- xDlg->createPeer( xToolkit, NULL );
- Reference< awt::XDialog > xD( xDlg, UNO_QUERY );
- xD->execute();
+ Reference< container::XNameContainer > const * pModels = models.getConstArray();
+ for ( sal_Int32 nPos = 0; nPos < models.getLength(); ++nPos )
+ {
+ Reference< awt::XControl > xDlg( xMSF->createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), UNO_QUERY );
+ xDlg->setModel( Reference< awt::XControlModel >::query( pModels[ nPos ] ) );
+ xDlg->createPeer( xToolkit, 0 );
+ Reference< awt::XDialog > xD( xDlg, UNO_QUERY );
+ xD->execute();
+ }
}
catch (uno::Exception & rExc)
{
diff --git a/xmlscript/test/test.xml b/xmlscript/test/test.xml
index f9c62c66198b..0071adeed71b 100644
--- a/xmlscript/test/test.xml
+++ b/xmlscript/test/test.xml
@@ -1,119 +1,69 @@
-<window xmlns="http://openoffice.org/2000/dialog"
- xmlns:dlg="http://openoffice.org/2000/dialog"
-
- label="Test-Dialog" height="800" width="800">
-
-<dlg:styles>
- <dlg:style style-id="bla" background-color="0xffffff" dlg:text-color="255"/>
- <dlg:style style-id="bla2" background-color="0xff00ff" dlg:text-color="255193873"/>
- <dlg:style style-id="bla3" background-color="0" dlg:text-color="0xffffff" font-name="Arial" font-height="24"/>
- <dlg:style style-id="no_border" border="none"/>
-</dlg:styles>
-
- <dlg:bulletinboard xmlns:ns="http://www.fake">
-
- <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"/>
- </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"/>
-
- <checkbox id="check1" value="checked" left="50" top="150" width="100" height="20"
- checked="true"
- />
- <checkbox id="check2" value="dontknow" left="50" top="170" width="100" height="20"
- tristate="true"
- />
- <checkbox id="check3" value="tristate_checked" left="50" top="190" width="100" height="20"
- checked="true"
- tristate="true"
- />
-
- <menulist id="list1" multiselection="true" left="50" top="400" width="100" height="100">
- <menupopup>
- <menuitem value="item1"/>
- <menuitem value="item2" selected="true"/>
- <menuitem value="item3" selected="true"/>
- </menupopup>
- </menulist>
-
- <menulist id="list2" left="250" top="400" width="100" height="100">
- <menupopup>
- <menuitem value="item4"/>
- <menuitem value="item5" selected="true"/>
- <menuitem value="item6"/>
- </menupopup>
- </menulist>
-
- <combobox id="combo1" value="combotext1" left="250" top="150" width="50" height="50"
- >
- <menupopup>
- <menuitem value="Citem1"/>
- <menuitem value="Citem2"/>
- </menupopup>
- </combobox>
- <combobox id="combo2" value="combotext2" left="310" top="150" width="50" height="50"
- spin="true"
- >
- <menupopup>
- <menuitem value="Citem3"/>
- <menuitem value="Citem4"/>
- </menupopup>
- </combobox>
-
- <radiogroup>
- <radio id="radio1" value="radio1" left="50" top="250" width="100" height="20"
- />
- <radio id="radio2" value="checked" left="50" top="270" width="100" height="20"
- checked="true"
- />
- <radio id="radio3" value="unchecked" left="50" top="290" width="100" height="20"
- checked="false"
- />
- </radiogroup>
-
- <titledbox id="groupbox1" left="250" top="250" width="120" height="100">
- <title value="grouped"/>
- <radio id="radio4" value="default radio" left="5" top="15" width="100" height="20"
- />
- <radio id="radio5" value="dontknow" left="5" top="35" width="100" height="20"
- tristate="true"
- />
- <radio id="radio6" value="tristate_checked" left="5" top="55" width="100" height="20"
- tristate="true"
- checked="true"
- />
- <radio id="radio7" value="checked" left="5" top="75" width="100" height="20"
- checked="true"
- />
- </titledbox>
-
- <text id="fixed1" left="50" top="520" width="180" height="20"
- value="fixed text is here..."
- multiline="true"
- align="center"/>
-
- <textfield id="field1" left="250" top="520" width="50" height="40"
- value="edit text here..." readonly="true" vscroll="true"
- multiline="true"
- align="right" style-id="no_border"/>
-
- <textfield id="field2" left="320" top="520" width="50" height="40"
- value="hidden text" hscroll="true"
- echochar="*"
- align="left"/>
-
- <img id="image1" left="50" top="600" width="80" height="50"
- src="../../test/w3c.jpg"/>
-
- <filecontrol id="file1" left="150" top="600" width="100" height="100"
- value="f:\script\xmlscript\test\w3c.jpg"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dialogs SYSTEM "../dtd/dialog.dtd">
+
+<dialogs xmlns="http://openoffice.org/2000/dialog">
+
+ <window xmlns:dlg="http://openoffice.org/2000/dialog"
+ label="Test-Dialog" height="800" width="800">
+
+ <dlg:styles>
+ <dlg:style style-id="bla" background-color="0xffffff" dlg:text-color="255"/>
+ <dlg:style style-id="bla2" background-color="0xff00ff" dlg:text-color="255193873"/>
+ <dlg:style style-id="bla3" background-color="0" dlg:text-color="0xffffff" font-name="Arial" font-height="24"/>
+ <dlg:style style-id="no_border" border="none"/>
+ </dlg:styles>
+
+ <dlg:bulletinboard xmlns:ns="http://www.fake">
+ <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"/>
+ </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"/>
+ <checkbox id="check1" value="checked" left="50" top="150" width="100" height="20" checked="true"/>
+ <checkbox id="check2" value="dontknow" left="50" top="170" width="100" height="20" tristate="true"/>
+ <checkbox id="check3" value="tristate_checked" left="50" top="190" width="100" height="20" checked="true" tristate="true"/>
+ <menulist id="list1" multiselection="true" left="50" top="400" width="100" height="100">
+ <menupopup>
+ <menuitem value="item1"/>
+ <menuitem value="item2" selected="true"/>
+ <menuitem value="item3" selected="true"/>
+ </menupopup>
+ </menulist>
+ <menulist id="list2" left="250" top="400" width="100" height="100">
+ <menupopup>
+ <menuitem value="item4"/>
+ <menuitem value="item5" selected="true"/>
+ <menuitem value="item6"/>
+ </menupopup>
+ </menulist>
+ <combobox id="combo1" value="combotext1" left="250" top="150" width="50" height="50">
+ <menupopup>
+ <menuitem value="Citem1"/>
+ <menuitem value="Citem2"/>
+ </menupopup>
+ </combobox>
+ <combobox id="combo2" value="combotext2" left="310" top="150" width="50" height="50" spin="true">
+ <menupopup>
+ <menuitem value="Citem3"/>
+ <menuitem value="Citem4"/>
+ </menupopup>
+ </combobox>
+ <radiogroup>
+ <radio id="radio1" value="radio1" left="50" top="250" width="100" height="20"/>
+ <radio id="radio2" value="checked" left="50" top="270" width="100" height="20" checked="true"/>
+ <radio id="radio3" value="unchecked" left="50" top="290" width="100" height="20" checked="false"/>
+ </radiogroup>
+ <titledbox id="groupbox1" left="250" top="250" width="120" height="100">
+ <title value="grouped"/>
+ <radio id="radio4" value="default radio" left="5" top="15" width="100" height="20"/>
+ <radio id="radio5" value="dontknow" left="5" top="35" width="100" height="20" tristate="true"/>
+ <radio id="radio6" value="tristate_checked" left="5" top="55" width="100" height="20" tristate="true" checked="true"/>
+ <radio id="radio7" value="checked" left="5" top="75" width="100" height="20" checked="true"/>
+ </titledbox>
+ <text id="fixed1" left="50" top="520" width="180" height="20" value="fixed text is here..." multiline="true" align="center"/>
+ <textfield id="field1" left="250" top="520" width="50" height="40" value="edit text here..." readonly="true" vscroll="true" multiline="true" align="right" style-id="no_border"/>
+ <textfield id="field2" left="320" top="520" width="50" height="40" value="hidden text" hscroll="true" echochar="*" align="left"/>
+ <img id="image1" left="50" top="600" width="80" height="50" src="../../test/w3c.jpg"/>
+ <filecontrol id="file1" left="150" top="600" width="100" height="100" value="f:\script\xmlscript\test\w3c.jpg"/>
<!--
<currencyfield id="currency1" left="250" top="600" width="100" height="20"
value="5.6075" value-min="0.5" value-max="10.0" value-step="0.1"
@@ -123,19 +73,19 @@
value="5.6075" value-min="0.5" value-max="10.0" value-step="0.1"
thousands-separator="true" />
-->
+ </dlg:bulletinboard>
- <datefield id="datefield1" left="400" top="50" width="100" height="20"
- date-format="short DDMMYY"
- spin="true"/>
+ </window>
- <timefield id="time1" left="400" top="150" width="100" height="20"
- time-format="24h short" value-min="0" value-max="12"
- strict-format="true" value="6"
- spin="true"/>
+ <window xmlns:dlg2="http://openoffice.org/2000/dialog"
+ label="Test-Dialog2" height="100" width="200">
- <patternfield id="pattern1" left="400" top="200" width="100" height="20"
- value="pattern" strict-format="true" readonly="true"/>
+ <dlg2:bulletinboard>
+ <dlg2:datefield id="datefield1" left="20" top="20" width="100" height="20" date-format="short DDMMYY" spin="true"/>
+ <timefield id="time1" left="20" top="50" width="100" height="20" time-format="24h short" value-min="0" value-max="12" strict-format="true" value="6" spin="true"/>
+ <patternfield id="pattern1" left="20" top="70" width="100" height="20" value="pattern" strict-format="true" readonly="true"/>
+ </dlg2:bulletinboard>
- </dlg:bulletinboard>
+ </window>
-</window>
+</dialogs>