summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2001-08-24 10:16:43 +0000
committerDaniel Boelzle <dbo@openoffice.org>2001-08-24 10:16:43 +0000
commitcaf2c85cac562a6ed54bc463d874daf2835f68bb (patch)
tree4c2dbb94109748ffddf8a4600e7c57e3f5016111
parentf3bf41f42986cea39068080cdb77833e51d4d7b0 (diff)
#90686# write event sub elements
-rw-r--r--xmlscript/inc/xmlscript/xml_helper.hxx42
-rw-r--r--xmlscript/source/xml_helper/xml_element.cxx17
-rw-r--r--xmlscript/source/xmldlg_imexp/exp_share.hxx9
-rw-r--r--xmlscript/source/xmldlg_imexp/imp_share.hxx6
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx6
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx9
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx13
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx6
-rw-r--r--xmlscript/test/test.xml2
-rw-r--r--xmlscript/util/defs/wntmsci812
10 files changed, 72 insertions, 50 deletions
diff --git a/xmlscript/inc/xmlscript/xml_helper.hxx b/xmlscript/inc/xmlscript/xml_helper.hxx
index 31a43ccf2860..eed30e1f1b4d 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.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: dbo $ $Date: 2001-04-04 14:35:07 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,33 +103,28 @@ public:
/** Adds a sub element of element.
- @param xElem
- element reference
+ @param xElem element reference
*/
- void SAL_CALL addSubElement( ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > const & xElem )
+ void SAL_CALL addSubElement(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > const & xElem )
SAL_THROW( () );
- /** Gets sub element of given index. The index follows order in which sub elements
- were added.
+ /** Gets sub element of given index. The index follows order in which sub elements were added.
- @param nIndex
- index of sub element
+ @param nIndex index of sub element
*/
- ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
SAL_THROW( () );
- /** Adds an attribute to elements
+ /** Adds an attribute to elements.
@param rAttrName qname of attribute
@param rValue value string of element
*/
- void SAL_CALL addAttribute(
- ::rtl::OUString const & rAttrName, ::rtl::OUString const & rValue )
+ void SAL_CALL addAttribute( ::rtl::OUString const & rAttrName, ::rtl::OUString const & rValue )
SAL_THROW( () );
- /** Gets the tag name (qname) of element
+ /** Gets the tag name (qname) of element.
@return
qname of element
@@ -137,13 +132,18 @@ public:
inline ::rtl::OUString SAL_CALL getName() SAL_THROW( () )
{ return _name; }
- /** Dumps out element (and all sub element).
+ /** Dumps out element (and all sub elements).
- @param xOut
- document handler to be written to
+ @param xOut document handler to be written to
*/
- void SAL_CALL dump( ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut );
+ void SAL_CALL dump(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut );
+ /** Dumps out sub elements (and all further sub elements).
+
+ @param xOut document handler to be written to
+ */
+ void SAL_CALL dumpSubElements(
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut );
// XAttributeList
virtual sal_Int16 SAL_CALL getLength()
diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx
index 5bffd3ce2b0d..d2656ecc2242 100644
--- a/xmlscript/source/xml_helper/xml_element.cxx
+++ b/xmlscript/source/xml_helper/xml_element.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xml_element.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,16 +89,21 @@ Reference< xml::sax::XAttributeList > XMLElement::getSubElement( sal_Int32 nInde
return _subElems[ (size_t)nIndex ];
}
//__________________________________________________________________________________________________
-void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut )
+void XMLElement::dumpSubElements( Reference< xml::sax::XExtendedDocumentHandler > const & xOut )
{
- xOut->ignorableWhitespace( OUString() );
- xOut->startElement( _name, static_cast< xml::sax::XAttributeList * >( this ) );
- // write sub elements
for ( size_t nPos = 0; nPos < _subElems.size(); ++nPos )
{
XMLElement * pElem = static_cast< XMLElement * >( _subElems[ nPos ].get() );
pElem->dump( xOut );
}
+}
+//__________________________________________________________________________________________________
+void XMLElement::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut )
+{
+ xOut->ignorableWhitespace( OUString() );
+ xOut->startElement( _name, static_cast< xml::sax::XAttributeList * >( this ) );
+ // write sub elements
+ dumpSubElements( xOut );
//
xOut->ignorableWhitespace( OUString() );
xOut->endElement( _name );
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index c813fca70558..2f5d6e473a39 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: exp_share.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -184,7 +184,4 @@ inline void ElementDescriptor::addBoolAttr( OUString const & rAttrName, sal_Bool
: OUString( RTL_CONSTASCII_USTRINGPARAM("false") )) );
}
-//##################################################################################################
-
-
-};
+}
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index c10d9a541490..e71dc14c9d1a 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.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -852,4 +852,4 @@ public:
{}
};
-};
+}
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 98499b771e83..f5a2c779f963 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_expmodels.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: dbo $ $Date: 2001-08-16 14:11:24 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -811,4 +811,4 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles )
readEvents();
}
-};
+}
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index b28b35006ec3..43bec4363167 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.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1206,7 +1206,8 @@ void SAL_CALL exportDialogModel(
pWindow->readDialogModel( &all_styles );
xOut->ignorableWhitespace( OUString() );
xOut->startElement( aWindowName, xWindow );
-
+ // dump out events
+ pWindow->dumpSubElements( xOut );
// dump out stylebag
all_styles.dump( xOut );
@@ -1236,4 +1237,4 @@ void SAL_CALL exportDialogModel(
xOut->endDocument();
}
-};
+}
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index eecb1fac2314..0638024d3b82 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.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: dbo $ $Date: 2001-08-16 14:11:24 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1586,7 +1586,12 @@ Reference< xml::XImportContext > WindowElement::createChildContext(
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
throw (xml::sax::SAXException, RuntimeException)
{
- if (XMLNS_DIALOGS_UID != nUid)
+ // event
+ if (isEventElement( nUid, rLocalName ))
+ {
+ return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
+ }
+ else if (XMLNS_DIALOGS_UID != nUid)
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ),
@@ -1668,4 +1673,4 @@ void WindowElement::endElement()
ctx.importEvents( _events );
}
-};
+}
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 5e8b1c45ccc0..743564f63e58 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.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dbo $ $Date: 2001-08-07 10:55:46 $
+ * last change: $Author: dbo $ $Date: 2001-08-24 11:16:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1319,4 +1319,4 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel(
static_cast< xml::XImporter * >( new DialogImport( xDialogModel ) ) );
}
-};
+}
diff --git a/xmlscript/test/test.xml b/xmlscript/test/test.xml
index 847bc49445e3..fd5ce8350c51 100644
--- a/xmlscript/test/test.xml
+++ b/xmlscript/test/test.xml
@@ -7,6 +7,8 @@
style-id="dialog"
id="window1" title="Test-Dialog" left="50" top="50" height="690" width="400">
+ <script:event script:event-name="on-rowchange" script:macro-name="ExecutingMacro" script:location="application" script:language="StarBasic"/>
+
<dlg:styles xmlns:dlg="http://openoffice.org/2000/dialog">
<dlg:style style-id="bla" background-color="0xffffff" dlg:text-color="255"/>
<dlg:style style-id="bla3" background-color="0" dlg:text-color="0xffffff" font-name="Arial" font-height="24"/>
diff --git a/xmlscript/util/defs/wntmsci8 b/xmlscript/util/defs/wntmsci8
index ff283209e2f6..68f9c4df3065 100644
--- a/xmlscript/util/defs/wntmsci8
+++ b/xmlscript/util/defs/wntmsci8
@@ -863,3 +863,15 @@ cpp_queryInterface
?setDocumentLocator@ModuleImport@xmlscript@@UAAXABV?$Reference@VXLocator@sax@xml@star@sun@com@@@uno@star@sun@com@@@Z
?startDocument@ModuleImport@xmlscript@@UAAXXZ
?exportScriptModule@xmlscript@@YAXABV?$Reference@VXExtendedDocumentHandler@sax@xml@star@sun@com@@@uno@star@sun@com@@ABUModuleDescriptor@1@@Z
+??0ElementBase@xmlscript@@QAE@JABVOUString@rtl@@ABV?$Reference@VXExtendedAttributes@sax2@xml@star@sun@com@@@uno@star@sun@com@@PAV01@PAUDialogImport@1@@Z
+??0OString@rtl@@QAE@PBGJGK@Z
+??1OString@rtl@@QAE@XZ
+?OUStringToOString@rtl@@YA?AVOString@1@ABVOUString@1@GK@Z
+?g_pEventTranslations@xmlscript@@3QBUStringTriple@1@B
+?getBoolAttr@xmlscript@@YA_NPAEABVOUString@rtl@@ABV?$Reference@VXExtendedAttributes@sax2@xml@star@sun@com@@@uno@star@sun@com@@J@Z
+?getLongAttr@xmlscript@@YA_NPAJABVOUString@rtl@@ABV?$Reference@VXExtendedAttributes@sax2@xml@star@sun@com@@@uno@star@sun@com@@J@Z
+?getStr@OString@rtl@@QBEPBDXZ
+?getStringAttr@xmlscript@@YA_NPAVOUString@rtl@@ABV23@ABV?$Reference@VXExtendedAttributes@sax2@xml@star@sun@com@@@uno@star@sun@com@@J@Z
+?importEvents@ImportContext@xmlscript@@QAEXABV?$vector@V?$Reference@VXImportContext@xml@star@sun@com@@@uno@star@sun@com@@V?$allocator@V?$Reference@VXImportContext@xml@star@sun@com@@@uno@star@sun@com@@@_STL@@@_STL@@@Z
+??0EventElement@xmlscript@@QAE@JABVOUString@rtl@@ABV?$Reference@VXExtendedAttributes@sax2@xml@star@sun@com@@@uno@star@sun@com@@PAVElementBase@1@PAUDialogImport@1@@Z
+?getEvents@ControlElement@xmlscript@@QAEPBV?$vector@V?$Reference@VXImportContext@xml@star@sun@com@@@uno@star@sun@com@@V?$allocator@V?$Reference@VXImportContext@xml@star@sun@com@@@uno@star@sun@com@@@_STL@@@_STL@@XZ