summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmlscript/inc/xmlscript/xml_helper.hxx114
-rw-r--r--xmlscript/source/xml_helper/makefile.mk5
-rw-r--r--xmlscript/source/xml_helper/xml_element.cxx157
-rw-r--r--xmlscript/source/xmldlg_imexp/exp_share.hxx65
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx120
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx393
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx6
7 files changed, 507 insertions, 353 deletions
diff --git a/xmlscript/inc/xmlscript/xml_helper.hxx b/xmlscript/inc/xmlscript/xml_helper.hxx
index 558ec65269..8e9736c552 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.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dbo $ $Date: 2001-03-14 16:39:40 $
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,15 +61,21 @@
#ifndef _XMLSCRIPT_XML_HELPER_HXX_
#define _XMLSCRIPT_XML_HELPER_HXX_
+#include <vector>
+
#ifndef _RTL_BYTESEQ_HXX_
#include <rtl/byteseq.hxx>
#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.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>
+#ifndef _COM_SUN_STAR_XML_SAX_XEXTENDEDDOCUMENTHANDLER_HDL_
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#endif
#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_
#include <com/sun/star/io/XInputStream.hpp>
@@ -82,6 +88,13 @@
namespace xmlscript
{
+/*##################################################################################################
+
+ IMPORTING
+
+##################################################################################################*/
+
+//==================================================================================================
struct NameSpaceUid
{
::rtl::OUString sURI;
@@ -102,11 +115,104 @@ SAL_CALL createDocumentHandler(
bool bSingleThreadedUse = true )
SAL_THROW( () );
+
+/*##################################################################################################
+
+ EXPORTING
+
+##################################################################################################*/
+
+//==================================================================================================
+class XMLElement
+ : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList >
+{
+public:
+ inline XMLElement( ::rtl::OUString const & name )
+ SAL_THROW( () )
+ : _name( name )
+ {}
+
+ /** Adds a sub element of element.
+
+ @param xElem
+ element reference
+ */
+ 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.
+
+ @param nIndex
+ index of sub element
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex )
+ SAL_THROW( () );
+
+ /** 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 )
+ SAL_THROW( () );
+
+ /** Gets the tag name (qname) of element
+
+ @return
+ qname of element
+ */
+ inline ::rtl::OUString SAL_CALL getName() SAL_THROW( () )
+ { return _name; }
+
+ /** Dumps out element (and all sub element).
+
+ @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 );
+
+ // XAttributeList
+ virtual sal_Int16 SAL_CALL getLength()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getNameByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTypeByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTypeByName( ::rtl::OUString const & rName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getValueByIndex( sal_Int16 nPos )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getValueByName( ::rtl::OUString const & rName )
+ throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ ::rtl::OUString _name;
+
+ ::std::vector< ::rtl::OUString > _attrNames;
+ ::std::vector< ::rtl::OUString > _attrValues;
+
+ ::std::vector< ::com::sun::star::uno::Reference<
+ ::com::sun::star::xml::sax::XAttributeList > > _subElems;
+};
+
+
+/*##################################################################################################
+
+ STREAMING
+
+##################################################################################################*/
+
//==================================================================================================
SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
SAL_CALL createInputStream(
::rtl::ByteSequence const & rInData )
SAL_THROW( () );
+
//==================================================================================================
SAL_DLLEXPORT ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
SAL_CALL createOutputStream(
diff --git a/xmlscript/source/xml_helper/makefile.mk b/xmlscript/source/xml_helper/makefile.mk
index b86b0aeae1..e036d996f6 100644
--- a/xmlscript/source/xml_helper/makefile.mk
+++ b/xmlscript/source/xml_helper/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:47 $
+# last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -76,6 +76,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/xml_impctx.obj \
+ $(SLO)$/xml_element.obj \
$(SLO)$/xml_byteseq.obj
# --- Targets ------------------------------------------------------
diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx
new file mode 100644
index 0000000000..5bffd3ce2b
--- /dev/null
+++ b/xmlscript/source/xml_helper/xml_element.cxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: xml_element.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
+ *
+ * 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 <xmlscript/xml_helper.hxx>
+
+
+using namespace rtl;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+
+namespace xmlscript
+{
+
+//__________________________________________________________________________________________________
+void XMLElement::addAttribute( OUString const & rAttrName, OUString const & rValue )
+ SAL_THROW( () )
+{
+ _attrNames.push_back( rAttrName );
+ _attrValues.push_back( rValue );
+}
+//__________________________________________________________________________________________________
+void XMLElement::addSubElement( Reference< xml::sax::XAttributeList > const & xElem )
+ SAL_THROW( () )
+{
+ _subElems.push_back( xElem );
+}
+//__________________________________________________________________________________________________
+Reference< xml::sax::XAttributeList > XMLElement::getSubElement( sal_Int32 nIndex )
+ SAL_THROW( () )
+{
+ return _subElems[ (size_t)nIndex ];
+}
+//__________________________________________________________________________________________________
+void XMLElement::dump( 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 );
+ }
+ //
+ xOut->ignorableWhitespace( OUString() );
+ xOut->endElement( _name );
+}
+
+// XAttributeList
+//__________________________________________________________________________________________________
+sal_Int16 XMLElement::getLength()
+ throw (RuntimeException)
+{
+ return _attrNames.size();
+}
+//__________________________________________________________________________________________________
+OUString XMLElement::getNameByIndex( sal_Int16 nPos )
+ throw (RuntimeException)
+{
+ OSL_ASSERT( (size_t)nPos < _attrNames.size() );
+ return _attrNames[ nPos ];
+}
+//__________________________________________________________________________________________________
+OUString XMLElement::getTypeByIndex( sal_Int16 nPos )
+ throw (RuntimeException)
+{
+ OSL_ASSERT( (size_t)nPos < _attrNames.size() );
+ // xxx todo
+ return OUString();
+}
+//__________________________________________________________________________________________________
+OUString XMLElement::getTypeByName( OUString const & rName )
+ throw (RuntimeException)
+{
+ // xxx todo
+ return OUString();
+}
+//__________________________________________________________________________________________________
+OUString XMLElement::getValueByIndex( sal_Int16 nPos )
+ throw (RuntimeException)
+{
+ OSL_ASSERT( (size_t)nPos < _attrNames.size() );
+ return _attrValues[ nPos ];
+}
+//__________________________________________________________________________________________________
+OUString XMLElement::getValueByName( OUString const & rName )
+ throw (RuntimeException)
+{
+ for ( size_t nPos = 0; nPos < _attrNames.size(); ++nPos )
+ {
+ if (_attrNames[ nPos ] == rName)
+ {
+ return _attrValues[ nPos ];
+ }
+ }
+ return OUString();
+}
+
+};
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index 5e1522ffbf..f4f78badd8 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.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,12 +59,11 @@
*
************************************************************************/
#include <hash_map>
-#include <vector>
#include <xmlscript/xmldlg_imexp.hxx>
+#include <xmlscript/xml_helper.hxx>
#include <osl/diagnose.h>
-#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -91,7 +90,7 @@ struct Style
OUString _id;
- Style( short all_ ) SAL_THROW( () )
+ inline Style( short all_ ) SAL_THROW( () )
: _all( all_ )
, _set( 0 )
{}
@@ -101,6 +100,7 @@ struct Style
class StyleBag
{
vector< Style * > _styles;
+
public:
~StyleBag() SAL_THROW( () );
@@ -110,40 +110,27 @@ public:
};
class ElementDescriptor
- : public ::cppu::WeakImplHelper1< xml::sax::XAttributeList >
+ : public ::xmlscript::XMLElement
{
Reference< beans::XPropertySet > _xProps;
Reference< beans::XPropertyState > _xPropState;
- OUString _name;
- vector< OUString > _attrNames;
- vector< OUString > _attrValues;
-
- vector< Reference< xml::sax::XAttributeList > > _subElems;
-
public:
inline ElementDescriptor(
Reference< beans::XPropertySet > const & xProps,
Reference< beans::XPropertyState > const & xPropState,
OUString const & name )
SAL_THROW( () )
- : _xProps( xProps )
+ : XMLElement( name )
+ , _xProps( xProps )
, _xPropState( xPropState )
- , _name( name )
{}
inline ElementDescriptor(
OUString const & name )
SAL_THROW( () )
- : _name( name )
+ : XMLElement( name )
{}
- //
- inline OUString getName() SAL_THROW( () )
- { return _name; }
- //
- void addSubElem( Reference< xml::sax::XAttributeList > const & xElem ) SAL_THROW( () );
- inline Reference< xml::sax::XAttributeList > getSubElemAt( sal_Int32 nIndex ) SAL_THROW( () )
- { return _subElems[ nIndex ]; }
- void dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut );
+
//
Any readProp( OUString const & rPropName );
//
@@ -159,9 +146,8 @@ public:
void readDateFormatAttr( OUString const & rPropName, OUString const & rAttrName );
void readTimeFormatAttr( OUString const & rPropName, OUString const & rAttrName );
//
- inline void addAttr( OUString const & rAttrName, OUString const & rValue ) SAL_THROW( () );
inline void addBoolAttr( OUString const & rAttrName, sal_Bool bValue ) SAL_THROW( () );
-
+
//
void readEvents() SAL_THROW( (Exception) );
//
@@ -180,36 +166,15 @@ public:
void readNumericFieldModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readPatternFieldModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readTimeFieldModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
-
- // XAttributeList
- virtual sal_Int16 SAL_CALL getLength()
- throw (RuntimeException);
- virtual OUString SAL_CALL getNameByIndex( sal_Int16 nPos )
- throw (RuntimeException);
- virtual OUString SAL_CALL getTypeByIndex( sal_Int16 nPos )
- throw (RuntimeException);
- virtual OUString SAL_CALL getTypeByName( OUString const & rName )
- throw (RuntimeException);
- virtual OUString SAL_CALL getValueByIndex( sal_Int16 nPos )
- throw (RuntimeException);
- virtual OUString SAL_CALL getValueByName( OUString const & rName )
- throw (RuntimeException);
};
//__________________________________________________________________________________________________
-inline void ElementDescriptor::addAttr( OUString const & rAttrName, OUString const & rValue )
- SAL_THROW( () )
-{
- _attrNames.push_back( rAttrName );
- _attrValues.push_back( rValue );
-}
-//__________________________________________________________________________________________________
inline void ElementDescriptor::addBoolAttr( OUString const & rAttrName, sal_Bool bValue )
SAL_THROW( () )
{
- addAttr( rAttrName,
- (bValue
- ? OUString( RTL_CONSTASCII_USTRINGPARAM("true") )
- : OUString( RTL_CONSTASCII_USTRINGPARAM("false") )) );
+ addAttribute( rAttrName,
+ (bValue
+ ? OUString( RTL_CONSTASCII_USTRINGPARAM("true") )
+ : OUString( RTL_CONSTASCII_USTRINGPARAM("false") )) );
}
//##################################################################################################
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index ea5391a801..3bf4a64fbd 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.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,8 +77,8 @@ void ElementDescriptor::readButtonModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -103,8 +103,8 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -117,8 +117,8 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
sal_Bool bTriState = sal_False;
if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TriState") ) ) >>= bTriState) && bTriState)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
}
sal_Int16 nState;
if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState)
@@ -126,12 +126,12 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
switch (nState)
{
case 0:
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
break;
case 1:
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
break;
case 2: // tristate=true exported, checked omitted => dont know!
OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" );
@@ -156,8 +156,8 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -192,12 +192,12 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
ElementDescriptor * item = new ElementDescriptor(
_xProps, _xPropState,
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) );
- item->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
- pItemValues[ nPos ] );
- popup->addSubElem( item );
+ item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
+ pItemValues[ nPos ] );
+ popup->addSubElement( item );
}
- addSubElem( popup );
+ addSubElement( popup );
}
readEvents();
}
@@ -217,8 +217,8 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -250,9 +250,9 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
ElementDescriptor * item = new ElementDescriptor(
_xProps, _xPropState,
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) );
- item->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
- pItemValues[ nPos ] );
- popup->addSubElem( item );
+ item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
+ pItemValues[ nPos ] );
+ popup->addSubElement( item );
}
Sequence< sal_Int16 > selected;
@@ -262,13 +262,13 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
for ( nPos = selected.getLength(); nPos--; )
{
ElementDescriptor * item = static_cast< ElementDescriptor * >(
- popup->getSubElemAt( pSelected[ nPos ] ).get() );
- item->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selected") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ popup->getSubElement( pSelected[ nPos ] ).get() );
+ item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selected") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
}
}
- addSubElem( popup );
+ addSubElement( popup );
}
readEvents();
}
@@ -284,8 +284,8 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -301,16 +301,16 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
switch (nState)
{
case 0:
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
break;
case 1:
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
break;
case 2: // tristate=true exported, checked omitted => dont know!
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
break;
}
}
@@ -328,8 +328,8 @@ void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -341,9 +341,9 @@ void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
ElementDescriptor * title = new ElementDescriptor(
_xProps, _xPropState,
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) );
- title->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
- aTitle );
- addSubElem( title );
+ title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
+ aTitle );
+ addSubElement( title );
}
}
//__________________________________________________________________________________________________
@@ -362,8 +362,8 @@ void ElementDescriptor::readFixedTextModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -391,8 +391,8 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -419,8 +419,8 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles )
if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EchoChar") ) ) >>= nEcho)
{
sal_Unicode cEcho = (sal_Unicode)nEcho;
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":echochar") ),
- OUString( &cEcho, 1 ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":echochar") ),
+ OUString( &cEcho, 1 ) );
}
readEvents();
}
@@ -436,8 +436,8 @@ void ElementDescriptor::readImageControlModel( StyleBag * all_styles )
aStyle._set |= 0x4;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -462,8 +462,8 @@ void ElementDescriptor::readFileControlModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -490,8 +490,8 @@ void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -536,8 +536,8 @@ void ElementDescriptor::readDateFieldModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -576,8 +576,8 @@ void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -620,8 +620,8 @@ void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
@@ -660,8 +660,8 @@ void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles )
aStyle._set |= 0x8;
if (aStyle._set)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
- all_styles->getStyleId( aStyle ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
+ all_styles->getStyleId( aStyle ) );
}
// collect elements
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 5a8a0017da..9822bf9e49 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.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,8 +77,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <xmlscript/xml_helper.hxx>
-
namespace xmlscript
{
@@ -90,7 +88,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style") ) );
// style-id
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), _id );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), _id );
// background-color
if (_set & 0x1)
@@ -99,8 +97,8 @@ Reference< xml::sax::XAttributeList > Style::createElement()
buf.append( (sal_Unicode)'0' );
buf.append( (sal_Unicode)'x' );
buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_backgroundColor, 16 ) );
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":background-color") ),
- buf.makeStringAndClear() );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":background-color") ),
+ buf.makeStringAndClear() );
}
// text-color
@@ -110,8 +108,8 @@ Reference< xml::sax::XAttributeList > Style::createElement()
buf.append( (sal_Unicode)'0' );
buf.append( (sal_Unicode)'x' );
buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_textColor, 16 ) );
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text-color") ),
- buf.makeStringAndClear() );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text-color") ),
+ buf.makeStringAndClear() );
}
// border
@@ -120,16 +118,16 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_border)
{
case 0:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("none") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("none") ) );
break;
case 1:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("3d") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("3d") ) );
break;
case 2:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("simple") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":border") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("simple") ) );
break;
default:
OSL_ENSURE( 0, "### unexpected border value!" );
@@ -144,26 +142,26 @@ Reference< xml::sax::XAttributeList > Style::createElement()
// dialog:font-name CDATA #IMPLIED
if (def_descr.Name != _descr.Name)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-name") ),
- _descr.Name );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-name") ),
+ _descr.Name );
}
// dialog:font-height %numeric; #IMPLIED
if (def_descr.Height != _descr.Height)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-height") ),
- OUString::valueOf( (sal_Int32)_descr.Height ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-height") ),
+ OUString::valueOf( (sal_Int32)_descr.Height ) );
}
// dialog:font-width %numeric; #IMPLIED
if (def_descr.Width != _descr.Width)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-width") ),
- OUString::valueOf( (sal_Int32)_descr.Width ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-width") ),
+ OUString::valueOf( (sal_Int32)_descr.Width ) );
}
// dialog:font-stylename CDATA #IMPLIED
if (def_descr.StyleName != _descr.StyleName)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-stylename") ),
- _descr.StyleName );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-stylename") ),
+ _descr.StyleName );
}
// dialog:font-family "(decorative|modern|roman|script|swiss|system)" #IMPLIED
if (def_descr.Family != _descr.Family)
@@ -171,28 +169,28 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Family)
{
case awt::FontFamily::DECORATIVE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("decorative") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("decorative") ) );
break;
case awt::FontFamily::MODERN:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("modern") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("modern") ) );
break;
case awt::FontFamily::ROMAN:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("roman") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("roman") ) );
break;
case awt::FontFamily::SCRIPT:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("script") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("script") ) );
break;
case awt::FontFamily::SWISS:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("swiss") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("swiss") ) );
break;
case awt::FontFamily::SYSTEM:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("system") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-family") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("system") ) );
break;
}
}
@@ -202,44 +200,44 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.CharSet)
{
case awt::CharSet::ANSI:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ansi") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ansi") ) );
break;
case awt::CharSet::MAC:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("mac") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("mac") ) );
break;
case awt::CharSet::IBMPC_437:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_437") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_437") ) );
break;
case awt::CharSet::IBMPC_850:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_850") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_850") ) );
break;
case awt::CharSet::IBMPC_860:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_860") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_860") ) );
break;
case awt::CharSet::IBMPC_861:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_861") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_861") ) );
break;
case awt::CharSet::IBMPC_863:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_863") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_863") ) );
break;
case awt::CharSet::IBMPC_865:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_865") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("ibmpc_865") ) );
break;
case awt::CharSet::SYSTEM:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("system") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("system") ) );
break;
case awt::CharSet::SYMBOL:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("symbol") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charset") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("symbol") ) );
break;
}
}
@@ -249,26 +247,26 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Pitch)
{
case awt::FontPitch::FIXED:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-pitch") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("fixed") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-pitch") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("fixed") ) );
break;
case awt::FontPitch::VARIABLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-pitch") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("variable") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-pitch") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("variable") ) );
break;
}
}
// dialog:font-charwidth CDATA #IMPLIED
if (def_descr.CharacterWidth != _descr.CharacterWidth)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charwidth") ),
- OUString::valueOf( (float)_descr.CharacterWidth ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-charwidth") ),
+ OUString::valueOf( (float)_descr.CharacterWidth ) );
}
// dialog:font-weight CDATA #IMPLIED
if (def_descr.Weight != _descr.Weight)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-weight") ),
- OUString::valueOf( (float)_descr.Weight ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-weight") ),
+ OUString::valueOf( (float)_descr.Weight ) );
}
// dialog:font-slant "(oblique|italic|reverse_oblique|reverse_italic)" #IMPLIED
if (def_descr.Slant != _descr.Slant)
@@ -276,20 +274,20 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Slant)
{
case awt::FontSlant_OBLIQUE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("oblique") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("oblique") ) );
break;
case awt::FontSlant_ITALIC:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("italic") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("italic") ) );
break;
case awt::FontSlant_REVERSE_OBLIQUE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("reverse_oblique") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("reverse_oblique") ) );
break;
case awt::FontSlant_REVERSE_ITALIC:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("reverse_italic") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-slant") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("reverse_italic") ) );
break;
}
}
@@ -299,72 +297,72 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Underline)
{
case awt::FontUnderline::SINGLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("single") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("single") ) );
break;
case awt::FontUnderline::DOUBLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("double") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("double") ) );
break;
case awt::FontUnderline::DOTTED:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("dotted") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("dotted") ) );
break;
case awt::FontUnderline::DASH:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("dash") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("dash") ) );
break;
case awt::FontUnderline::LONGDASH:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("longdash") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("longdash") ) );
break;
case awt::FontUnderline::DASHDOT:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("dashdot") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("dashdot") ) );
break;
case awt::FontUnderline::DASHDOTDOT:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("dashdotdot") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("dashdotdot") ) );
break;
case awt::FontUnderline::SMALLWAVE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("smallwave") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("smallwave") ) );
break;
case awt::FontUnderline::WAVE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("wave") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("wave") ) );
break;
case awt::FontUnderline::DOUBLEWAVE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("doublewave") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("doublewave") ) );
break;
case awt::FontUnderline::BOLD:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bold") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bold") ) );
break;
case awt::FontUnderline::BOLDDOTTED:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bolddotted") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bolddotted") ) );
break;
case awt::FontUnderline::BOLDDASH:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bolddash") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bolddash") ) );
break;
case awt::FontUnderline::BOLDLONGDASH:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("boldlongdash") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("boldlongdash") ) );
break;
case awt::FontUnderline::BOLDDASHDOT:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bolddashdot") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bolddashdot") ) );
break;
case awt::FontUnderline::BOLDDASHDOTDOT:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bolddashdotdot") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bolddashdotdot") ) );
break;
case awt::FontUnderline::BOLDWAVE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("boldwave") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-underline") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("boldwave") ) );
break;
}
}
@@ -374,32 +372,32 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Strikeout)
{
case awt::FontStrikeout::SINGLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("single") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("single") ) );
break;
case awt::FontStrikeout::DOUBLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("double") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("double") ) );
break;
case awt::FontStrikeout::BOLD:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("bold") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bold") ) );
break;
case awt::FontStrikeout::SLASH:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("slash") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("slash") ) );
break;
case awt::FontStrikeout::X:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("x") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-strikeout") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("x") ) );
break;
}
}
// dialog:font-orientation CDATA #IMPLIED
if (def_descr.Orientation != _descr.Orientation)
{
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-orientation") ),
- OUString::valueOf( (float)_descr.Orientation ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-orientation") ),
+ OUString::valueOf( (float)_descr.Orientation ) );
}
// dialog:font-kerning %boolean; #IMPLIED
if ((def_descr.Kerning != sal_False) != (_descr.Kerning != sal_False))
@@ -419,16 +417,16 @@ Reference< xml::sax::XAttributeList > Style::createElement()
switch (_descr.Type)
{
case awt::FontType::RASTER:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("raster") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("raster") ) );
break;
case awt::FontType::DEVICE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("device") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("device") ) );
break;
case awt::FontType::SCALABLE:
- pStyle->addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("scalable") ) );
+ pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":font-type") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("scalable") ) );
break;
}
}
@@ -439,57 +437,6 @@ Reference< xml::sax::XAttributeList > Style::createElement()
//##################################################################################################
-// XAttributeList
-//__________________________________________________________________________________________________
-sal_Int16 ElementDescriptor::getLength()
- throw (RuntimeException)
-{
- return _attrNames.size();
-}
-//__________________________________________________________________________________________________
-OUString ElementDescriptor::getNameByIndex( sal_Int16 nPos )
- throw (RuntimeException)
-{
- OSL_ASSERT( (size_t)nPos < _attrNames.size() );
- return _attrNames[ nPos ];
-}
-//__________________________________________________________________________________________________
-OUString ElementDescriptor::getTypeByIndex( sal_Int16 nPos )
- throw (RuntimeException)
-{
- OSL_ASSERT( (size_t)nPos < _attrNames.size() );
- // xxx todo
- return OUString();
-}
-//__________________________________________________________________________________________________
-OUString ElementDescriptor::getTypeByName( OUString const & rName )
- throw (RuntimeException)
-{
- // xxx todo
- return OUString();
-}
-//__________________________________________________________________________________________________
-OUString ElementDescriptor::getValueByIndex( sal_Int16 nPos )
- throw (RuntimeException)
-{
- OSL_ASSERT( (size_t)nPos < _attrNames.size() );
- return _attrValues[ nPos ];
-}
-//__________________________________________________________________________________________________
-OUString ElementDescriptor::getValueByName( OUString const & rName )
- throw (RuntimeException)
-{
- for ( size_t nPos = 0; nPos < _attrNames.size(); ++nPos )
- {
- if (_attrNames[ nPos ] == rName)
- {
- return _attrValues[ nPos ];
- }
- }
- return OUString();
-}
-
-//
//__________________________________________________________________________________________________
Any ElementDescriptor::readProp( OUString const & rPropName )
{
@@ -507,7 +454,7 @@ void ElementDescriptor::readStringAttr( OUString const & rPropName, OUString con
Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_STRING)
{
- addAttr( rAttrName, * reinterpret_cast< const OUString * >( a.getValue() ) );
+ addAttribute( rAttrName, * reinterpret_cast< const OUString * >( a.getValue() ) );
}
}
}
@@ -519,7 +466,7 @@ void ElementDescriptor::readDoubleAttr( OUString const & rPropName, OUString con
Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_DOUBLE)
{
- addAttr( rAttrName, OUString::valueOf( *(double const *)a.getValue() ) );
+ addAttribute( rAttrName, OUString::valueOf( *(double const *)a.getValue() ) );
}
}
}
@@ -531,7 +478,7 @@ void ElementDescriptor::readLongAttr( OUString const & rPropName, OUString const
Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_LONG)
{
- addAttr( rAttrName, OUString::valueOf( (sal_Int64)(sal_uInt64)*(sal_uInt32 *)a.getValue() ) );
+ addAttribute( rAttrName, OUString::valueOf( (sal_Int64)(sal_uInt64)*(sal_uInt32 *)a.getValue() ) );
}
}
}
@@ -547,7 +494,7 @@ void ElementDescriptor::readHexLongAttr( OUString const & rPropName, OUString co
buf.append( (sal_Unicode)'0' );
buf.append( (sal_Unicode)'x' );
buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)*(sal_uInt32 *)a.getValue(), 16 ) );
- addAttr( rAttrName, buf.makeStringAndClear() );
+ addAttribute( rAttrName, buf.makeStringAndClear() );
}
}
}
@@ -559,7 +506,7 @@ void ElementDescriptor::readShortAttr( OUString const & rPropName, OUString cons
Any a( _xProps->getPropertyValue( rPropName ) );
if (a.getValueTypeClass() == TypeClass_SHORT)
{
- addAttr( rAttrName, OUString::valueOf( (sal_Int32)*(sal_Int16 *)a.getValue() ) );
+ addAttribute( rAttrName, OUString::valueOf( (sal_Int32)*(sal_Int16 *)a.getValue() ) );
}
}
}
@@ -586,40 +533,40 @@ void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, OUString
switch (*(sal_Int16 const *)a.getValue())
{
case 0:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short") ) );
break;
case 1:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short_YY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short_YY") ) );
break;
case 2:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short_YYYY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_short_YYYY") ) );
break;
case 3:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_long") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("system_long") ) );
break;
case 4:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_DDMMYY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_DDMMYY") ) );
break;
case 5:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_MMDDYY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_MMDDYY") ) );
break;
case 6:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYMMDD") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYMMDD") ) );
break;
case 7:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_DDMMYYYY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_DDMMYYYY") ) );
break;
case 8:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_MMDDYYYY") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_MMDDYYYY") ) );
break;
case 9:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYYYMMDD") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYYYMMDD") ) );
break;
case 10:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYMMDD_DIN5008") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYMMDD_DIN5008") ) );
break;
case 11:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYYYMMDD_DIN5008") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYYYMMDD_DIN5008") ) );
break;
}
}
@@ -636,22 +583,22 @@ void ElementDescriptor::readTimeFormatAttr( OUString const & rPropName, OUString
switch (*(sal_Int16 const *)a.getValue())
{
case 0:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("24h_short") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("24h_short") ) );
break;
case 1:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("24h_long") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("24h_long") ) );
break;
case 2:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("12h_short") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("12h_short") ) );
break;
case 3:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("12h_long") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("12h_long") ) );
break;
case 4:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("Duration_short") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("Duration_short") ) );
break;
case 5:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("Duration_long") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("Duration_long") ) );
break;
}
}
@@ -668,13 +615,13 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons
switch (*(sal_Int16 const *)a.getValue())
{
case 0:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("left") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("left") ) );
break;
case 1:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("center") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("center") ) );
break;
case 2:
- addAttr( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("right") ) );
+ addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("right") ) );
break;
default:
OSL_ENSURE( 0, "### illegal alignment value!" );
@@ -686,7 +633,7 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons
void ElementDescriptor::readDefaults()
{
Any a( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) );
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ),
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ),
* reinterpret_cast< const OUString * >( a.getValue() ) );
readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TabIndex") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tab-index") ) );
@@ -696,8 +643,8 @@ void ElementDescriptor::readDefaults()
{
if (! bEnabled)
{
- addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":disabled") ),
- OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
+ addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":disabled") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
}
}
else
@@ -744,32 +691,32 @@ void ElementDescriptor::readEvents()
OSL_ENSURE( descr.ListenerType.getLength() > 0 &&
descr.EventMethod.getLength() > 0,
"### invalid listener/ event method descr!" );
- pElem->addAttr(
+ pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":listener-type") ),
descr.ListenerType );
- pElem->addAttr(
+ pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":event-method") ),
descr.EventMethod );
if (descr.ScriptType.getLength())
{
- pElem->addAttr(
+ pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":script-type") ),
descr.ScriptType );
}
if (descr.ScriptCode.getLength())
{
- pElem->addAttr(
+ pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":script-code") ),
descr.ScriptCode );
}
if (descr.AddListenerParam.getLength())
{
- pElem->addAttr(
+ pElem->addAttribute(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":param") ),
descr.AddListenerParam );
}
- addSubElem( xElem );
+ addSubElement( xElem );
}
else
{
@@ -901,28 +848,6 @@ void StyleBag::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOu
//##################################################################################################
-//__________________________________________________________________________________________________
-void ElementDescriptor::addSubElem( Reference< xml::sax::XAttributeList > const & xElem )
- SAL_THROW( () )
-{
- _subElems.push_back( xElem );
-}
-//__________________________________________________________________________________________________
-void ElementDescriptor::dump( 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 )
- {
- ElementDescriptor * pElem = static_cast< ElementDescriptor * >( _subElems[ nPos ].get() );
- pElem->dump( xOut );
- }
- //
- xOut->ignorableWhitespace( OUString() );
- xOut->endElement( _name );
-}
-
//==================================================================================================
SAL_DLLEXPORT void SAL_CALL exportDialogModel(
Reference< xml::sax::XExtendedDocumentHandler > const & xOut,
@@ -980,7 +905,7 @@ SAL_DLLEXPORT void SAL_CALL exportDialogModel(
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radio") ) );
xElem = static_cast< xml::sax::XAttributeList * >( pElem );
pElem->readRadioButtonModel( &all_styles );
- pRadioGroup->addSubElem( xElem );
+ pRadioGroup->addSubElement( xElem );
}
else // no radio
{
@@ -1127,8 +1052,8 @@ 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->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) );
pWindow->readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ) );
pWindow->readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 2d6edbea40..516553c2d6 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.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
+ * last change: $Author: dbo $ $Date: 2001-03-15 14:44:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -873,7 +873,7 @@ Reference< xml::XImportContext > RadioGroupElement::createChildContext(
else
{
throw xml::sax::SAXException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ),
+ OUString( RTL_CONSTASCII_USTRINGPARAM("expected radio element!") ),
Reference< XInterface >(), Any() );
}
}