1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 // MARKER(update_precomp.py): autogen include statement, do not remove
30 #include "precompiled_cppuhelper.hxx"
32 #include <cppuhelper/typeprovider.hxx>
33 #include <osl/mutex.hxx>
36 using namespace com::sun::star::uno
;
41 //__________________________________________________________________________________________________
42 OImplementationId::~OImplementationId() SAL_THROW( () )
46 //__________________________________________________________________________________________________
47 Sequence
< sal_Int8
> OImplementationId::getImplementationId() const SAL_THROW( () )
51 MutexGuard
aGuard( Mutex::getGlobalMutex() );
54 Sequence
< sal_Int8
> * pSeq
= new Sequence
< sal_Int8
>( 16 );
55 ::rtl_createUuid( (sal_uInt8
*)pSeq
->getArray(), 0, _bUseEthernetAddress
);
62 //--------------------------------------------------------------------------------------------------
63 static inline void copy( Sequence
< Type
> & rDest
, const Sequence
< Type
> & rSource
, sal_Int32 nOffset
)
66 Type
* pDest
= rDest
.getArray();
67 const Type
* pSource
= rSource
.getConstArray();
69 for ( sal_Int32 nPos
= rSource
.getLength(); nPos
--; )
70 pDest
[nOffset
+ nPos
] = pSource
[nPos
];
73 //__________________________________________________________________________________________________
74 OTypeCollection::OTypeCollection(
76 const Sequence
< Type
> & rAddTypes
)
78 : _aTypes( 1 + rAddTypes
.getLength() )
81 copy( _aTypes
, rAddTypes
, 1 );
83 //__________________________________________________________________________________________________
84 OTypeCollection::OTypeCollection(
87 const Sequence
< Type
> & rAddTypes
)
89 : _aTypes( 2 + rAddTypes
.getLength() )
93 copy( _aTypes
, rAddTypes
, 2 );
95 //__________________________________________________________________________________________________
96 OTypeCollection::OTypeCollection(
100 const Sequence
< Type
> & rAddTypes
)
102 : _aTypes( 3 + rAddTypes
.getLength() )
107 copy( _aTypes
, rAddTypes
, 3 );
109 //__________________________________________________________________________________________________
110 OTypeCollection::OTypeCollection(
115 const Sequence
< Type
> & rAddTypes
)
117 : _aTypes( 4 + rAddTypes
.getLength() )
123 copy( _aTypes
, rAddTypes
, 4 );
125 //__________________________________________________________________________________________________
126 OTypeCollection::OTypeCollection(
132 const Sequence
< Type
> & rAddTypes
)
134 : _aTypes( 5 + rAddTypes
.getLength() )
141 copy( _aTypes
, rAddTypes
, 5 );
143 //__________________________________________________________________________________________________
144 OTypeCollection::OTypeCollection(
151 const Sequence
< Type
> & rAddTypes
)
153 : _aTypes( 6 + rAddTypes
.getLength() )
161 copy( _aTypes
, rAddTypes
, 6 );
163 //__________________________________________________________________________________________________
164 OTypeCollection::OTypeCollection(
172 const Sequence
< Type
> & rAddTypes
)
174 : _aTypes( 7 + rAddTypes
.getLength() )
183 copy( _aTypes
, rAddTypes
, 7 );
185 //__________________________________________________________________________________________________
186 OTypeCollection::OTypeCollection(
195 const Sequence
< Type
> & rAddTypes
)
197 : _aTypes( 8 + rAddTypes
.getLength() )
207 copy( _aTypes
, rAddTypes
, 8 );
209 //__________________________________________________________________________________________________
210 OTypeCollection::OTypeCollection(
220 const Sequence
< Type
> & rAddTypes
)
222 : _aTypes( 9 + rAddTypes
.getLength() )
233 copy( _aTypes
, rAddTypes
, 9 );
235 //__________________________________________________________________________________________________
236 OTypeCollection::OTypeCollection(
246 const Type
& rType10
,
247 const Sequence
< Type
> & rAddTypes
)
249 : _aTypes( 10 + rAddTypes
.getLength() )
260 _aTypes
[9] = rType10
;
261 copy( _aTypes
, rAddTypes
, 10 );
263 //__________________________________________________________________________________________________
264 OTypeCollection::OTypeCollection(
274 const Type
& rType10
,
275 const Type
& rType11
,
276 const Sequence
< Type
> & rAddTypes
)
278 : _aTypes( 11 + rAddTypes
.getLength() )
289 _aTypes
[9] = rType10
;
290 _aTypes
[10] = rType11
;
291 copy( _aTypes
, rAddTypes
, 11 );
293 //__________________________________________________________________________________________________
294 OTypeCollection::OTypeCollection(
304 const Type
& rType10
,
305 const Type
& rType11
,
306 const Type
& rType12
,
307 const Sequence
< Type
> & rAddTypes
)
309 : _aTypes( 12 + rAddTypes
.getLength() )
320 _aTypes
[9] = rType10
;
321 _aTypes
[10] = rType11
;
322 _aTypes
[11] = rType12
;
323 copy( _aTypes
, rAddTypes
, 12 );
328 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */