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