diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-19 16:23:42 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-19 16:23:42 +0000 |
commit | ab86e92fa219718c5c172c373e8c7c3d016a2d31 (patch) | |
tree | add491b1759d9107037bfbb0de0305b27094bb8a /cppuhelper/source | |
parent | 31bf9f8309d6f5283ce08dc92a929cb1a61e8a76 (diff) |
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'cppuhelper/source')
-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 |
3 files changed, 66 insertions, 31 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() } |