From e48d1e44299a45b774fcffd5a12929faa8d1da41 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 19 Nov 2002 14:03:27 +0000 Subject: #105292# - Brought up to date. --- ucbhelper/workben/myucp/myucp_datasupplier.cxx | 108 ++++++++++++------------- ucbhelper/workben/myucp/myucp_datasupplier.hxx | 9 ++- ucbhelper/workben/myucp/myucp_resultset.cxx | 18 ++--- ucbhelper/workben/myucp/myucp_resultset.hxx | 14 ++-- ucbhelper/workben/myucp/myucp_services.cxx | 31 ++++--- 5 files changed, 89 insertions(+), 91 deletions(-) (limited to 'ucbhelper') diff --git a/ucbhelper/workben/myucp/myucp_datasupplier.cxx b/ucbhelper/workben/myucp/myucp_datasupplier.cxx index a85b0ceef8fc..585b9c0b14bd 100644 --- a/ucbhelper/workben/myucp/myucp_datasupplier.cxx +++ b/ucbhelper/workben/myucp/myucp_datasupplier.cxx @@ -2,9 +2,9 @@ * * $RCSfile: myucp_datasupplier.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: armin $ $Date: 2001-03-08 10:02:51 $ + * last change: $Author: kso $ $Date: 2002-11-19 15:03:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,9 +65,8 @@ *************************************************************************/ -#ifndef __VECTOR__ #include -#endif + #ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX #include #endif @@ -84,13 +83,8 @@ #include "myucp_content.hxx" #endif -using namespace com::sun::star::beans; -using namespace com::sun::star::lang; -using namespace com::sun::star::ucb; -using namespace com::sun::star::uno; -using namespace com::sun::star::sdbc; -using namespace rtl; -using namespace ucb; +using namespace com::sun; +using namespace com::sun::star; // @@@ Adjust namespace name. using namespace myucp; @@ -107,11 +101,11 @@ namespace myucp struct ResultListEntry { - OUString aId; - Reference< XContentIdentifier > xId; - Reference< XContent > xContent; - Reference< XRow > xRow; - const ContentProperties& rData; + rtl::OUString aId; + uno::Reference< star::ucb::XContentIdentifier > xId; + uno::Reference< star::ucb::XContent > xContent; + uno::Reference< sdbc::XRow > xRow; + const ContentProperties& rData; ResultListEntry( const ContentProperties& rEntry ) : rData( rEntry ) {} }; @@ -132,18 +126,18 @@ typedef std::vector< ResultListEntry* > ResultList; struct DataSupplier_Impl { - osl::Mutex m_aMutex; - ResultList m_aResults; - vos::ORef< Content > m_xContent; - Reference< XMultiServiceFactory > m_xSMgr; + osl::Mutex m_aMutex; + ResultList m_aResults; + rtl::Reference< Content > m_xContent; + uno::Reference< lang::XMultiServiceFactory > m_xSMgr; // @@@ The data source and an iterator for it -// Entry m_aFolder; -// Entry::iterator m_aIterator; - sal_Int32 m_nOpenMode; - sal_Bool m_bCountFinal; +// Entry m_aFolder; +// Entry::iterator m_aIterator; + sal_Int32 m_nOpenMode; + sal_Bool m_bCountFinal; - DataSupplier_Impl( const Reference< XMultiServiceFactory >& rxSMgr, - const vos::ORef< Content >& rContent, + DataSupplier_Impl( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) : m_xContent( rContent ), m_xSMgr( rxSMgr ), // m_aFolder( rxSMgr, rContent->getIdentifier()->getContentIdentifier() ), @@ -174,8 +168,8 @@ DataSupplier_Impl::~DataSupplier_Impl() //========================================================================= //========================================================================= -DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& rxSMgr, - const vos::ORef< Content >& rContent, +DataSupplier::DataSupplier( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ) : m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) { @@ -190,13 +184,13 @@ DataSupplier::~DataSupplier() //========================================================================= // virtual -OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) +rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) { - OUString aId = m_pImpl->m_aResults[ nIndex ]->aId; + rtl::OUString aId = m_pImpl->m_aResults[ nIndex ]->aId; if ( aId.getLength() ) { // Already cached. @@ -206,7 +200,7 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) if ( getResult( nIndex ) ) { - OUString aId + rtl::OUString aId = m_pImpl->m_xContent->getIdentifier()->getContentIdentifier(); aId += m_pImpl->m_aResults[ nIndex ]->rData.aTitle; @@ -214,19 +208,19 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) m_pImpl->m_aResults[ nIndex ]->aId = aId; return aId; } - return OUString(); + return rtl::OUString(); } //========================================================================= // virtual -Reference< XContentIdentifier > DataSupplier::queryContentIdentifier( - sal_uInt32 nIndex ) +uno::Reference< star::ucb::XContentIdentifier > +DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) { - Reference< XContentIdentifier > xId + uno::Reference< star::ucb::XContentIdentifier > xId = m_pImpl->m_aResults[ nIndex ]->xId; if ( xId.is() ) { @@ -235,25 +229,27 @@ Reference< XContentIdentifier > DataSupplier::queryContentIdentifier( } } - OUString aId = queryContentIdentifierString( nIndex ); + rtl::OUString aId = queryContentIdentifierString( nIndex ); if ( aId.getLength() ) { - Reference< XContentIdentifier > xId = new ContentIdentifier( aId ); + uno::Reference< star::ucb::XContentIdentifier > xId + = new ::ucb::ContentIdentifier( aId ); m_pImpl->m_aResults[ nIndex ]->xId = xId; return xId; } - return Reference< XContentIdentifier >(); + return uno::Reference< star::ucb::XContentIdentifier >(); } //========================================================================= // virtual -Reference< XContent > DataSupplier::queryContent( sal_uInt32 nIndex ) +uno::Reference< star::ucb::XContent > +DataSupplier::queryContent( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) { - Reference< XContent > xContent + uno::Reference< star::ucb::XContent > xContent = m_pImpl->m_aResults[ nIndex ]->xContent; if ( xContent.is() ) { @@ -262,22 +258,23 @@ Reference< XContent > DataSupplier::queryContent( sal_uInt32 nIndex ) } } - Reference< XContentIdentifier > xId = queryContentIdentifier( nIndex ); + uno::Reference< star::ucb::XContentIdentifier > xId + = queryContentIdentifier( nIndex ); if ( xId.is() ) { try { - Reference< XContent > xContent + uno::Reference< star::ucb::XContent > xContent = m_pImpl->m_xContent->getProvider()->queryContent( xId ); m_pImpl->m_aResults[ nIndex ]->xContent = xContent; return xContent; } - catch ( IllegalIdentifierException& ) + catch ( star::ucb::IllegalIdentifierException& ) { } } - return Reference< XContent >(); + return uno::Reference< star::ucb::XContent >(); } //========================================================================= @@ -324,8 +321,8 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) if ( !bFound ) m_pImpl->m_bCountFinal = sal_True; - vos::ORef< ResultSet > xResultSet = getResultSet(); - if ( xResultSet.isValid() ) + rtl::Reference< ::ucb::ResultSet > xResultSet = getResultSet().getBodyPtr(); + if ( xResultSet.is() ) { // Callbacks follow! aGuard.clear(); @@ -360,8 +357,8 @@ sal_uInt32 DataSupplier::totalCount() */ m_pImpl->m_bCountFinal = sal_True; - vos::ORef< ResultSet > xResultSet = getResultSet(); - if ( xResultSet.isValid() ) + rtl::Reference< ::ucb::ResultSet > xResultSet = getResultSet().getBodyPtr(); + if ( xResultSet.is() ) { // Callbacks follow! aGuard.clear(); @@ -392,13 +389,14 @@ sal_Bool DataSupplier::isCountFinal() //========================================================================= // virtual -Reference< XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) +uno::Reference< sdbc::XRow > +DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) { - Reference< XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow; + uno::Reference< sdbc::XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow; if ( xRow.is() ) { // Already cached. @@ -408,17 +406,17 @@ Reference< XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) if ( getResult( nIndex ) ) { - Reference< XRow > xRow = Content::getPropertyValues( + uno::Reference< sdbc::XRow > xRow = Content::getPropertyValues( m_pImpl->m_xSMgr, getResultSet()->getProperties(), m_pImpl->m_aResults[ nIndex ]->rData, - m_pImpl->m_xContent->getProvider(), + m_pImpl->m_xContent->getProvider().getBodyPtr(), queryContentIdentifierString( nIndex ) ); m_pImpl->m_aResults[ nIndex ]->xRow = xRow; return xRow; } - return Reference< XRow >(); + return uno::Reference< sdbc::XRow >(); } //========================================================================= @@ -428,7 +426,7 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = Reference< XRow >(); + m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); } //========================================================================= @@ -440,7 +438,7 @@ void DataSupplier::close() //========================================================================= // virtual void DataSupplier::validate() - throw( ResultSetException ) + throw( star::ucb::ResultSetException ) { } diff --git a/ucbhelper/workben/myucp/myucp_datasupplier.hxx b/ucbhelper/workben/myucp/myucp_datasupplier.hxx index 433934b4c80a..8a265940b2d8 100644 --- a/ucbhelper/workben/myucp/myucp_datasupplier.hxx +++ b/ucbhelper/workben/myucp/myucp_datasupplier.hxx @@ -2,9 +2,9 @@ * * $RCSfile: myucp_datasupplier.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kso $ $Date: 2000-11-17 15:38:10 $ + * last change: $Author: kso $ $Date: 2002-11-19 15:03:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,9 @@ #ifndef _MYUCP_DATASUPPLIER_HXX #define _MYUCP_DATASUPPLIER_HXX +#ifndef _RTL_REF_HXX_ +#include +#endif #ifndef _UCBHELPER_RESULTSET_HXX #include #endif @@ -80,7 +83,7 @@ class DataSupplier : public ucb::ResultSetDataSupplier public: DataSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - const vos::ORef< Content >& rContent, + const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode ); virtual ~DataSupplier(); diff --git a/ucbhelper/workben/myucp/myucp_resultset.cxx b/ucbhelper/workben/myucp/myucp_resultset.cxx index 692cf07371f3..7d6aeb263a78 100644 --- a/ucbhelper/workben/myucp/myucp_resultset.cxx +++ b/ucbhelper/workben/myucp/myucp_resultset.cxx @@ -2,9 +2,9 @@ * * $RCSfile: myucp_resultset.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kso $ $Date: 2000-11-17 15:38:10 $ + * last change: $Author: kso $ $Date: 2002-11-19 15:03:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,9 +77,9 @@ #include "myucp_resultset.hxx" #endif -using namespace com::sun::star::lang; -using namespace com::sun::star::ucb; -using namespace com::sun::star::uno; + +using namespace com::sun; +using namespace com::sun::star; // @@@ Adjust namespace name. using namespace myucp; @@ -93,10 +93,10 @@ using namespace myucp; //========================================================================= DynamicResultSet::DynamicResultSet( - const Reference< XMultiServiceFactory >& rxSMgr, - const vos::ORef< Content >& rxContent, - const OpenCommandArgument2& rCommand, - const Reference< XCommandEnvironment >& rxEnv ) + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rxContent, + const star::ucb::OpenCommandArgument2& rCommand, + const uno::Reference< star::ucb::XCommandEnvironment >& rxEnv ) : ResultSetImplHelper( rxSMgr, rCommand ), m_xContent( rxContent ), m_xEnv( rxEnv ) diff --git a/ucbhelper/workben/myucp/myucp_resultset.hxx b/ucbhelper/workben/myucp/myucp_resultset.hxx index fa45fe6f8c6b..00034026bbe1 100644 --- a/ucbhelper/workben/myucp/myucp_resultset.hxx +++ b/ucbhelper/workben/myucp/myucp_resultset.hxx @@ -2,9 +2,9 @@ * * $RCSfile: myucp_resultset.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kso $ $Date: 2000-11-17 15:38:10 $ + * last change: $Author: kso $ $Date: 2002-11-19 15:03:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,12 +63,12 @@ #ifndef _MYUCP_RESULTSET_HXX #define _MYUCP_RESULTSET_HXX +#ifndef _RTL_REF_HXX_ +#include +#endif #ifndef _UCBHELPER_RESULTSETHELPER_HXX #include #endif -#ifndef _VOS_REF_HXX_ -#include -#endif // @@@ Adjust multi-include-protection-ifdef and header file name. #ifndef _MYUCP_CONTENT_HXX @@ -80,7 +80,7 @@ namespace myucp { class DynamicResultSet : public ::ucb::ResultSetImplHelper { - vos::ORef< Content > m_xContent; + rtl::Reference< Content > m_xContent; com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xEnv; @@ -92,7 +92,7 @@ public: DynamicResultSet( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - const vos::ORef< Content >& rxContent, + const rtl::Reference< Content >& rxContent, const com::sun::star::ucb::OpenCommandArgument2& rCommand, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& rxEnv ); diff --git a/ucbhelper/workben/myucp/myucp_services.cxx b/ucbhelper/workben/myucp/myucp_services.cxx index 0659725a3a72..35fa59458c37 100644 --- a/ucbhelper/workben/myucp/myucp_services.cxx +++ b/ucbhelper/workben/myucp/myucp_services.cxx @@ -2,9 +2,9 @@ * * $RCSfile: myucp_services.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:03:38 $ + * last change: $Author: kso $ $Date: 2002-11-19 15:03:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,27 +74,24 @@ #include "myucp_provider.hxx" #endif -using namespace rtl; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::registry; +using namespace com::sun::star; //========================================================================= static sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) + const rtl::OUString & rImplementationName, + uno::Sequence< rtl::OUString > const & rServiceNames ) { - OUString aKeyName( OUString::createFromAscii( "/" ) ); + rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); + aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - Reference< XRegistryKey > xKey; + uno::Reference< registry::XRegistryKey > xKey; try { - xKey = static_cast< XRegistryKey * >( + xKey = static_cast< registry::XRegistryKey * >( pRegistryKey )->createKey( aKeyName ); } - catch ( InvalidRegistryException const & ) + catch ( registry::InvalidRegistryException const & ) { } @@ -109,7 +106,7 @@ static sal_Bool writeInfo( void * pRegistryKey, { xKey->createKey( rServiceNames[ n ] ); } - catch ( InvalidRegistryException const & ) + catch ( registry::InvalidRegistryException const & ) { bSuccess = sal_False; break; @@ -147,9 +144,9 @@ extern "C" void * SAL_CALL component_getFactory( { void * pRet = 0; - Reference< XMultiServiceFactory > xSMgr( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); - Reference< XSingleServiceFactory > xFactory; + uno::Reference< lang::XMultiServiceFactory > xSMgr( + reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); + uno::Reference< lang::XSingleServiceFactory > xFactory; ////////////////////////////////////////////////////////////////////// // Create factory, if implementation name matches. -- cgit