diff options
-rw-r--r-- | cppuhelper/source/component_context.cxx | 69 | ||||
-rw-r--r-- | cppuhelper/source/makefile.mk | 12 | ||||
-rw-r--r-- | cppuhelper/source/weak.cxx | 16 | ||||
-rw-r--r-- | cppuhelper/test/makefile.mk | 5 | ||||
-rw-r--r-- | cppuhelper/test/testhelper.cxx | 32 |
5 files changed, 71 insertions, 63 deletions
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index 0c0b6d9d1055..216150b47136 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -2,9 +2,9 @@ * * $RCSfile: component_context.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dbo $ $Date: 2002-12-12 14:00:01 $ + * last change: $Author: hr $ $Date: 2003-03-19 17:23:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -427,8 +427,7 @@ protected: public: ComponentContext( ContextEntry_Init const * pEntries, sal_Int32 nEntries, - Reference< XComponentContext > const & xDelegate ) - SAL_THROW( () ); + Reference< XComponentContext > const & xDelegate ); virtual ~ComponentContext() SAL_THROW( () ); @@ -557,6 +556,10 @@ Any ComponentContext::lookupMap( OUString const & rName ) } } } + catch (RuntimeException &) + { + throw; + } catch (Exception & exc) // rethrow as RuntimeException { throw_RT( @@ -696,7 +699,6 @@ void ComponentContext::disposing() ComponentContext::ComponentContext( ContextEntry_Init const * pEntries, sal_Int32 nEntries, Reference< XComponentContext > const & xDelegate ) - SAL_THROW( () ) : WeakComponentImplHelper1< XComponentContext >( m_mutex ) , m_xDelegate( xDelegate ) { @@ -782,7 +784,6 @@ public: inline ConfigurationComponentContext( ContextEntry_Init const * pEntries, sal_Int32 nEntries, Reference< XComponentContext > const & xDelegate ) - SAL_THROW( () ) : ComponentContext( pEntries, nEntries, xDelegate ) {} @@ -836,6 +837,10 @@ Reference< container::XNameAccess > ConfigurationComponentContext::getCfgNode( OUSTR("com.sun.star.configuration.ConfigurationAccess"), args ), UNO_QUERY ); return xNA; } + catch (RuntimeException &) + { + throw; + } catch (Exception & exc) { #ifdef CONTEXT_DIAG @@ -920,6 +925,13 @@ Reference< XInterface > ConfigurationComponentContext::createSingletonFromCfg( { return xInstance; } + throw_RT( OUSTR("no service object raising singleton \""), rName ); + // is here for dummy + return Reference< XInterface >(); + } + catch (RuntimeException &) + { + throw; } catch (Exception & exc) { @@ -927,11 +939,6 @@ Reference< XInterface > ConfigurationComponentContext::createSingletonFromCfg( OUSTR("exception occured raising singleton \""), rName, OUSTR("\": "), exc.Message ); } - - throw_RT( - OUSTR("no service object raising singleton \""), rName ); - // is here for dummy - return Reference< XInterface >(); } //__________________________________________________________________________________________________ Any ConfigurationComponentContext::getValueByName( OUString const & rName ) @@ -1020,6 +1027,10 @@ Any ConfigurationComponentContext::getValueByName( OUString const & rName ) { return xNA->getByName( rName.copy( last +1 ) ); } + catch (RuntimeException &) + { + throw; + } catch (Exception & exc) { #ifdef CONTEXT_DIAG @@ -1097,12 +1108,19 @@ Reference< XComponentContext > SAL_CALL createInitialCfgComponentContext( Reference< XComponentContext > const & xDelegate ) SAL_THROW( () ) { - ConfigurationComponentContext * p = - new ConfigurationComponentContext( pEntries, nEntries, xDelegate ); - Reference< XComponentContext > xContext( p ); - // listen delegate for disposing, to dispose this (wrapping) context first. - DisposingForwarder::listen( Reference< lang::XComponent >::query( xDelegate ), p ); - return xContext; + try + { + ConfigurationComponentContext * p = + new ConfigurationComponentContext( pEntries, nEntries, xDelegate ); + Reference< XComponentContext > xContext( p ); + // listen delegate for disposing, to dispose this (wrapping) context first. + DisposingForwarder::listen( Reference< lang::XComponent >::query( xDelegate ), p ); + return xContext; + } + catch (...) + { + return Reference< XComponentContext >(); + } } //################################################################################################## @@ -1113,11 +1131,18 @@ Reference< XComponentContext > SAL_CALL createComponentContext( { if (nEntries > 0) { - ComponentContext * p = new ComponentContext( pEntries, nEntries, xDelegate ); - Reference< XComponentContext > xContext( p ); - // listen delegate for disposing, to dispose this (wrapping) context first. - DisposingForwarder::listen( Reference< lang::XComponent >::query( xDelegate ), p ); - return xContext; + try + { + ComponentContext * p = new ComponentContext( pEntries, nEntries, xDelegate ); + Reference< XComponentContext > xContext( p ); + // listen delegate for disposing, to dispose this (wrapping) context first. + DisposingForwarder::listen( Reference< lang::XComponent >::query( xDelegate ), p ); + return xContext; + } + catch (...) + { + return Reference< XComponentContext >(); + } } else { diff --git a/cppuhelper/source/makefile.mk b/cppuhelper/source/makefile.mk index e2b07df40dd6..e2611346ceca 100644 --- a/cppuhelper/source/makefile.mk +++ b/cppuhelper/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.28 $ +# $Revision: 1.29 $ # -# last change: $Author: dbo $ $Date: 2002-12-06 10:12:29 $ +# last change: $Author: hr $ $Date: 2003-03-19 17:23:33 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -169,8 +169,8 @@ SHL1TARGET=$(TARGET)$(UDK_MAJOR)$(COMID) .ENDIF # UNIXVERSIONNAMES SHL1STDLIBS= \ - $(CPPULIB) \ - $(SALLIB) + $(SALLIB) \ + $(CPPULIB) SHL1DEPN= SHL1IMPLIB=i$(TARGET) @@ -193,6 +193,10 @@ SHL1VERSIONMAP=cc5_solaris_sparc.map SHL1VERSIONMAP=gcc2_linux_intel.map .ELIF "$(OS)$(CPU)$(COMNAME)"=="LINUXIgcc3" SHL1VERSIONMAP=gcc3_linux_intel.map +.ELIF "$(OS)$(CPU)$(COMNAME)"=="FREEBSDIgcc2" +#SHL1VERSIONMAP=gcc2_freebsd_intel.map +.ELIF "$(OS)$(CPU)$(COMNAME)"=="FREEBSDIgcc3" +#SHL1VERSIONMAP=gcc3_freebsd_intel.map .ENDIF # --- Targets ------------------------------------------------------ diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index 973fe3589f24..4278af05ab66 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -2,9 +2,9 @@ * * $RCSfile: weak.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dbo $ $Date: 2002-11-18 09:59:15 $ + * last change: $Author: hr $ $Date: 2003-03-19 17:23:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -394,20 +394,23 @@ OWeakRefListener::OWeakRefListener() SAL_THROW( () ) } OWeakRefListener::OWeakRefListener(const OWeakRefListener& rRef) SAL_THROW( () ) - : m_aRefCount( 0 ) + : m_aRefCount( 1 ) { try { m_XWeakConnectionPoint = rRef.m_XWeakConnectionPoint; if (m_XWeakConnectionPoint.is()) + { m_XWeakConnectionPoint->addReference((XReference*)this); } + } catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() + osl_decrementInterlockedCount( &m_aRefCount ); } OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt) SAL_THROW( () ) - : m_aRefCount( 0 ) + : m_aRefCount( 1 ) { try { @@ -424,16 +427,19 @@ OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt) SAL_THRO } } catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() + osl_decrementInterlockedCount( &m_aRefCount ); } OWeakRefListener::~OWeakRefListener() SAL_THROW( () ) { try { - acquire(); // dont die again if (m_XWeakConnectionPoint.is()) + { + acquire(); // dont die again m_XWeakConnectionPoint->removeReference((XReference*)this); } + } catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() } diff --git a/cppuhelper/test/makefile.mk b/cppuhelper/test/makefile.mk index 4f53901987a8..df0960f327ff 100644 --- a/cppuhelper/test/makefile.mk +++ b/cppuhelper/test/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.15 $ +# $Revision: 1.16 $ # -# last change: $Author: dbo $ $Date: 2001-11-09 13:49:16 $ +# last change: $Author: hr $ $Date: 2003-03-19 17:23:42 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -169,6 +169,7 @@ $(BIN)$/cpputest.rdb: $(ALLIDLFILES) +idlc -I$(PRJ) -I$(SOLARIDLDIR) -O$(BIN) $? +regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)} +regmerge $@ / $(UNOUCRRDB) + +regcomp -register -r $@ -c $(DLLPRE)corefl$(DLLPOST) touch $@ unoheader: $(BIN)$/cpputest.rdb diff --git a/cppuhelper/test/testhelper.cxx b/cppuhelper/test/testhelper.cxx index 15e9839e21ca..68e223a64086 100644 --- a/cppuhelper/test/testhelper.cxx +++ b/cppuhelper/test/testhelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testhelper.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: hr $ $Date: 2002-08-15 13:13:13 $ + * last change: $Author: hr $ $Date: 2003-03-19 17:23:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,34 +106,6 @@ int __cdecl main( int argc, char * argv[] ) sal_Bool bSucc = sal_False; try { - Reference< XImplementationRegistration > xImplReg( - xMgr->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration") ), - xContext ), - UNO_QUERY ); - OSL_ENSURE( xImplReg.is(), "### no impl reg!" ); - -#ifdef UNX -#define REG_PREFIX "lib" -#ifdef MACOSX -#define DLL_POSTFIX ".dylib" -#else -#define DLL_POSTFIX ".so" -#endif -#else -#define REG_PREFIX "" -#define DLL_POSTFIX ".dll" -#endif - OString aLibName( REG_PREFIX ); - aLibName += "corefl"; -#ifndef OS2 - aLibName += DLL_POSTFIX; -#endif - xImplReg->registerImplementation( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary") ), - OUString::createFromAscii( aLibName.getStr() ), - Reference< XSimpleRegistry >() ); - Reference< XMultiServiceFactory > x( xMgr, UNO_QUERY ); test_ImplHelper( x ); testPropertyTypeHelper(); |