diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-05-29 16:30:01 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-06-04 13:28:12 +0200 |
commit | c77437672a57f53d776ae8161afeffd606cc9893 (patch) | |
tree | 95a92d34cb29de15a04c0f53dac78811c1c15686 /ucb/source | |
parent | 6f34fd25cbd8d9ed43ae9c2b074f7c6fa6968b31 (diff) |
CMIS UCP: Implemented delete command for documents
Change-Id: I34c90f4675e461f461bad7e81c23da56463f0a24
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 28 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.hxx | 2 |
2 files changed, 20 insertions, 10 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 138eb36110f6..daf16f79ff54 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -514,12 +514,6 @@ namespace cmis } } - void Content::destroy( sal_Bool /*bDeletePhysical*/ ) throw ( uno::Exception ) - { - SAL_INFO( "cmisucp", "TODO - Content::destroy()" ); - // TODO Implement me - } - const int TRANSFER_BUFFER_SIZE = 65536; void Content::copyData( @@ -849,9 +843,25 @@ namespace cmis } else if ( aCommand.Name == "delete" ) { - sal_Bool bDeletePhysical = sal_False; - aCommand.Argument >>= bDeletePhysical; - destroy( bDeletePhysical ); + try + { + if ( !isFolder( xEnv ) ) + { + getObject( )->remove( ); + } + else + { + // TODO Removing a folder and its children needs removeTree in libcmis + // the remove() function only works for empty folders or documents + } + } + catch ( const libcmis::Exception& e ) + { + ucbhelper::cancelCommandExecution( uno::makeAny + ( uno::RuntimeException( rtl::OUString::createFromAscii( e.what() ), + static_cast< cppu::OWeakObject * >( this ) ) ), + xEnv ); + } } else { diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx index dfe8cc2fb8fd..eafd5039503a 100644 --- a/ucb/source/ucp/cmis/cmis_content.hxx +++ b/ucb/source/ucp/cmis/cmis_content.hxx @@ -110,7 +110,7 @@ private: sal_Bool bReplaceExisting, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( com::sun::star::uno::Exception ); - void destroy( sal_Bool bDeletePhysical ) throw( com::sun::star::uno::Exception ); + void destroy( ) throw( com::sun::star::uno::Exception ); void copyData( com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xIn, com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOut ); |