Kaydet (Commit) 2cbacc4c authored tarafından Daniel Boelzle's avatar Daniel Boelzle

modified im/exports

üst cbfee4be
......@@ -2,9 +2,9 @@
*
* $RCSfile: xml_byteseq.cxx,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-14 16:39:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -82,7 +82,7 @@ class BSeqInputStream
public:
inline BSeqInputStream( ByteSequence const & rSeq )
throw ()
SAL_THROW( () )
: _seq( rSeq )
, _nPos( 0 )
{}
......@@ -151,7 +151,7 @@ class BSeqOutputStream
public:
inline BSeqOutputStream( ByteSequence * seq )
throw ()
SAL_THROW( () )
: _seq( seq )
{}
......@@ -189,14 +189,14 @@ void BSeqOutputStream::closeOutput()
//==================================================================================================
Reference< io::XInputStream > SAL_CALL createInputStream( ByteSequence const & rInData )
throw ()
SAL_THROW( () )
{
return new BSeqInputStream( rInData );
}
//==================================================================================================
Reference< io::XOutputStream > SAL_CALL createOutputStream( ByteSequence * pOutData )
throw ()
SAL_THROW( () )
{
return new BSeqOutputStream( pOutData );
}
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xml_impctx.cxx,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-14 16:39:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -88,7 +88,7 @@ struct PrefixEntry
{
::std::vector< sal_Int32 > _Uids;
inline PrefixEntry() throw ()
inline PrefixEntry() SAL_THROW( () )
{ _Uids.reserve( 4 ); }
};
......@@ -147,32 +147,32 @@ class DocumentHandlerImpl
inline sal_Int32 getUidByURI(
OUString const & rURI )
throw ();
SAL_THROW( () );
inline OUString getURIByUid(
sal_Int32 nUid )
throw ();
SAL_THROW( () );
inline sal_Int32 getUidByPrefix(
OUString const & rPrefix )
throw ();
SAL_THROW( () );
inline void pushPrefix(
OUString const & rPrefix, OUString const & rURI )
throw ();
SAL_THROW( () );
inline void popPrefix(
OUString const & rPrefix )
throw ();
SAL_THROW( () );
inline void getElementName(
OUString const & rQName, sal_Int32 * pUid, OUString * pLocalName )
throw ();
SAL_THROW( () );
public:
DocumentHandlerImpl(
const NameSpaceUid * pNamespaceUids, sal_Int32 nNameSpaceUids,
sal_Int32 nUnknownNamespaceUid,
Reference< xml::XImporter > const & xImporter,
bool bSingleThreadedUse )
throw ();
SAL_THROW( () );
virtual ~DocumentHandlerImpl()
throw ();
SAL_THROW( () );
// XDocumentHandler
virtual void SAL_CALL startDocument()
......@@ -205,7 +205,7 @@ DocumentHandlerImpl::DocumentHandlerImpl(
sal_Int32 nUnknownNamespaceUid,
Reference< xml::XImporter > const & xImporter,
bool bSingleThreadedUse )
throw ()
SAL_THROW( () )
: _xImporter( xImporter )
, _nUnknownNamespaceUid( nUnknownNamespaceUid )
, _sXMLNS_URI_UNKNOWN( RTL_CONSTASCII_USTRINGPARAM("<<< unknown URI >>>") )
......@@ -235,7 +235,7 @@ DocumentHandlerImpl::DocumentHandlerImpl(
}
//__________________________________________________________________________________________________
DocumentHandlerImpl::~DocumentHandlerImpl()
throw ()
SAL_THROW( () )
{
if (_pMutex)
{
......@@ -248,7 +248,7 @@ DocumentHandlerImpl::~DocumentHandlerImpl()
//__________________________________________________________________________________________________
inline sal_Int32 DocumentHandlerImpl::getUidByURI(
OUString const & rURI )
throw ()
SAL_THROW( () )
{
if (_nLastURI_lookup == _nUnknownNamespaceUid || _aLastURI_lookup != rURI)
{
......@@ -268,7 +268,7 @@ inline sal_Int32 DocumentHandlerImpl::getUidByURI(
}
//__________________________________________________________________________________________________
inline OUString DocumentHandlerImpl::getURIByUid( sal_Int32 nUid )
throw ()
SAL_THROW( () )
{
if (nUid != _nLastURI_lookup)
{
......@@ -289,7 +289,7 @@ inline OUString DocumentHandlerImpl::getURIByUid( sal_Int32 nUid )
//__________________________________________________________________________________________________
inline sal_Int32 DocumentHandlerImpl::getUidByPrefix(
OUString const & rPrefix )
throw ()
SAL_THROW( () )
{
// commonly the last added prefix is used often for several tags... good guess
if (_nLastPrefix_lookup == _nUnknownNamespaceUid || _aLastPrefix_lookup != rPrefix)
......@@ -313,7 +313,7 @@ inline sal_Int32 DocumentHandlerImpl::getUidByPrefix(
//__________________________________________________________________________________________________
inline void DocumentHandlerImpl::pushPrefix(
OUString const & rPrefix, OUString const & rURI )
throw ()
SAL_THROW( () )
{
// lookup id for URI
sal_Int32 nUid = getUidByURI( rURI );
......@@ -339,7 +339,7 @@ inline void DocumentHandlerImpl::pushPrefix(
//__________________________________________________________________________________________________
inline void DocumentHandlerImpl::popPrefix(
OUString const & rPrefix )
throw ()
SAL_THROW( () )
{
t_OUString2PrefixMap::iterator iFind( _prefixes.find( rPrefix ) );
if (iFind != _prefixes.end()) // unused prefix
......@@ -359,7 +359,7 @@ inline void DocumentHandlerImpl::popPrefix(
//__________________________________________________________________________________________________
inline void DocumentHandlerImpl::getElementName(
OUString const & rQName, sal_Int32 * pUid, OUString * pLocalName )
throw ()
SAL_THROW( () )
{
sal_Int32 nColonPos = rQName.indexOf( (sal_Unicode)':' );
*pLocalName = (nColonPos >= 0 ? rQName.copy( nColonPos +1 ) : rQName);
......@@ -385,9 +385,9 @@ public:
sal_Int32 * pUids, OUString * pPrefixes, OUString * pLocalNames, OUString * pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList,
DocumentHandlerImpl * pHandler )
throw ();
SAL_THROW( () );
virtual ~ExtendedAttributes()
throw ();
SAL_THROW( () );
// XAttributes
virtual sal_Int32 SAL_CALL getIndexByQName(
......@@ -443,7 +443,7 @@ inline ExtendedAttributes::ExtendedAttributes(
sal_Int32 * pUids, OUString * pPrefixes, OUString * pLocalNames, OUString * pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList,
DocumentHandlerImpl * pHandler )
throw ()
SAL_THROW( () )
: _nAttributes( nAttributes )
, _pUids( pUids )
, _pPrefixes( pPrefixes )
......@@ -461,7 +461,7 @@ inline ExtendedAttributes::ExtendedAttributes(
}
//__________________________________________________________________________________________________
ExtendedAttributes::~ExtendedAttributes()
throw ()
SAL_THROW( () )
{
_pHandler->release();
......@@ -897,7 +897,7 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL createDocumentHandler(
sal_Int32 nUnknownNamespaceUid,
Reference< xml::XImporter > const & xImporter,
bool bSingleThreadedUse )
throw ()
SAL_THROW( () )
{
Reference< xml::sax::XDocumentHandler > xRet;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: exp_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-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -91,7 +91,7 @@ struct Style
OUString _id;
Style( short all_ )
Style( short all_ ) SAL_THROW( () )
: _all( all_ )
, _set( 0 )
{}
......@@ -102,10 +102,9 @@ class StyleBag
{
vector< Style * > _styles;
public:
~StyleBag();
~StyleBag() SAL_THROW( () );
OUString getStyleId( Style const & rStyle )
throw ();
OUString getStyleId( Style const & rStyle ) SAL_THROW( () );
void dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOut );
};
......@@ -127,22 +126,22 @@ public:
Reference< beans::XPropertySet > const & xProps,
Reference< beans::XPropertyState > const & xPropState,
OUString const & name )
throw ()
SAL_THROW( () )
: _xProps( xProps )
, _xPropState( xPropState )
, _name( name )
{}
inline ElementDescriptor(
OUString const & name )
throw ()
SAL_THROW( () )
: _name( name )
{}
//
inline OUString getName()
inline OUString getName() SAL_THROW( () )
{ return _name; }
//
void addSubElem( Reference< xml::sax::XAttributeList > const & xElem );
inline Reference< xml::sax::XAttributeList > getSubElemAt( sal_Int32 nIndex )
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 );
//
......@@ -160,43 +159,27 @@ 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 );
inline void addBoolAttr( OUString const & rAttrName, sal_Bool bValue );
inline void addAttr( OUString const & rAttrName, OUString const & rValue ) SAL_THROW( () );
inline void addBoolAttr( OUString const & rAttrName, sal_Bool bValue ) SAL_THROW( () );
//
void readEvents()
throw (Exception);
void readEvents() SAL_THROW( (Exception) );
//
void readButtonModel( StyleBag * all_styles )
throw (Exception);
void readEditModel( StyleBag * all_styles )
throw (Exception);
void readCheckBoxModel( StyleBag * all_styles )
throw (Exception);
void readRadioButtonModel( StyleBag * all_styles )
throw (Exception);
void readComboBoxModel( StyleBag * all_styles )
throw (Exception);
void readCurrencyFieldModel( StyleBag * all_styles )
throw (Exception);
void readDateFieldModel( StyleBag * all_styles )
throw (Exception);
void readFileControlModel( StyleBag * all_styles )
throw (Exception);
void readFixedTextModel( StyleBag * all_styles )
throw (Exception);
void readGroupBoxModel( StyleBag * all_styles )
throw (Exception);
void readImageControlModel( StyleBag * all_styles )
throw (Exception);
void readListBoxModel( StyleBag * all_styles )
throw (Exception);
void readNumericFieldModel( StyleBag * all_styles )
throw (Exception);
void readPatternFieldModel( StyleBag * all_styles )
throw (Exception);
void readTimeFieldModel( StyleBag * all_styles )
throw (Exception);
void readButtonModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readEditModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readCheckBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readRadioButtonModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readComboBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readCurrencyFieldModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readDateFieldModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readFileControlModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readFixedTextModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readGroupBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readImageControlModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
void readListBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) );
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()
......@@ -214,12 +197,14 @@ public:
};
//__________________________________________________________________________________________________
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
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: imp_share.hxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -84,7 +84,7 @@ using namespace ::com::sun::star::uno;
namespace xmlscript
{
//
inline sal_Int32 toInt32( OUString const & rStr )
inline sal_Int32 toInt32( OUString const & rStr ) SAL_THROW( () )
{
sal_Int32 nVal;
if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x')
......@@ -142,38 +142,37 @@ inline bool getLongAttr(
}
return false;
}
//
class ControlImportContext;
//==================================================================================================
struct DialogImport
: public ::cppu::WeakImplHelper1< xml::XImporter >
{
friend class ControlImportContext;
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;
public:
void addStyle(
OUString const & rStyleId,
Reference< xml::XImportContext > const & xStyle )
throw ();
SAL_THROW( () );
Reference< xml::XImportContext > getStyle(
OUString const & rStyleId ) const
throw ();
inline DialogImport(
Reference< lang::XMultiServiceFactory > const & xMgr,
Sequence< Reference< container::XNameContainer > > * pOutModels )
throw ()
: _xMgr( xMgr )
, _pOutModels( pOutModels )
{ *_pOutModels = Sequence< Reference< container::XNameContainer > >(); }
SAL_THROW( () );
inline DialogImport( Reference< container::XNameContainer > const & xDialogModel )
SAL_THROW( () )
: _xDialogModel( xDialogModel )
, _xDialogModelFactory( xDialogModel, UNO_QUERY )
{ OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() ); }
virtual ~DialogImport()
throw ();
SAL_THROW( () );
// XImporter
virtual void SAL_CALL startDocument()
......@@ -196,20 +195,21 @@ public:
class ElementBase
: public ::cppu::WeakImplHelper1< xml::XImportContext >
{
public:
protected:
DialogImport * _pImport;
ElementBase * _pParent;
OUString _aLocalName;
Reference< xml::sax2::XExtendedAttributes > _xAttributes;
ElementBase * _pParent;
DialogImport * _pImport;
public:
ElementBase(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ();
SAL_THROW( () );
virtual ~ElementBase()
throw ();
SAL_THROW( () );
// XImportContext
virtual Reference< xml::XImportContext > SAL_CALL getParent()
......@@ -247,7 +247,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -283,7 +283,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
, _inited( 0 )
, _hasValue( 0 )
......@@ -308,7 +308,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -329,14 +329,14 @@ protected:
Reference< xml::XImportContext > getStyle(
Reference< xml::sax2::XExtendedAttributes > const & xAttributes );
public:
vector< Reference< xml::sax2::XExtendedAttributes > > const * getEvents() throw ()
vector< Reference< xml::sax2::XExtendedAttributes > > const * getEvents() SAL_THROW( () )
{ return &_events; }
ControlElement(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ();
SAL_THROW( () );
};
//==================================================================================================
class ControlImportContext
......@@ -396,24 +396,6 @@ 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
{
......@@ -429,7 +411,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -445,7 +427,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -463,7 +445,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ();
SAL_THROW( () );
};
//==================================================================================================
class ButtonElement
......@@ -481,7 +463,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -501,7 +483,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -522,7 +504,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -543,7 +525,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -561,7 +543,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -582,7 +564,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -604,7 +586,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: BulletinBoardElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -624,7 +606,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -644,7 +626,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -664,7 +646,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -684,7 +666,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -704,7 +686,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -724,7 +706,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -744,7 +726,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -764,7 +746,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......@@ -784,7 +766,7 @@ public:
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{}
};
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_addfunc.cxx,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -64,6 +64,7 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
#include <xmlscript/xml_helper.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
......@@ -76,10 +77,31 @@ namespace xmlscript
{
//==================================================================================================
SAL_DLLEXPORT void SAL_CALL exportDialogModelsToByteSequence(
Sequence< sal_Int8 > * pOutBytes,
Sequence< Reference< container::XNameContainer > > const & rInModels )
throw (Exception)
class InputStreamProvider
: public ::cppu::WeakImplHelper1< io::XInputStreamProvider >
{
ByteSequence _bytes;
public:
inline InputStreamProvider( ByteSequence const & rBytes )
: _bytes( rBytes )
{}
// XInputStreamProvider
virtual Reference< io::XInputStream > SAL_CALL createInputStream()
throw (RuntimeException);
};
//__________________________________________________________________________________________________
Reference< io::XInputStream > InputStreamProvider::createInputStream()
throw (RuntimeException)
{
return ::xmlscript::createInputStream( _bytes );
}
//==================================================================================================
SAL_DLLEXPORT Reference< io::XInputStreamProvider > SAL_CALL exportDialogModel(
Reference< container::XNameContainer > const & xDialogModel )
SAL_THROW( (Exception) )
{
Reference< lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() );
if (! xSMgr.is())
......@@ -99,19 +121,20 @@ SAL_DLLEXPORT void SAL_CALL exportDialogModelsToByteSequence(
Reference< XInterface >() );
}
ByteSequence aBytes;
Reference< io::XActiveDataSource > xSource( xHandler, UNO_QUERY );
xSource->setOutputStream( createOutputStream( reinterpret_cast< ByteSequence * >( pOutBytes ) ) );
xSource->setOutputStream( createOutputStream( &aBytes ) );
exportDialogModel( xHandler, xDialogModel );
xHandler->startDocument();
exportDialogModels( xHandler, rInModels );
xHandler->endDocument();
return new InputStreamProvider( aBytes );
}
//==================================================================================================
SAL_DLLEXPORT void SAL_CALL importDialogModelsFromByteSequence(
Sequence< Reference< container::XNameContainer > > * pOutModels,
Sequence< sal_Int8 > const & rInBytes )
throw (Exception)
SAL_DLLEXPORT void SAL_CALL importDialogModel(
Reference< io::XInputStream > xInput,
Reference< container::XNameContainer > const & xDialogModel )
SAL_THROW( (Exception) )
{
Reference< lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() );
if (! xSMgr.is())
......@@ -132,10 +155,10 @@ SAL_DLLEXPORT void SAL_CALL importDialogModelsFromByteSequence(
}
// error handler, entity resolver omitted for this helper function
xParser->setDocumentHandler( importDialogModels( pOutModels ) );
xParser->setDocumentHandler( importDialogModel( xDialogModel ) );
xml::sax::InputSource source;
source.aInputStream = createInputStream( * reinterpret_cast< ByteSequence const * >( &rInBytes ) );
source.aInputStream = xInput;
source.sSystemId = OUString( RTL_CONSTASCII_USTRINGPARAM("virtual file") );
xParser->parseStream( source );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_expmodels.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -65,7 +65,7 @@ namespace xmlscript
//__________________________________________________________________________________________________
void ElementDescriptor::readButtonModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x8 );
......@@ -93,7 +93,7 @@ void ElementDescriptor::readButtonModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x2 | 0x8 );
......@@ -142,7 +142,7 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -203,7 +203,7 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -274,7 +274,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x2 | 0x8 );
......@@ -318,7 +318,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x2 | 0x8 );
......@@ -348,7 +348,7 @@ void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readFixedTextModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -377,7 +377,7 @@ void ElementDescriptor::readFixedTextModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readEditModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -426,7 +426,7 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readImageControlModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x4 );
......@@ -448,7 +448,7 @@ void ElementDescriptor::readImageControlModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readFileControlModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -476,7 +476,7 @@ void ElementDescriptor::readFileControlModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -522,7 +522,7 @@ void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readDateFieldModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -562,7 +562,7 @@ void ElementDescriptor::readDateFieldModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -606,7 +606,7 @@ void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......@@ -646,7 +646,7 @@ void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles )
}
//__________________________________________________________________________________________________
void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles )
throw (Exception)
SAL_THROW( (Exception) )
{
// collect styles
Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_export.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: dbo $ $Date: 2001-03-07 14:57:38 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -722,7 +722,7 @@ void ElementDescriptor::readDefaults()
}
//__________________________________________________________________________________________________
void ElementDescriptor::readEvents()
throw (Exception)
SAL_THROW( (Exception) )
{
Reference< script::XScriptEventsSupplier > xSupplier( _xProps, UNO_QUERY );
if (xSupplier.is())
......@@ -803,7 +803,7 @@ inline bool equals( awt::FontDescriptor const & f1, awt::FontDescriptor const &
}
//__________________________________________________________________________________________________
OUString StyleBag::getStyleId( Style const & rStyle )
throw ()
SAL_THROW( () )
{
if (! rStyle._set) // nothin set
{
......@@ -873,7 +873,7 @@ OUString StyleBag::getStyleId( Style const & rStyle )
return pStyle->_id;
}
//__________________________________________________________________________________________________
StyleBag::~StyleBag()
StyleBag::~StyleBag() SAL_THROW( () )
{
for ( size_t nPos = 0; nPos < _styles.size(); ++nPos )
{
......@@ -903,6 +903,7 @@ void StyleBag::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOu
//__________________________________________________________________________________________________
void ElementDescriptor::addSubElem( Reference< xml::sax::XAttributeList > const & xElem )
SAL_THROW( () )
{
_subElems.push_back( xElem );
}
......@@ -923,10 +924,10 @@ void ElementDescriptor::dump( Reference< xml::sax::XExtendedDocumentHandler > co
}
//==================================================================================================
static void exportDialogModel(
SAL_DLLEXPORT void SAL_CALL exportDialogModel(
Reference< xml::sax::XExtendedDocumentHandler > const & xOut,
Reference< container::XNameContainer > const & xDialogModel )
throw (Exception)
SAL_THROW( (Exception) )
{
StyleBag all_styles;
vector< Reference< xml::sax::XAttributeList > > all_elements;
......@@ -1113,6 +1114,8 @@ static void exportDialogModel(
}
}
xOut->startDocument();
if (! all_elements.empty()) // dump out
{
// window
......@@ -1124,6 +1127,8 @@ static void 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("Name") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ) );
pWindow->readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
......@@ -1169,33 +1174,8 @@ static void exportDialogModel(
xOut->ignorableWhitespace( OUString() );
xOut->endElement( aWindowName );
}
}
//==================================================================================================
SAL_DLLEXPORT void SAL_CALL exportDialogModels(
Reference< xml::sax::XExtendedDocumentHandler > const & xOut,
Sequence< Reference< container::XNameContainer > > const & rInModels )
throw (Exception)
{
// 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 );
// write windows
Reference< container::XNameContainer > const * pModels = rInModels.getConstArray();
for ( sal_Int32 nPos = 0; nPos < rInModels.getLength(); ++nPos )
{
exportDialogModel( xOut, pModels[ nPos ] );
}
// end dialogs
xOut->ignorableWhitespace( OUString() );
xOut->endElement( aDialogsName );
xOut->endDocument();
}
};
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_impmodels.cxx,v $
*
* $Revision: 1.10 $
* $Revision: 1.11 $
*
* last change: $Author: dbo $ $Date: 2001-03-07 14:57:38 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -1396,7 +1396,7 @@ BulletinBoardElement::BulletinBoardElement(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ControlElement( rLocalName, xAttributes, pParent, pImport )
{
OUString aValue( _xAttributes->getValueByUidName(
......@@ -1575,61 +1575,4 @@ 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() );
}
}
};
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_import.cxx,v $
*
* $Revision: 1.9 $
* $Revision: 1.10 $
*
* last change: $Author: dbo $ $Date: 2001-03-07 14:57:38 $
* last change: $Author: dbo $ $Date: 2001-03-14 16:39:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -96,7 +96,7 @@ ControlElement::ControlElement(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
SAL_THROW( () )
: ElementBase( rLocalName, xAttributes, pParent, pImport )
{
if (_pParent)
......@@ -977,11 +977,11 @@ ElementBase::ElementBase(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
throw ()
: _aLocalName( rLocalName )
, _xAttributes( xAttributes )
SAL_THROW( () )
: _pImport( pImport )
, _pParent( pParent )
, _pImport( pImport )
, _aLocalName( rLocalName )
, _xAttributes( xAttributes )
{
_pImport->acquire();
......@@ -992,7 +992,7 @@ ElementBase::ElementBase(
}
//__________________________________________________________________________________________________
ElementBase::~ElementBase()
throw ()
SAL_THROW( () )
{
_pImport->release();
......@@ -1048,21 +1048,21 @@ Reference< xml::XImportContext > DialogImport::createRootContext(
OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ),
Reference< XInterface >(), Any() );
}
// dialogs
else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("dialogs") ))
// window
else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("window") ))
{
return new DialogsElement( rLocalName, xAttributes, 0, this );
return new WindowElement( rLocalName, xAttributes, 0, this );
}
else
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("illegal root element (expected dialogs) given: ") ) +
OUString( RTL_CONSTASCII_USTRINGPARAM("illegal root element (expected window) given: ") ) +
rLocalName, Reference< XInterface >(), Any() );
}
}
//__________________________________________________________________________________________________
DialogImport::~DialogImport()
throw ()
SAL_THROW( () )
{
#ifdef DEBUG
OSL_TRACE( "DialogImport::~DialogImport().\n" );
......@@ -1073,7 +1073,7 @@ DialogImport::~DialogImport()
void DialogImport::addStyle(
OUString const & rStyleId,
Reference< xml::XImportContext > const & xStyle )
throw ()
SAL_THROW( () )
{
_styleNames.push_back( rStyleId );
_styles.push_back( xStyle );
......@@ -1081,7 +1081,7 @@ void DialogImport::addStyle(
//__________________________________________________________________________________________________
Reference< xml::XImportContext > DialogImport::getStyle(
OUString const & rStyleId ) const
throw ()
SAL_THROW( () )
{
for ( size_t nPos = 0; nPos < _styleNames.size(); ++nPos )
{
......@@ -1096,18 +1096,10 @@ Reference< xml::XImportContext > DialogImport::getStyle(
//##################################################################################################
//==================================================================================================
SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModels(
Sequence< Reference< container::XNameContainer > > * pOutModels )
throw (Exception)
SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel(
Reference< container::XNameContainer > const & xDialogModel )
SAL_THROW( (Exception) )
{
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 )
};
......@@ -1115,7 +1107,7 @@ SAL_DLLEXPORT Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel
return ::xmlscript::createDocumentHandler(
arNamespaceUids, sizeof(arNamespaceUids) / sizeof(NameSpaceUid),
-1 /* unknown namespace id */,
static_cast< xml::XImporter * >( new DialogImport( xMgr, pOutModels ) ) );
static_cast< xml::XImporter * >( new DialogImport( xDialogModel ) ) );
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment