From 8c4e7806b2e8486108a817ded456433fc77f60a5 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Thu, 25 Aug 2011 22:00:10 +0200 Subject: unusedcode: ucbhelper:: cleaning --- ucbhelper/source/client/content.cxx | 278 --------------------- ucbhelper/source/client/contentbroker.cxx | 28 --- .../source/provider/commandenvironmentproxy.cxx | 168 ------------- ucbhelper/source/provider/contenthelper.cxx | 20 -- .../source/provider/handleinteractionrequest.cxx | 164 ------------ ucbhelper/source/provider/propertyvalueset.cxx | 130 ---------- ucbhelper/source/provider/resultsethelper.cxx | 10 - .../provider/simpleauthenticationrequest.cxx | 81 ------ 8 files changed, 879 deletions(-) delete mode 100644 ucbhelper/source/provider/commandenvironmentproxy.cxx delete mode 100644 ucbhelper/source/provider/handleinteractionrequest.cxx (limited to 'ucbhelper/source') diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index ff2a8ef9f21a..19fd94e2a9e6 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -205,7 +205,6 @@ public: Reference< XMultiServiceFactory > getServiceManager() { return m_xSMgr; } Any executeCommand( const Command& rCommand ); - void abortCommand(); inline const Reference< XCommandEnvironment >& getEnvironment() const; inline void setEnvironment( @@ -404,18 +403,6 @@ Content::Content( const rtl::OUString& rURL, m_xImpl = new Content_Impl( pBroker->getServiceManager(), xContent, rEnv ); } -//========================================================================= -Content::Content( const Reference< XContentIdentifier >& rId, - const Reference< XCommandEnvironment >& rEnv ) - throw ( ContentCreationException, RuntimeException ) -{ - ContentBroker* pBroker = getContentBroker( true ); - - Reference< XContent > xContent = getContent( *pBroker, rId, true ); - - m_xImpl = new Content_Impl( pBroker->getServiceManager(), xContent, rEnv ); -} - //========================================================================= Content::Content( const Reference< XContent >& rContent, const Reference< XCommandEnvironment >& rEnv ) @@ -457,42 +444,6 @@ sal_Bool Content::create( const rtl::OUString& rURL, return sal_True; } -//========================================================================= -// static -sal_Bool Content::create( const Reference< XContentIdentifier >& rId, - const Reference< XCommandEnvironment >& rEnv, - Content& rContent ) -{ - ContentBroker* pBroker = getContentBroker( false ); - if ( !pBroker ) - return sal_False; - - Reference< XContent > xContent = getContent( *pBroker, rId, false ); - if ( !xContent.is() ) - return sal_False; - - rContent.m_xImpl - = new Content_Impl( pBroker->getServiceManager(), xContent, rEnv ); - - return sal_True; -} - -//========================================================================= -// static -sal_Bool Content::create( const Reference< XContent >& xContent, - const Reference< XCommandEnvironment >& rEnv, - Content& rContent ) -{ - ContentBroker* pBroker = getContentBroker( false ); - if ( !pBroker ) - return sal_False; - - rContent.m_xImpl - = new Content_Impl( pBroker->getServiceManager(), xContent, rEnv ); - - return sal_True; -} - //========================================================================= Content::~Content() { @@ -573,17 +524,6 @@ Any Content::getPropertyValue( const rtl::OUString& rPropertyName ) return aRet.getConstArray()[ 0 ]; } -//========================================================================= -Any Content::getPropertyValue( sal_Int32 nPropertyHandle ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Sequence< sal_Int32 > aHandles( 1 ); - aHandles.getArray()[ 0 ] = nPropertyHandle; - - Sequence< Any > aRet = getPropertyValues( aHandles ); - return aRet.getConstArray()[ 0 ]; -} - //========================================================================= Any Content::setPropertyValue( const rtl::OUString& rName, const Any& rValue ) @@ -599,21 +539,6 @@ Any Content::setPropertyValue( const rtl::OUString& rName, return aErrors.getConstArray()[ 0 ]; } -//========================================================================= -Any Content::setPropertyValue( const sal_Int32 nPropertyHandle, - const Any& rValue ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Sequence< sal_Int32 > aHandles( 1 ); - aHandles.getArray()[ 0 ] = nPropertyHandle; - - Sequence< Any > aValues( 1 ); - aValues.getArray()[ 0 ] = rValue; - - Sequence< Any > aErrors = setPropertyValues( aHandles, aValues ); - return aErrors.getConstArray()[ 0 ]; -} - //========================================================================= Sequence< Any > Content::getPropertyValues( const Sequence< rtl::OUString >& rPropertyNames ) @@ -831,25 +756,6 @@ Any Content::executeCommand( const rtl::OUString& rCommandName, return m_xImpl->executeCommand( aCommand ); } -//========================================================================= -Any Content::executeCommand( sal_Int32 nCommandHandle, - const Any& rCommandArgument ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Command aCommand; - aCommand.Name = rtl::OUString(); // n/a - aCommand.Handle = nCommandHandle; - aCommand.Argument = rCommandArgument; - - return m_xImpl->executeCommand( aCommand ); -} - -//========================================================================= -void Content::abortCommand() -{ - m_xImpl->abortCommand(); -} - //========================================================================= Any Content::createCursorAny( const Sequence< rtl::OUString >& rPropertyNames, ResultSetInclude eMode ) @@ -946,36 +852,6 @@ Reference< XResultSet > Content::createCursor( return aResult; } -//========================================================================= -Reference< XResultSet > Content::createCursor( - const Sequence< sal_Int32 >& rPropertyHandles, - ResultSetInclude eMode ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Any aCursorAny = createCursorAny( rPropertyHandles, eMode ); - - Reference< XDynamicResultSet > xDynSet; - Reference< XResultSet > aResult; - - aCursorAny >>= xDynSet; - if ( xDynSet.is() ) - aResult = xDynSet->getStaticResultSet(); - - OSL_ENSURE( aResult.is(), "Content::createCursor - no cursor!" ); - - if ( !aResult.is() ) - { - // Former, the open command directly returned a XResultSet. - aCursorAny >>= aResult; - - OSL_ENSURE( !aResult.is(), - "Content::createCursor - open-Command must " - "return a Reference< XDynnamicResultSet >!" ); - } - - return aResult; -} - //========================================================================= Reference< XDynamicResultSet > Content::createDynamicCursor( const Sequence< rtl::OUString >& rPropertyNames, @@ -1004,76 +880,6 @@ Reference< XDynamicResultSet > Content::createDynamicCursor( return aResult; } -//========================================================================= -Reference< XDynamicResultSet > Content::createSortedDynamicCursor( - const Sequence< rtl::OUString >& rPropertyNames, - const Sequence< NumberedSortingInfo >& rSortInfo, - Reference< XAnyCompareFactory > rAnyCompareFactory, - ResultSetInclude eMode ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Reference< XDynamicResultSet > aResult; - Reference< XDynamicResultSet > aOrigCursor = createDynamicCursor( rPropertyNames, eMode ); - - if( aOrigCursor.is() ) - { - Reference< XMultiServiceFactory > aServiceManager = m_xImpl->getServiceManager(); - - if( aServiceManager.is() ) - { - Reference< XSortedDynamicResultSetFactory > aSortFactory( aServiceManager->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory"))), - UNO_QUERY ); - - aResult = aSortFactory->createSortedDynamicResultSet( aOrigCursor, - rSortInfo, - rAnyCompareFactory ); - } - - OSL_ENSURE( aResult.is(), "Content::createSortedDynamicCursor - no sorted cursor!\n" ); - - if( !aResult.is() ) - aResult = aOrigCursor; - } - - return aResult; -} - -//========================================================================= -Reference< XDynamicResultSet > Content::createSortedDynamicCursor( - const Sequence< sal_Int32 >& rPropertyHandles, - const Sequence< NumberedSortingInfo >& rSortInfo, - Reference< XAnyCompareFactory > rAnyCompareFactory, - ResultSetInclude eMode ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Reference< XDynamicResultSet > aResult; - Reference< XDynamicResultSet > aOrigCursor = createDynamicCursor( rPropertyHandles, eMode ); - - if( aOrigCursor.is() ) - { - Reference< XMultiServiceFactory > aServiceManager = m_xImpl->getServiceManager(); - - if( aServiceManager.is() ) - { - Reference< XSortedDynamicResultSetFactory > aSortFactory( aServiceManager->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory"))), - UNO_QUERY ); - - aResult = aSortFactory->createSortedDynamicResultSet( aOrigCursor, - rSortInfo, - rAnyCompareFactory ); - } - - OSL_ENSURE( aResult.is(), "Content::createSortedDynamicCursor - no sorted cursor!\n" ); - - if( !aResult.is() ) - aResult = aOrigCursor; - } - - return aResult; -} - //========================================================================= Reference< XResultSet > Content::createSortedCursor( const Sequence< rtl::OUString >& rPropertyNames, @@ -1128,60 +934,6 @@ Reference< XResultSet > Content::createSortedCursor( return aResult; } -//========================================================================= -Reference< XResultSet > Content::createSortedCursor( - const Sequence< sal_Int32 >& rPropertyHandles, - const Sequence< NumberedSortingInfo >& rSortInfo, - Reference< XAnyCompareFactory > rAnyCompareFactory, - ResultSetInclude eMode ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - Reference< XResultSet > aResult; - Reference< XDynamicResultSet > aDynSet; - - Any aCursorAny = createCursorAny( rPropertyHandles, eMode ); - - aCursorAny >>= aDynSet; - - if( aDynSet.is() ) - { - Reference< XDynamicResultSet > aDynResult; - Reference< XMultiServiceFactory > aServiceManager = m_xImpl->getServiceManager(); - - if( aServiceManager.is() ) - { - Reference< XSortedDynamicResultSetFactory > aSortFactory( aServiceManager->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory"))), - UNO_QUERY ); - - aDynResult = aSortFactory->createSortedDynamicResultSet( aDynSet, - rSortInfo, - rAnyCompareFactory ); - } - - OSL_ENSURE( aDynResult.is(), "Content::createSortedCursor - no sorted cursor!\n" ); - - if( aDynResult.is() ) - aResult = aDynResult->getStaticResultSet(); - else - aResult = aDynSet->getStaticResultSet(); - } - - OSL_ENSURE( aResult.is(), "Content::createSortedCursor - no cursor!" ); - - if ( !aResult.is() ) - { - // Former, the open command directly returned a XResultSet. - aCursorAny >>= aResult; - - OSL_ENSURE( !aResult.is(), - "Content::createCursor - open-Command must " - "return a Reference< XDynnamicResultSet >!" ); - } - - return aResult; -} - //========================================================================= Reference< XInputStream > Content::openStream() throw( CommandAbortedException, RuntimeException, Exception ) @@ -1382,21 +1134,6 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, rNewContent ); } -//========================================================================= -sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, - const Sequence< sal_Int32 >& - nPropertyHandles, - const Sequence< Any >& rPropertyValues, - Content& rNewContent ) - throw( CommandAbortedException, RuntimeException, Exception ) -{ - return insertNewContent( rContentType, - nPropertyHandles, - rPropertyValues, - new EmptyInputStream, - rNewContent ); -} - //========================================================================= sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< rtl::OUString >& @@ -1870,21 +1607,6 @@ Any Content_Impl::executeCommand( const Command& rCommand ) return xProc->execute( rCommand, getCommandId(), m_xEnv ); } -//========================================================================= -void Content_Impl::abortCommand() -{ - sal_Int32 nCommandId; - Reference< XCommandProcessor > xCommandProcessor; - { - osl::MutexGuard aGuard( m_aMutex ); - nCommandId = m_nCommandId; - xCommandProcessor = m_xCommandProcessor; - } - - if ( ( nCommandId != 0 ) && xCommandProcessor.is() ) - xCommandProcessor->abort( nCommandId ); -} - //========================================================================= inline const Reference< XCommandEnvironment >& Content_Impl::getEnvironment() const diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx index 8eb455ca0aeb..36669b0b1fd0 100644 --- a/ucbhelper/source/client/contentbroker.cxx +++ b/ucbhelper/source/client/contentbroker.cxx @@ -204,34 +204,6 @@ sal_Bool ContentBroker::initialize( return m_pTheBroker != 0; } -//========================================================================= -// static -sal_Bool ContentBroker::initialize( - const Reference< XMultiServiceFactory >& rSMgr, - const ContentProviderDataList & rData ) -{ - OSL_ENSURE( !m_pTheBroker, - "ContentBroker::initialize - already initialized!" ); - - if ( !m_pTheBroker ) - { - osl::Guard< osl::Mutex > aGuard( getGlobalContentBrokerMutex() ); - - if ( !m_pTheBroker ) - { - ContentBroker * pBroker = new ContentBroker( rSMgr, rData ); - - // Force init to be able to detect UCB init trouble immediately. - if ( pBroker->m_pImpl->initialize() ) - m_pTheBroker = pBroker; - else - delete pBroker; - } - } - - return m_pTheBroker != 0; -} - //========================================================================= // static void ContentBroker::deinitialize() diff --git a/ucbhelper/source/provider/commandenvironmentproxy.cxx b/ucbhelper/source/provider/commandenvironmentproxy.cxx deleted file mode 100644 index 7e3f10047812..000000000000 --- a/ucbhelper/source/provider/commandenvironmentproxy.cxx +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucbhelper.hxx" - -/************************************************************************** - TODO - ************************************************************************** - - *************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -using namespace com::sun::star::lang; -using namespace com::sun::star::task; -using namespace com::sun::star::ucb; -using namespace com::sun::star::uno; - -namespace ucbhelper -{ - -//========================================================================= -//========================================================================= -// -// struct CommandEnvironmentProxy_Impl. -// -//========================================================================= -//========================================================================= - -struct CommandEnvironmentProxy_Impl -{ - osl::Mutex m_aMutex; - Reference< XCommandEnvironment > m_xEnv; - Reference< XInteractionHandler > m_xInteractionHandler; - Reference< XProgressHandler > m_xProgressHandler; - sal_Bool m_bGotInteractionHandler; - sal_Bool m_bGotProgressHandler; - - CommandEnvironmentProxy_Impl( - const Reference< XCommandEnvironment >& rxEnv ) - : m_xEnv( rxEnv ), m_bGotInteractionHandler( sal_False ), - m_bGotProgressHandler( sal_False ) {} -}; - -//========================================================================= -//========================================================================= -// -// CommandEnvironmentProxy Implementation. -// -//========================================================================= -//========================================================================= - -CommandEnvironmentProxy::CommandEnvironmentProxy( - const Reference< XCommandEnvironment >& rxEnv ) -{ - m_pImpl = new CommandEnvironmentProxy_Impl( rxEnv ); -} - -//========================================================================= -// virtual -CommandEnvironmentProxy::~CommandEnvironmentProxy() -{ - delete m_pImpl; -} - -//========================================================================= -// -// XInterface methods -// -//========================================================================= - -XINTERFACE_IMPL_2( CommandEnvironmentProxy, - XTypeProvider, - XCommandEnvironment ); - -//========================================================================= -// -// XTypeProvider methods -// -//========================================================================= - -XTYPEPROVIDER_IMPL_2( CommandEnvironmentProxy, - XTypeProvider, - XCommandEnvironment ); - -//========================================================================= -// -// XCommandEnvironemnt methods. -// -//========================================================================= - -// virtual -Reference< XInteractionHandler > SAL_CALL -CommandEnvironmentProxy::getInteractionHandler() - throw ( RuntimeException ) -{ - if ( m_pImpl->m_xEnv.is() ) - { - if ( !m_pImpl->m_bGotInteractionHandler ) - { - osl::MutexGuard aGuard( m_pImpl->m_aMutex ); - if ( !m_pImpl->m_bGotInteractionHandler ) - { - m_pImpl->m_xInteractionHandler - = m_pImpl->m_xEnv->getInteractionHandler(); - m_pImpl->m_bGotInteractionHandler = sal_True; - } - } - } - return m_pImpl->m_xInteractionHandler; -} - -//========================================================================= -// virtual -Reference< XProgressHandler > SAL_CALL -CommandEnvironmentProxy::getProgressHandler() - throw ( RuntimeException ) -{ - if ( m_pImpl->m_xEnv.is() ) - { - if ( !m_pImpl->m_bGotProgressHandler ) - { - osl::MutexGuard aGuard( m_pImpl->m_aMutex ); - if ( !m_pImpl->m_bGotProgressHandler ) - { - m_pImpl->m_xProgressHandler - = m_pImpl->m_xEnv->getProgressHandler(); - m_pImpl->m_bGotProgressHandler = sal_True; - } - } - } - return m_pImpl->m_xProgressHandler; -} - -} /* namespace ucbhelper */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx index 6a5073750b9a..ecc7ad24d1f9 100644 --- a/ucbhelper/source/provider/contenthelper.cxx +++ b/ucbhelper/source/provider/contenthelper.cxx @@ -953,26 +953,6 @@ void ContentImplHelper::notifyPropertySetInfoChange( } } -//========================================================================= -void ContentImplHelper::notifyCommandInfoChange( - const com::sun::star::ucb::CommandInfoChangeEvent& evt ) const -{ - if ( !m_pImpl->m_pCommandChangeListeners ) - return; - - // Notify event listeners. - cppu::OInterfaceIteratorHelper aIter( - *m_pImpl->m_pCommandChangeListeners ); - while ( aIter.hasMoreElements() ) - { - // Propagate event. - uno::Reference< com::sun::star::ucb::XCommandInfoChangeListener > - xListener( aIter.next(), uno::UNO_QUERY ); - if ( xListener.is() ) - xListener->commandInfoChange( evt ); - } -} - //========================================================================= void ContentImplHelper::notifyContentEvent( const com::sun::star::ucb::ContentEvent& evt ) const diff --git a/ucbhelper/source/provider/handleinteractionrequest.cxx b/ucbhelper/source/provider/handleinteractionrequest.cxx deleted file mode 100644 index 84a010fde6d9..000000000000 --- a/ucbhelper/source/provider/handleinteractionrequest.cxx +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucbhelper.hxx" -#include "ucbhelper/handleinteractionrequest.hxx" -#include "com/sun/star/task/XInteractionAbort.hpp" -#include "com/sun/star/task/XInteractionHandler.hpp" -#include "com/sun/star/task/XInteractionRetry.hpp" -#include "com/sun/star/ucb/CommandFailedException.hpp" -#include "com/sun/star/ucb/XCommandEnvironment.hpp" -#include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" -#include "cppuhelper/exc_hlp.hxx" -#include "osl/diagnose.h" -#include "rtl/ustring.hxx" -#include "ucbhelper/interactionrequest.hxx" -#include "ucbhelper/simpleauthenticationrequest.hxx" -#include "ucbhelper/simpleinteractionrequest.hxx" -#include "ucbhelper/simplecertificatevalidationrequest.hxx" -#ifndef INCLUDED_UTILITY -#include -#define INCLUDED_UTILITY -#endif - -using namespace com::sun::star; - -namespace { - -void -handle(uno::Reference< task::XInteractionRequest > const & rRequest, - uno::Reference< ucb::XCommandEnvironment > const & rEnvironment) - SAL_THROW((uno::Exception)) -{ - OSL_ENSURE(rRequest.is(), "specification violation"); - uno::Reference< task::XInteractionHandler > xHandler; - if (rEnvironment.is()) - xHandler = rEnvironment->getInteractionHandler(); - if (!xHandler.is()) - cppu::throwException(rRequest->getRequest()); - xHandler->handle(rRequest.get()); -} - -} - -namespace ucbhelper { - -sal_Int32 -handleInteractionRequest( - rtl::Reference< ucbhelper::SimpleInteractionRequest > const & rRequest, - uno::Reference< ucb::XCommandEnvironment > const & rEnvironment, - bool bThrowOnAbort) - SAL_THROW((uno::Exception)) -{ - handle(rRequest.get(), rEnvironment); - sal_Int32 nResponse = rRequest->getResponse(); - switch (nResponse) - { - case ucbhelper::CONTINUATION_UNKNOWN: - cppu::throwException(rRequest->getRequest()); - break; - - case ucbhelper::CONTINUATION_ABORT: - if (bThrowOnAbort) - throw ucb::CommandFailedException( - rtl::OUString(), 0, rRequest->getRequest()); - break; - } - return nResponse; -} - -std::pair< sal_Int32, - rtl::Reference< ucbhelper::InteractionSupplyAuthentication > > -handleInteractionRequest( - rtl::Reference< ucbhelper::SimpleAuthenticationRequest > const & rRequest, - uno::Reference< ucb::XCommandEnvironment > const & rEnvironment, - bool bThrowOnAbort) - SAL_THROW((uno::Exception)) -{ - handle(rRequest.get(), rEnvironment); - rtl::Reference< ucbhelper::InteractionContinuation > - xContinuation(rRequest->getSelection()); - if (uno::Reference< task::XInteractionAbort >( - xContinuation.get(), uno::UNO_QUERY). - is()) - if (bThrowOnAbort) - throw ucb::CommandFailedException( - rtl::OUString(), 0, rRequest->getRequest()); - else - return std::make_pair( - ucbhelper::CONTINUATION_ABORT, - rtl::Reference< - ucbhelper::InteractionSupplyAuthentication >()); - else if (uno::Reference< task::XInteractionRetry >( - xContinuation.get(), uno::UNO_QUERY). - is()) - return std::make_pair( - ucbhelper::CONTINUATION_ABORT, - rtl::Reference< - ucbhelper::InteractionSupplyAuthentication >()); - else - return std::make_pair( - ucbhelper::CONTINUATION_UNKNOWN, - rtl::Reference< - ucbhelper::InteractionSupplyAuthentication >( - rRequest->getAuthenticationSupplier())); -} - -} - -namespace ucbhelper { - -sal_Int32 -handleInteractionRequest( - rtl::Reference< ucbhelper::SimpleCertificateValidationRequest > const & rRequest, - uno::Reference< ucb::XCommandEnvironment > const & rEnvironment, - bool bThrowOnAbort) - SAL_THROW((uno::Exception)) -{ - handle(rRequest.get(), rEnvironment); - sal_Int32 nResponse = rRequest->getResponse(); - switch (nResponse) - { - case ucbhelper::CONTINUATION_UNKNOWN: - cppu::throwException(rRequest->getRequest()); - break; - - case ucbhelper::CONTINUATION_ABORT: - if (bThrowOnAbort) - throw ucb::CommandFailedException( - rtl::OUString(), 0, rRequest->getRequest()); - break; - } - return nResponse; -} - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index 361a8fd514af..799a7575c52a 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -277,30 +277,6 @@ PropertyValueSet::PropertyValueSet( { } -//========================================================================= -PropertyValueSet::PropertyValueSet( - const Reference< XMultiServiceFactory >& rxSMgr, - const Sequence< com::sun::star::beans::PropertyValue >& rValues ) -: PROPERTYVALUESET_INIT() -{ - sal_Int32 nCount = rValues.getLength(); - if ( nCount ) - { - const com::sun::star::beans::PropertyValue* pValues - = rValues.getConstArray(); - - for ( sal_Int32 n = 0; n < nCount; ++n ) - { - const com::sun::star::beans::PropertyValue& rValue = pValues[ n ]; - appendObject( Property( rValue.Name, - rValue.Handle, - rValue.Value.getValueType(), - 0 ), - rValue.Value ); - } - } -} - //========================================================================= // virtual PropertyValueSet::~PropertyValueSet() @@ -676,12 +652,6 @@ const Reference< XTypeConverter >& PropertyValueSet::getTypeConverter() return m_xTypeConverter; } -//========================================================================= -sal_Int32 PropertyValueSet::getLength() const -{ - return m_pValues->size(); -} - //========================================================================= void PropertyValueSet::appendString( const ::rtl::OUString& rPropName, const OUString& rValue ) @@ -696,27 +666,6 @@ void PropertyValueSet::appendBoolean( const ::rtl::OUString& rPropName, SETVALUE_IMPL( rPropName, BOOLEAN_VALUE_SET, bBoolean, bValue ); } -//========================================================================= -void PropertyValueSet::appendByte( const ::rtl::OUString& rPropName, - sal_Int8 nValue ) -{ - SETVALUE_IMPL( rPropName, BYTE_VALUE_SET, nByte, nValue ); -} - -//========================================================================= -void PropertyValueSet::appendShort( const ::rtl::OUString& rPropName, - sal_Int16 nValue ) -{ - SETVALUE_IMPL( rPropName, SHORT_VALUE_SET, nShort, nValue ); -} - -//========================================================================= -void PropertyValueSet::appendInt( const ::rtl::OUString& rPropName, - sal_Int32 nValue ) -{ - SETVALUE_IMPL( rPropName, INT_VALUE_SET, nInt, nValue ); -} - //========================================================================= void PropertyValueSet::appendLong( const ::rtl::OUString& rPropName, sal_Int64 nValue ) @@ -724,41 +673,6 @@ void PropertyValueSet::appendLong( const ::rtl::OUString& rPropName, SETVALUE_IMPL( rPropName, LONG_VALUE_SET, nLong, nValue ); } -//========================================================================= -void PropertyValueSet::appendFloat( const ::rtl::OUString& rPropName, - float nValue ) -{ - SETVALUE_IMPL( rPropName, FLOAT_VALUE_SET, nFloat, nValue ); -} - -//========================================================================= -void PropertyValueSet::appendDouble( const ::rtl::OUString& rPropName, - double nValue ) -{ - SETVALUE_IMPL( rPropName, DOUBLE_VALUE_SET, nDouble, nValue ); -} - -//========================================================================= -void PropertyValueSet::appendBytes( const ::rtl::OUString& rPropName, - const Sequence< sal_Int8 >& rValue ) -{ - SETVALUE_IMPL( rPropName, BYTES_VALUE_SET, aBytes, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendDate( const ::rtl::OUString& rPropName, - const Date& rValue ) -{ - SETVALUE_IMPL( rPropName, DATE_VALUE_SET, aDate, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendTime( const ::rtl::OUString& rPropName, - const Time& rValue ) -{ - SETVALUE_IMPL( rPropName, TIME_VALUE_SET, aTime, rValue ); -} - //========================================================================= void PropertyValueSet::appendTimestamp( const ::rtl::OUString& rPropName, const DateTime& rValue ) @@ -766,22 +680,6 @@ void PropertyValueSet::appendTimestamp( const ::rtl::OUString& rPropName, SETVALUE_IMPL( rPropName, TIMESTAMP_VALUE_SET, aTimestamp, rValue ); } -//========================================================================= -void PropertyValueSet::appendBinaryStream( - const ::rtl::OUString& rPropName, - const Reference< XInputStream >& rValue ) -{ - SETVALUE_IMPL( rPropName, BINARYSTREAM_VALUE_SET, xBinaryStream, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendCharacterStream( - const ::rtl::OUString& rPropName, - const Reference< XInputStream >& rValue ) -{ - SETVALUE_IMPL( rPropName, CHARACTERSTREAM_VALUE_SET, xCharacterStream, rValue ); -} - //========================================================================= void PropertyValueSet::appendObject( const ::rtl::OUString& rPropName, const Any& rValue ) @@ -789,34 +687,6 @@ void PropertyValueSet::appendObject( const ::rtl::OUString& rPropName, SETVALUE_IMPL( rPropName, OBJECT_VALUE_SET, aObject, rValue ); } -//========================================================================= -void PropertyValueSet::appendRef( const ::rtl::OUString& rPropName, - const Reference< XRef >& rValue ) -{ - SETVALUE_IMPL( rPropName, REF_VALUE_SET, xRef, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendBlob( const ::rtl::OUString& rPropName, - const Reference< XBlob >& rValue ) -{ - SETVALUE_IMPL( rPropName, BLOB_VALUE_SET, xBlob, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendClob( const ::rtl::OUString& rPropName, - const Reference< XClob >& rValue ) -{ - SETVALUE_IMPL( rPropName, CLOB_VALUE_SET, xClob, rValue ); -} - -//========================================================================= -void PropertyValueSet::appendArray( const ::rtl::OUString& rPropName, - const Reference< XArray >& rValue ) -{ - SETVALUE_IMPL( rPropName, ARRAY_VALUE_SET, xArray, rValue ); -} - //========================================================================= void PropertyValueSet::appendVoid( const ::rtl::OUString& rPropName ) { diff --git a/ucbhelper/source/provider/resultsethelper.cxx b/ucbhelper/source/provider/resultsethelper.cxx index ac6798e7450e..e600977d2e64 100644 --- a/ucbhelper/source/provider/resultsethelper.cxx +++ b/ucbhelper/source/provider/resultsethelper.cxx @@ -58,16 +58,6 @@ using namespace com::sun::star; namespace ucbhelper { -//========================================================================= -ResultSetImplHelper::ResultSetImplHelper( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr ) -: m_pDisposeEventListeners( 0 ), - m_bStatic( sal_False ), - m_bInitDone( sal_False ), - m_xSMgr( rxSMgr ) -{ -} - //========================================================================= ResultSetImplHelper::ResultSetImplHelper( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx index c4ac91cb5789..86f1a5334ab3 100644 --- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx +++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx @@ -35,42 +35,6 @@ using namespace com::sun::star; using namespace ucbhelper; -//========================================================================= -SimpleAuthenticationRequest::SimpleAuthenticationRequest( - const rtl::OUString & rURL, - const rtl::OUString & rServerName, - const rtl::OUString & rRealm, - const rtl::OUString & rUserName, - const rtl::OUString & rPassword, - const rtl::OUString & rAccount ) -{ - // Fill request... - ucb::URLAuthenticationRequest aRequest; -// aRequest.Message = // OUString -// aRequest.Context = // XInterface - aRequest.Classification = task::InteractionClassification_ERROR; - aRequest.ServerName = rServerName; -// aRequest.Diagnostic = // OUString - aRequest.HasRealm = ( rRealm.getLength() > 0 ); - if ( aRequest.HasRealm ) - aRequest.Realm = rRealm; - aRequest.HasUserName = sal_True; - aRequest.UserName = rUserName; - aRequest.HasPassword = sal_True; - aRequest.Password = rPassword; - aRequest.HasAccount = ( rAccount.getLength() > 0 ); - if ( aRequest.HasAccount ) - aRequest.Account = rAccount; - aRequest.URL = rURL; - - initialize(aRequest, - sal_False, - sal_True, - sal_True, - aRequest.HasAccount, - sal_True, - sal_False ); -} //========================================================================= SimpleAuthenticationRequest::SimpleAuthenticationRequest( const rtl::OUString & rURL, @@ -154,51 +118,6 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( sal_False ); } -//========================================================================= -SimpleAuthenticationRequest::SimpleAuthenticationRequest( - const rtl::OUString & rURL, - const rtl::OUString & rServerName, - EntityType eRealmType, - const rtl::OUString & rRealm, - EntityType eUserNameType, - const rtl::OUString & rUserName, - EntityType ePasswordType, - const rtl::OUString & rPassword, - EntityType eAccountType, - const rtl::OUString & rAccount, - sal_Bool bAllowPersistentStoring, - sal_Bool bAllowUseSystemCredentials ) -{ - // Fill request... - ucb::URLAuthenticationRequest aRequest; -// aRequest.Message = // OUString -// aRequest.Context = // XInterface - aRequest.Classification = task::InteractionClassification_ERROR; - aRequest.ServerName = rServerName; -// aRequest.Diagnostic = // OUString - aRequest.HasRealm = eRealmType != ENTITY_NA; - if ( aRequest.HasRealm ) - aRequest.Realm = rRealm; - aRequest.HasUserName = eUserNameType != ENTITY_NA; - if ( aRequest.HasUserName ) - aRequest.UserName = rUserName; - aRequest.HasPassword = ePasswordType != ENTITY_NA; - if ( aRequest.HasPassword ) - aRequest.Password = rPassword; - aRequest.HasAccount = eAccountType != ENTITY_NA; - if ( aRequest.HasAccount ) - aRequest.Account = rAccount; - aRequest.URL = rURL; - - initialize(aRequest, - eRealmType == ENTITY_MODIFY, - eUserNameType == ENTITY_MODIFY, - ePasswordType == ENTITY_MODIFY, - eAccountType == ENTITY_MODIFY, - bAllowPersistentStoring, - bAllowUseSystemCredentials ); -} - //========================================================================= void SimpleAuthenticationRequest::initialize( const ucb::URLAuthenticationRequest & rRequest, -- cgit