xref: /trunk/main/stoc/source/registry_tdprovider/tdef.cxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_stoc.hxx"
26 #include "base.hxx"
27 
28 namespace stoc_rdbtdp
29 {
30 TypedefTypeDescriptionImpl::~TypedefTypeDescriptionImpl()
31 {
32     g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
33 }
34 
35 // XTypeDescription
36 //__________________________________________________________________________________________________
37 TypeClass TypedefTypeDescriptionImpl::getTypeClass()
38 {
39     return TypeClass_TYPEDEF;
40 }
41 //__________________________________________________________________________________________________
42 OUString TypedefTypeDescriptionImpl::getName()
43 {
44     return _aName;
45 }
46 
47 // XIndirectTypeDescription
48 //__________________________________________________________________________________________________
49 Reference< XTypeDescription > TypedefTypeDescriptionImpl::getReferencedType()
50 {
51     if (!_xRefTD.is() && _aRefName.getLength())
52     {
53         try
54         {
55             Reference< XTypeDescription > xRefTD;
56             if (_xTDMgr->getByHierarchicalName( _aRefName ) >>= xRefTD)
57             {
58                 MutexGuard aGuard( getMutex() );
59                 if (! _xRefTD.is())
60                     _xRefTD = xRefTD;
61                 return _xRefTD;
62             }
63         }
64         catch (NoSuchElementException &)
65         {
66         }
67         // never try again, if no base td was found
68         _aRefName = OUString();
69     }
70     return _xRefTD;
71 }
72 
73 }
74