summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-09-06 07:43:14 +0000
committerAndreas Bille <abi@openoffice.org>2001-09-06 07:43:14 +0000
commit002c5d089d2c5582d28d21187c300817475ab166 (patch)
tree6e9a10c82a3f20d0cd63ee2ce45673f0d2849508 /ucb
parentfe9a801b7542d678746550d4ccb29a918e6f3635 (diff)
#90677#
Now internally incrementing CommandId if equals zero. startTask throws now a CommandFailedException, not a CommandAbortedException if a CommandId is commited more than one.
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/file/bc.cxx8
-rw-r--r--ucb/source/ucp/file/filtask.cxx23
-rw-r--r--ucb/source/ucp/file/filtask.hxx10
3 files changed, 24 insertions, 17 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index ca83fd11c2f5..b204c051d7d3 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bc.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: sb $ $Date: 2001-08-07 13:35:48 $
+ * last change: $Author: abi $ $Date: 2001-09-06 08:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -391,6 +391,10 @@ BaseContent::execute( const Command& aCommand,
CommandAbortedException,
RuntimeException )
{
+ if( ! CommandId )
+ // A Command with commandid zero cannot be aborted
+ CommandId = createCommandIdentifier();
+
m_pMyShell->startTask( CommandId,
Environment );
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 38608a2542af..f0a4627521df 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filtask.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: sb $ $Date: 2001-08-07 13:37:40 $
+ * last change: $Author: abi $ $Date: 2001-09-06 08:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,13 +96,13 @@ void SAL_CALL
TaskManager::startTask(
sal_Int32 CommandId,
const uno::Reference< XCommandEnvironment >& xCommandEnv )
- throw( CommandAbortedException )
+ throw( CommandFailedException )
{
vos::OGuard aGuard( m_aMutex );
TaskMap::iterator it = m_aTaskMap.find( CommandId );
if( it != m_aTaskMap.end() )
{
- throw CommandAbortedException();
+ throw CommandFailedException();
}
m_aTaskMap[ CommandId ] = TaskHandling( xCommandEnv );
}
@@ -134,12 +134,15 @@ TaskManager::endTask( shell * pShell,
void SAL_CALL
TaskManager::abort( sal_Int32 CommandId )
{
- vos::OGuard aGuard( m_aMutex );
- TaskMap::iterator it = m_aTaskMap.find( CommandId );
- if( it == m_aTaskMap.end() )
- return;
- else
- it->second.abort();
+ if( CommandId )
+ {
+ vos::OGuard aGuard( m_aMutex );
+ TaskMap::iterator it = m_aTaskMap.find( CommandId );
+ if( it == m_aTaskMap.end() )
+ return;
+ else
+ it->second.abort();
+ }
}
diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx
index fffb76afc5b2..cb708c58145a 100644
--- a/ucb/source/ucp/file/filtask.hxx
+++ b/ucb/source/ucp/file/filtask.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filtask.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: sb $ $Date: 2001-08-07 13:37:40 $
+ * last change: $Author: abi $ $Date: 2001-09-06 08:43:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,8 +72,8 @@
#ifndef _VOS_MUTEX_HXX_
#include <vos/mutex.hxx>
#endif
-#ifndef _COM_SUN_STAR_UCB_COMMANDABORTEDEXCEPTION_HPP_
-#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#ifndef _COM_SUN_STAR_UCB_COMMANDFAILEDEXCEPTION_HPP_
+#include <com/sun/star/ucb/CommandFailedException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
@@ -205,7 +205,7 @@ namespace fileaccess
void SAL_CALL startTask(
sal_Int32 CommandId,
const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xCommandEnv )
- throw( com::sun::star::ucb::CommandAbortedException );
+ throw( com::sun::star::ucb::CommandFailedException );
sal_Int32 SAL_CALL getCommandId( void );
void SAL_CALL abort( sal_Int32 CommandId );