diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2003-04-23 15:43:14 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2003-04-23 15:43:14 +0000 |
commit | 5459de11c90fbf22053efddfa1d9ce67015ae60c (patch) | |
tree | ff4a32ad894925bab92b009e42d6dee77a6c4254 /remotebridges | |
parent | d80c3e078647684d5e7e3c70a18a25dc31060481 (diff) |
INTEGRATION: CWS uno2 (1.9.20); FILE MERGED
2003/04/15 09:30:43 sb 1.9.20.1: #107753# Fixed minor problems (detected when com.sun.star.bridge.Bridge enumeration is null).
Diffstat (limited to 'remotebridges')
-rw-r--r-- | remotebridges/source/factory/bridgefactory.cxx | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/remotebridges/source/factory/bridgefactory.cxx b/remotebridges/source/factory/bridgefactory.cxx index ac02c6c74f6a..8a4efa3271dc 100644 --- a/remotebridges/source/factory/bridgefactory.cxx +++ b/remotebridges/source/factory/bridgefactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bridgefactory.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sb $ $Date: 2002-10-04 09:40:28 $ + * last change: $Author: rt $ $Date: 2003-04-23 16:43:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -222,30 +222,31 @@ namespace remotebridges_factory RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.bridge.Bridge" ) ); Reference < XEnumeration > rEnum = rContent->createContentEnumeration( sMetaService ); - while( rEnum->hasMoreElements() ) - { - Any a = rEnum->nextElement(); - Reference <XServiceInfo> rInfo; - if( a >>= rInfo ) + if ( rEnum.is() ) + while( rEnum->hasMoreElements() ) { - Sequence< OUString > seq = rInfo->getSupportedServiceNames(); - sal_Int32 i; - for( i = 0 ; i < seq.getLength() ; i ++ ) + Any a = rEnum->nextElement(); + Reference <XServiceInfo> rInfo; + if( a >>= rInfo ) { - if( seq.getConstArray()[i] != sMetaService ) + Sequence< OUString > seq = rInfo->getSupportedServiceNames(); + sal_Int32 i; + for( i = 0 ; i < seq.getLength() ; i ++ ) { - sal_Int32 nIndex = seq.getConstArray()[i].lastIndexOf( '.' ); - OUString sSuffix = seq.getConstArray()[i].copy(nIndex+1); - if( sSuffix.getLength() > 6 && - 0 == sSuffix.copy( sSuffix.getLength() - 6 ).compareToAscii( "Bridge" ) ) + if( seq.getConstArray()[i] != sMetaService ) { - OUString sProtocol = sSuffix.copy(0 , sSuffix.getLength()-6 ).toAsciiLowerCase(); - m_mapProtocolToService[ sProtocol ] = seq.getConstArray()[i]; + sal_Int32 nIndex = seq.getConstArray()[i].lastIndexOf( '.' ); + OUString sSuffix = seq.getConstArray()[i].copy(nIndex+1); + if( sSuffix.getLength() > 6 && + 0 == sSuffix.copy( sSuffix.getLength() - 6 ).compareToAscii( "Bridge" ) ) + { + OUString sProtocol = sSuffix.copy(0 , sSuffix.getLength()-6 ).toAsciiLowerCase(); + m_mapProtocolToService[ sProtocol ] = seq.getConstArray()[i]; + } } } } } - } } m_bInitialized = sal_True; } @@ -272,7 +273,7 @@ namespace remotebridges_factory else { // fallback to the old solution, deprecated, should be removed ! - OUString sService = OUString::createFromAscii( "com.sun.star.bridge.Bridge." ); + sService = OUString::createFromAscii( "com.sun.star.bridge.Bridge." ); sService += sProtocolName; } return sService; |