Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "base.hxx"
21 :
22 : namespace stoc_rdbtdp
23 : {
24 84 : TypedefTypeDescriptionImpl::~TypedefTypeDescriptionImpl()
25 : {
26 28 : g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
27 56 : }
28 :
29 : // XTypeDescription
30 : //__________________________________________________________________________________________________
31 94 : TypeClass TypedefTypeDescriptionImpl::getTypeClass()
32 : throw(::com::sun::star::uno::RuntimeException)
33 : {
34 94 : return TypeClass_TYPEDEF;
35 : }
36 : //__________________________________________________________________________________________________
37 47 : OUString TypedefTypeDescriptionImpl::getName()
38 : throw(::com::sun::star::uno::RuntimeException)
39 : {
40 47 : return _aName;
41 : }
42 :
43 : // XIndirectTypeDescription
44 : //__________________________________________________________________________________________________
45 47 : Reference< XTypeDescription > TypedefTypeDescriptionImpl::getReferencedType()
46 : throw(::com::sun::star::uno::RuntimeException)
47 : {
48 47 : if (!_xRefTD.is() && !_aRefName.isEmpty())
49 : {
50 : try
51 : {
52 29 : Reference< XTypeDescription > xRefTD;
53 29 : if (_xTDMgr->getByHierarchicalName( _aRefName ) >>= xRefTD)
54 : {
55 29 : MutexGuard aGuard( getMutex() );
56 29 : if (! _xRefTD.is())
57 29 : _xRefTD = xRefTD;
58 29 : return _xRefTD;
59 29 : }
60 : }
61 0 : catch (NoSuchElementException &)
62 : {
63 : }
64 : // never try again, if no base td was found
65 0 : _aRefName = OUString();
66 : }
67 18 : return _xRefTD;
68 : }
69 :
70 : }
71 :
72 :
73 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|