diff options
Diffstat (limited to 'stoc/source/corereflection')
-rw-r--r-- | stoc/source/corereflection/base.hxx | 3 | ||||
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 32 | ||||
-rw-r--r-- | stoc/source/corereflection/lrucache.hxx | 3 | ||||
-rw-r--r-- | stoc/source/corereflection/makefile.mk | 7 | ||||
-rw-r--r-- | stoc/source/corereflection/reflection.component | 35 |
5 files changed, 44 insertions, 36 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index 405bf773e045..4388ce68c9d4 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -56,9 +56,6 @@ #include <com/sun/star/reflection/XIdlField2.hpp> #include <com/sun/star/reflection/XIdlMethod.hpp> -#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) - - using namespace std; using namespace osl; using namespace cppu; diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 44655df15c5c..bf62d3e073fb 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -31,7 +31,6 @@ #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/implementationentry.hxx> -#include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/reflection/XTypeDescription.hpp> #include "com/sun/star/uno/RuntimeException.hpp" @@ -182,8 +181,6 @@ void IdlReflectionServiceImpl::dispose() MutexGuard aGuard( _aComponentMutex ); _aElements.clear(); - _xTDMgr.clear(); - _xMgr.clear(); #ifdef TEST_LIST_CLASSES OSL_ENSURE( g_aClassNames.size() == 0, "### idl classes still alive!" ); ClassNameList::const_iterator iPos( g_aClassNames.begin() ); @@ -511,35 +508,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - if (component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries )) - { - try - { - // register singleton - registry::XRegistryKey * pKey = - reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - Reference< registry::XRegistryKey > xKey( - pKey->createKey( - OUSTR(IMPLNAME "/UNO/SINGLETONS/com.sun.star.reflection.theCoreReflection") ) ); - xKey->setStringValue( OUSTR("com.sun.star.reflection.CoreReflection") ); - return sal_True; - } - catch (Exception & exc) - { -#if OSL_DEBUG_LEVEL > 0 - OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, cstr.getStr() ); -#else - (void) exc; // unused -#endif - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx index 4e44d537cdcf..35765ef43c8f 100644 --- a/stoc/source/corereflection/lrucache.hxx +++ b/stoc/source/corereflection/lrucache.hxx @@ -178,9 +178,9 @@ template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::setValue( const t_Key & rKey, const t_Val & rValue ) { + ::osl::MutexGuard aGuard( _aCacheMutex ); if (_nCachedElements > 0) { - ::osl::MutexGuard aGuard( _aCacheMutex ); const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) ); CacheEntry * pEntry; @@ -222,6 +222,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::clear() _pBlock[nPos].aKey = t_Key(); _pBlock[nPos].aVal = t_Val(); } + _nCachedElements = 0; #ifdef __CACHE_DIAGNOSE OSL_TRACE( "> cleared cache <\n" ); #endif diff --git a/stoc/source/corereflection/makefile.mk b/stoc/source/corereflection/makefile.mk index b61eb13aa9ee..7156f6d63cc4 100644 --- a/stoc/source/corereflection/makefile.mk +++ b/stoc/source/corereflection/makefile.mk @@ -73,3 +73,10 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk +ALLTAR : $(MISC)/reflection.component + +$(MISC)/reflection.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + reflection.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_URE_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt reflection.component diff --git a/stoc/source/corereflection/reflection.component b/stoc/source/corereflection/reflection.component new file mode 100644 index 000000000000..00772a448367 --- /dev/null +++ b/stoc/source/corereflection/reflection.component @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.stoc.CoreReflection"> + <service name="com.sun.star.reflection.CoreReflection"/> + <singleton name="com.sun.star.reflection.theCoreReflection"/> + </implementation> +</component> |