summaryrefslogtreecommitdiff
path: root/ucb/source/core/ucb.cxx
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2001-06-25 07:51:54 +0000
committerKai Sommerfeld <kso@openoffice.org>2001-06-25 07:51:54 +0000
commit3364060dbbbc9e64ed435350ed6da1a07a92e93a (patch)
tree59d7c0b2ffa362e88f1be8345f03324168adadf1 /ucb/source/core/ucb.cxx
parent1f3190e5b6d1fc02445df2f071244a890e89d89c (diff)
#87187# - New error handling.
Diffstat (limited to 'ucb/source/core/ucb.cxx')
-rw-r--r--ucb/source/core/ucb.cxx49
1 files changed, 30 insertions, 19 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 99bdd6d4316d..80ecbb95afbf 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucb.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: kso $ $Date: 2001-04-05 09:49:55 $
+ * last change: $Author: kso $ $Date: 2001-06-25 08:50:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,12 +65,12 @@
*************************************************************************/
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
#include <cppuhelper/interfacecontainer.hxx>
#endif
-#ifndef _VOS_MUTEX_HXX_
-#include <vos/mutex.hxx>
-#endif
#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#endif
@@ -89,6 +89,9 @@
#ifndef _UCBHELPER_CONFIGUREUCB_HXX_
#include <ucbhelper/configureucb.hxx>
#endif
+#ifndef _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+#include <ucbhelper/cancelcommandexecution.hxx>
+#endif
#ifndef _IDENTIFY_HXX
#include "identify.hxx"
@@ -124,7 +127,7 @@ UniversalContentBroker::UniversalContentBroker(
m_nInitCount( 0 ), //@@@ see initialize() method
m_nCommandId( 0 )
{
- VOS_ENSURE( m_xSMgr.is(),
+ OSL_ENSURE( m_xSMgr.is(),
"UniversalContentBroker ctor: No service manager" );
}
@@ -499,7 +502,8 @@ Any SAL_CALL UniversalContentBroker::execute(
//////////////////////////////////////////////////////////////////////
if ( ( aCommand.Handle == GETCOMMANDINFO_HANDLE ) ||
- ( aCommand.Name.compareToAscii( GETCOMMANDINFO_NAME ) == 0 ) )
+ aCommand.Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( GETCOMMANDINFO_NAME ) ) )
{
//////////////////////////////////////////////////////////////////
// getCommandInfo
@@ -508,23 +512,27 @@ Any SAL_CALL UniversalContentBroker::execute(
aRet <<= getCommandInfo();
}
else if ( ( aCommand.Handle == GLOBALTRANSFER_HANDLE ) ||
- ( aCommand.Name.compareToAscii( GLOBALTRANSFER_NAME ) == 0 ) )
+ aCommand.Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(GLOBALTRANSFER_NAME ) ) )
{
//////////////////////////////////////////////////////////////////
// globalTransfer
//////////////////////////////////////////////////////////////////
GlobalTransferCommandArgument aTransferArg;
- if ( aCommand.Argument >>= aTransferArg )
+ if ( !( aCommand.Argument >>= aTransferArg ) )
{
- globalTransfer( aTransferArg, Environment );
- }
- else
- {
- VOS_ENSURE( sal_False,
- "UniversalContentBroker::execute - invalid parameter!" );
- throw CommandAbortedException();
+ ucbhelper::cancelCommandExecution(
+ makeAny( IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >( this ),
+ -1 ) ),
+ Environment );
+ // Unreachable
}
+
+ globalTransfer( aTransferArg, Environment );
}
else
{
@@ -532,9 +540,12 @@ Any SAL_CALL UniversalContentBroker::execute(
// Unknown command
//////////////////////////////////////////////////////////////////
- VOS_ENSURE( sal_False,
- "UniversalContentBroker::execute - unknown command!" );
- throw CommandAbortedException();
+ ucbhelper::cancelCommandExecution(
+ makeAny( UnsupportedCommandException(
+ rtl::OUString(),
+ static_cast< cppu::OWeakObject * >( this ) ) ),
+ Environment );
+ // Unreachable
}
return aRet;