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: tdconsts.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_stoc.hxx"
33 #include <osl/diagnose.h>
34 #include <rtl/ustrbuf.hxx>
35 #include "registry/reader.hxx"
36 #include "registry/version.h"
42 //__________________________________________________________________________________________________
44 ConstantsTypeDescriptionImpl::~ConstantsTypeDescriptionImpl()
48 g_moduleCount
.modCnt
.release( &g_moduleCount
.modCnt
);
52 //__________________________________________________________________________________________________
54 TypeClass
ConstantsTypeDescriptionImpl::getTypeClass()
55 throw( RuntimeException
)
57 return TypeClass_CONSTANTS
;
59 //__________________________________________________________________________________________________
61 OUString
ConstantsTypeDescriptionImpl::getName()
62 throw( RuntimeException
)
67 // XConstantsTypeDescription
68 //__________________________________________________________________________________________________
70 Sequence
< Reference
< XConstantTypeDescription
> > SAL_CALL
71 ConstantsTypeDescriptionImpl::getConstants()
72 throw ( RuntimeException
)
76 typereg::Reader
aReader(
77 _aBytes
.getConstArray(), _aBytes
.getLength(), false,
80 sal_uInt16 nFields
= aReader
.getFieldCount();
81 Sequence
< Reference
< XConstantTypeDescription
> > * pTempConsts
82 = new Sequence
< Reference
< XConstantTypeDescription
> >( nFields
);
83 Reference
< XConstantTypeDescription
> * pConsts
84 = pTempConsts
->getArray();
88 rtl::OUStringBuffer
aName( _aName
);
89 aName
.appendAscii( "." );
90 aName
.append( aReader
.getFieldName( nFields
) );
92 Any
aValue( getRTValue( aReader
.getFieldValue( nFields
) ) );
95 = new ConstantTypeDescriptionImpl( aName
.makeStringAndClear(),
99 ClearableMutexGuard
aGuard( getMutex() );
107 _pMembers
= pTempConsts
;