Kaydet (Commit) 88dde756 authored tarafından Noel Grandin's avatar Noel Grandin

Revert "cancelCommandExecution - no need to pass exception by Any"

This reverts commit 4739b31d.

Apparently, passing a param of type css::uno::Exception to Any
will record precisely a css::uno::Exception in that Any, losing
any subtype information, which this commit changed.
üst 52885c7b
......@@ -165,10 +165,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -183,10 +183,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -195,10 +195,10 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
{
OSL_FAIL( "No properties!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -221,9 +221,9 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
OSL_FAIL( "Content::execute - unsupported command!" );
ucbhelper::cancelCommandExecution(
UnsupportedCommandException(
makeAny( UnsupportedCommandException(
OUString(),
static_cast< cppu::OWeakObject * >( this ) ),
static_cast< cppu::OWeakObject * >( this ) ) ),
Environment );
// Unreachable
}
......
......@@ -402,10 +402,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -429,10 +429,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
{
// Unsupported.
ucbhelper::cancelCommandExecution(
UnsupportedOpenModeException(
makeAny( UnsupportedOpenModeException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
sal_Int16( aOpenCommand.Mode ) ),
sal_Int16( aOpenCommand.Mode ) ) ),
Environment );
// Unreachable
}
......@@ -446,10 +446,10 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......
......@@ -883,10 +883,10 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
{
// not supported
ucbhelper::cancelCommandExecution(
UnsupportedOpenModeException(
makeAny( UnsupportedOpenModeException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
sal_Int16( nOpenMode ) ),
sal_Int16( nOpenMode ) ) ),
_rxEnvironment );
// Unreachable
OSL_FAIL( "unreachable" );
......@@ -1018,10 +1018,10 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -1044,10 +1044,10 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
OSL_FAIL( "Wrong argument count!" );
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -1161,10 +1161,10 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc
Sequence<OUString> aProps { PROPERTY_URL };
ucbhelper::cancelCommandExecution(
MissingPropertiesException(
makeAny( MissingPropertiesException(
OUString(),
static_cast< cppu::OWeakObject * >( this ),
aProps ),
aProps ) ),
Environment );
// Unreachable
}
......
......@@ -53,7 +53,7 @@ namespace ucbhelper
@throws css::uno::Exception
*/
UCBHELPER_DLLPUBLIC void cancelCommandExecution( const css::uno::Exception & rException,
UCBHELPER_DLLPUBLIC void cancelCommandExecution( const css::uno::Any & rException,
const css::uno::Reference<
css::ucb::XCommandEnvironment > &
xEnv );
......
......@@ -637,10 +637,10 @@ Any SAL_CALL UniversalContentBroker::execute(
if ( !( aCommand.Argument >>= aArg ) )
{
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
"Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -661,10 +661,10 @@ Any SAL_CALL UniversalContentBroker::execute(
if ( !( aCommand.Argument >>= aCheckinArg ) )
{
ucbhelper::cancelCommandExecution(
IllegalArgumentException(
makeAny( IllegalArgumentException(
"Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ),
-1 ) ),
Environment );
// Unreachable
}
......@@ -677,9 +677,9 @@ Any SAL_CALL UniversalContentBroker::execute(
ucbhelper::cancelCommandExecution(
UnsupportedCommandException(
makeAny( UnsupportedCommandException(
OUString(),
static_cast< cppu::OWeakObject * >( this ) ),
static_cast< cppu::OWeakObject * >( this ) ) ),
Environment );
// Unreachable
}
......
......@@ -640,10 +640,10 @@ uno::Reference< ucb::XContent > createNew(
else
{
ucbhelper::cancelCommandExecution(
lang::IllegalArgumentException(
uno::makeAny( lang::IllegalArgumentException(
"Unknown transfer operation!",
rContext.xProcessor,
-1 ),
-1 ) ),
rContext.xOrigEnv );
// Unreachable
}
......@@ -1027,9 +1027,9 @@ void handleNameClashRename(
if ( aOldTitle.isEmpty() )
{
ucbhelper::cancelCommandExecution(
beans::UnknownPropertyException(
uno::makeAny( beans::UnknownPropertyException(
"Unable to get property 'Title' from new object!",
rContext.xProcessor ),
rContext.xProcessor ) ),
rContext.xOrigEnv );
// Unreachable
}
......@@ -1141,10 +1141,11 @@ void handleNameClashRename(
if ( nTry == 50 )
{
ucbhelper::cancelCommandExecution(
uno::makeAny(
ucb::UnsupportedNameClashException(
"Unable to resolve name clash!",
rContext.xProcessor,
ucb::NameClash::RENAME ),
ucb::NameClash::RENAME ) ),
rContext.xOrigEnv );
// Unreachable
}
......@@ -1162,9 +1163,9 @@ void globalTransfer_(
if ( !bSourceIsFolder && xSourceProps->wasNull() )
{
ucbhelper::cancelCommandExecution(
beans::UnknownPropertyException(
uno::makeAny( beans::UnknownPropertyException(
"Unable to get property 'IsFolder' from source object!",
rContext.xProcessor ),
rContext.xProcessor ) ),
rContext.xOrigEnv );
// Unreachable
}
......@@ -1174,9 +1175,9 @@ void globalTransfer_(
if ( !bSourceIsDocument && xSourceProps->wasNull() )
{
ucbhelper::cancelCommandExecution(
beans::UnknownPropertyException(
uno::makeAny( beans::UnknownPropertyException(
"Unable to get property 'IsDocument' from source object!",
rContext.xProcessor ),
rContext.xProcessor ) ),
rContext.xOrigEnv );
// Unreachable
}
......@@ -1360,11 +1361,12 @@ void globalTransfer_(
case ucb::NameClash::OVERWRITE:
{
ucbhelper::cancelCommandExecution(
uno::makeAny(
ucb::UnsupportedNameClashException(
"BUG: insert + replace == true MUST NOT "
"throw NameClashException.",
rContext.xProcessor,
rContext.aArg.NameClash ),
rContext.aArg.NameClash ) ),
rContext.xOrigEnv );
SAL_FALLTHROUGH; // Unreachable
}
......@@ -1455,11 +1457,12 @@ void globalTransfer_(
default:
{
ucbhelper::cancelCommandExecution(
uno::makeAny(
ucb::UnsupportedNameClashException(