1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: typeprovider.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_cppuhelper.hxx"
34 #include <cppuhelper/typeprovider.hxx>
35 #include <osl/mutex.hxx>
38 using namespace com::sun::star::uno
;
43 //__________________________________________________________________________________________________
44 OImplementationId::~OImplementationId() SAL_THROW( () )
48 //__________________________________________________________________________________________________
49 Sequence
< sal_Int8
> OImplementationId::getImplementationId() const SAL_THROW( () )
53 MutexGuard
aGuard( Mutex::getGlobalMutex() );
56 Sequence
< sal_Int8
> * pSeq
= new Sequence
< sal_Int8
>( 16 );
57 ::rtl_createUuid( (sal_uInt8
*)pSeq
->getArray(), 0, _bUseEthernetAddress
);
64 //--------------------------------------------------------------------------------------------------
65 static inline void copy( Sequence
< Type
> & rDest
, const Sequence
< Type
> & rSource
, sal_Int32 nOffset
)
68 Type
* pDest
= rDest
.getArray();
69 const Type
* pSource
= rSource
.getConstArray();
71 for ( sal_Int32 nPos
= rSource
.getLength(); nPos
--; )
72 pDest
[nOffset
+ nPos
] = pSource
[nPos
];
75 //__________________________________________________________________________________________________
76 OTypeCollection::OTypeCollection(
78 const Sequence
< Type
> & rAddTypes
)
80 : _aTypes( 1 + rAddTypes
.getLength() )
83 copy( _aTypes
, rAddTypes
, 1 );
85 //__________________________________________________________________________________________________
86 OTypeCollection::OTypeCollection(
89 const Sequence
< Type
> & rAddTypes
)
91 : _aTypes( 2 + rAddTypes
.getLength() )
95 copy( _aTypes
, rAddTypes
, 2 );
97 //__________________________________________________________________________________________________
98 OTypeCollection::OTypeCollection(
102 const Sequence
< Type
> & rAddTypes
)
104 : _aTypes( 3 + rAddTypes
.getLength() )
109 copy( _aTypes
, rAddTypes
, 3 );
111 //__________________________________________________________________________________________________
112 OTypeCollection::OTypeCollection(
117 const Sequence
< Type
> & rAddTypes
)
119 : _aTypes( 4 + rAddTypes
.getLength() )
125 copy( _aTypes
, rAddTypes
, 4 );
127 //__________________________________________________________________________________________________
128 OTypeCollection::OTypeCollection(
134 const Sequence
< Type
> & rAddTypes
)
136 : _aTypes( 5 + rAddTypes
.getLength() )
143 copy( _aTypes
, rAddTypes
, 5 );
145 //__________________________________________________________________________________________________
146 OTypeCollection::OTypeCollection(
153 const Sequence
< Type
> & rAddTypes
)
155 : _aTypes( 6 + rAddTypes
.getLength() )
163 copy( _aTypes
, rAddTypes
, 6 );
165 //__________________________________________________________________________________________________
166 OTypeCollection::OTypeCollection(
174 const Sequence
< Type
> & rAddTypes
)
176 : _aTypes( 7 + rAddTypes
.getLength() )
185 copy( _aTypes
, rAddTypes
, 7 );
187 //__________________________________________________________________________________________________
188 OTypeCollection::OTypeCollection(
197 const Sequence
< Type
> & rAddTypes
)
199 : _aTypes( 8 + rAddTypes
.getLength() )
209 copy( _aTypes
, rAddTypes
, 8 );
211 //__________________________________________________________________________________________________
212 OTypeCollection::OTypeCollection(
222 const Sequence
< Type
> & rAddTypes
)
224 : _aTypes( 9 + rAddTypes
.getLength() )
235 copy( _aTypes
, rAddTypes
, 9 );
237 //__________________________________________________________________________________________________
238 OTypeCollection::OTypeCollection(
248 const Type
& rType10
,
249 const Sequence
< Type
> & rAddTypes
)
251 : _aTypes( 10 + rAddTypes
.getLength() )
262 _aTypes
[9] = rType10
;
263 copy( _aTypes
, rAddTypes
, 10 );
265 //__________________________________________________________________________________________________
266 OTypeCollection::OTypeCollection(
276 const Type
& rType10
,
277 const Type
& rType11
,
278 const Sequence
< Type
> & rAddTypes
)
280 : _aTypes( 11 + rAddTypes
.getLength() )
291 _aTypes
[9] = rType10
;
292 _aTypes
[10] = rType11
;
293 copy( _aTypes
, rAddTypes
, 11 );
295 //__________________________________________________________________________________________________
296 OTypeCollection::OTypeCollection(
306 const Type
& rType10
,
307 const Type
& rType11
,
308 const Type
& rType12
,
309 const Sequence
< Type
> & rAddTypes
)
311 : _aTypes( 12 + rAddTypes
.getLength() )
322 _aTypes
[9] = rType10
;
323 _aTypes
[10] = rType11
;
324 _aTypes
[11] = rType12
;
325 copy( _aTypes
, rAddTypes
, 12 );