summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2004-12-23 08:42:00 +0000
committerVladimir Glazounov <vg@openoffice.org>2004-12-23 08:42:00 +0000
commit9fa8ea7db7ebb772893e7ef3e8776aa5c7a3c1ff (patch)
tree555089fb85fd80f24c98031defcc73babec878ce /ucb
parent384c64629e63674cd937d753b8e232a7e39f5a17 (diff)
INTEGRATION: CWS kso12 (1.45.26); FILE MERGED
2004/12/02 08:43:39 kso 1.45.26.1: #i37781# - Improved commandinfo handling for non-existing resources
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx162
1 files changed, 67 insertions, 95 deletions
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 64c11d69dc17..7db6d96c2715 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: webdavcontent.cxx,v $
*
- * $Revision: 1.45 $
+ * $Revision: 1.46 $
*
- * last change: $Author: rt $ $Date: 2004-09-08 17:06:34 $
+ * last change: $Author: vg $ $Date: 2004-12-23 09:42:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,7 +58,6 @@
*
*
************************************************************************/
-
#define BUG_110335 1
/**************************************************************************
@@ -325,8 +324,6 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType )
}
catch ( uno::Exception const & )
{
- OSL_ENSURE( sal_False,
- "Content::queryInterface - caught exception." );
return uno::Any();
}
}
@@ -359,8 +356,6 @@ uno::Sequence< uno::Type > SAL_CALL Content::getTypes()
}
catch ( uno::Exception const & )
{
- OSL_ENSURE( sal_False,
- "Content::getTypes - caught exception." );
}
cppu::OTypeCollection * pCollection = 0;
@@ -480,7 +475,6 @@ rtl::OUString SAL_CALL Content::getContentType()
}
catch ( uno::Exception const & )
{
- OSL_ENSURE( sal_False, "Content::getContentType - caught exception" );
}
if ( bFolder )
@@ -977,47 +971,35 @@ uno::Sequence< star::ucb::ContentInfo > SAL_CALL
Content::queryCreatableContentsInfo()
throw( uno::RuntimeException )
{
-// if ( isFolder() )
- {
- osl::Guard< osl::Mutex > aGuard( m_aMutex );
-
- uno::Sequence< star::ucb::ContentInfo > aSeq( 2 );
-
- // document.
- aSeq.getArray()[ 0 ].Type
- = rtl::OUString::createFromAscii( WEBDAV_CONTENT_TYPE );
- aSeq.getArray()[ 0 ].Attributes
- = star::ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM
- | star::ucb::ContentInfoAttribute::KIND_DOCUMENT;
-
- beans::Property aProp;
- m_pProvider->getProperty(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), aProp );
-
- uno::Sequence< beans::Property > aDocProps( 1 );
- aDocProps.getArray()[ 0 ] = aProp;
- aSeq.getArray()[ 0 ].Properties = aDocProps;
-
- // folder.
- aSeq.getArray()[ 1 ].Type
- = rtl::OUString::createFromAscii( WEBDAV_COLLECTION_TYPE );
- aSeq.getArray()[ 1 ].Attributes
- = star::ucb::ContentInfoAttribute::KIND_FOLDER;
-
- uno::Sequence< beans::Property > aFolderProps( 1 );
- aFolderProps.getArray()[ 0 ] = aProp;
- aSeq.getArray()[ 1 ].Properties = aFolderProps;
- return aSeq;
- }
-/*
- else
- {
- OSL_ENSURE( sal_False,
- "queryCreatableContentsInfo called on non-folder object!" );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- return Sequence< ContentInfo >( 0 );
- }
-*/
+ uno::Sequence< star::ucb::ContentInfo > aSeq( 2 );
+
+ // document.
+ aSeq.getArray()[ 0 ].Type
+ = rtl::OUString::createFromAscii( WEBDAV_CONTENT_TYPE );
+ aSeq.getArray()[ 0 ].Attributes
+ = star::ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM
+ | star::ucb::ContentInfoAttribute::KIND_DOCUMENT;
+
+ beans::Property aProp;
+ m_pProvider->getProperty(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), aProp );
+
+ uno::Sequence< beans::Property > aDocProps( 1 );
+ aDocProps.getArray()[ 0 ] = aProp;
+ aSeq.getArray()[ 0 ].Properties = aDocProps;
+
+ // folder.
+ aSeq.getArray()[ 1 ].Type
+ = rtl::OUString::createFromAscii( WEBDAV_COLLECTION_TYPE );
+ aSeq.getArray()[ 1 ].Attributes
+ = star::ucb::ContentInfoAttribute::KIND_FOLDER;
+
+ uno::Sequence< beans::Property > aFolderProps( 1 );
+ aFolderProps.getArray()[ 0 ] = aProp;
+ aSeq.getArray()[ 1 ].Properties = aFolderProps;
+ return aSeq;
}
//=========================================================================
@@ -1026,65 +1008,55 @@ uno::Reference< star::ucb::XContent > SAL_CALL
Content::createNewContent( const star::ucb::ContentInfo& Info )
throw( uno::RuntimeException )
{
-// if ( isFolder() )
- {
- osl::Guard< osl::Mutex > aGuard( m_aMutex );
+ osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( !Info.Type.getLength() )
- return uno::Reference< star::ucb::XContent >();
+ if ( !Info.Type.getLength() )
+ return uno::Reference< star::ucb::XContent >();
- if ( ( !Info.Type.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) )
- &&
- ( !Info.Type.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( WEBDAV_CONTENT_TYPE ) ) ) )
- return uno::Reference< star::ucb::XContent >();
+ if ( ( !Info.Type.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) )
+ &&
+ ( !Info.Type.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( WEBDAV_CONTENT_TYPE ) ) ) )
+ return uno::Reference< star::ucb::XContent >();
- rtl::OUString aURL = m_xIdentifier->getContentIdentifier();
+ rtl::OUString aURL = m_xIdentifier->getContentIdentifier();
- OSL_ENSURE( aURL.getLength() > 0,
- "WebdavContent::createNewContent - empty identifier!" );
+ OSL_ENSURE( aURL.getLength() > 0,
+ "WebdavContent::createNewContent - empty identifier!" );
- if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() )
- aURL += rtl::OUString::createFromAscii( "/" );
+ if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() )
+ aURL += rtl::OUString::createFromAscii( "/" );
- sal_Bool isCollection;
- if ( Info.Type.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) )
- {
- aURL += rtl::OUString::createFromAscii( "New_Collection" );
- isCollection = sal_True;
- }
- else
- {
- aURL += rtl::OUString::createFromAscii( "New_Content" );
- isCollection = sal_False;
- }
+ sal_Bool isCollection;
+ if ( Info.Type.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( WEBDAV_COLLECTION_TYPE ) ) )
+ {
+ aURL += rtl::OUString::createFromAscii( "New_Collection" );
+ isCollection = sal_True;
+ }
+ else
+ {
+ aURL += rtl::OUString::createFromAscii( "New_Content" );
+ isCollection = sal_False;
+ }
- uno::Reference< star::ucb::XContentIdentifier > xId(
- new ::ucb::ContentIdentifier( m_xSMgr, aURL ) );
+ uno::Reference< star::ucb::XContentIdentifier > xId(
+ new ::ucb::ContentIdentifier( m_xSMgr, aURL ) );
- // create the local content
- try
- {
- return new ::webdav_ucp::Content( m_xSMgr,
- m_pProvider,
- xId,
- m_xResAccess->getSessionFactory(),
- isCollection );
- }
- catch ( star::ucb::ContentCreationException & )
- {
- return uno::Reference< star::ucb::XContent >();
- }
+ // create the local content
+ try
+ {
+ return new ::webdav_ucp::Content( m_xSMgr,
+ m_pProvider,
+ xId,
+ m_xResAccess->getSessionFactory(),
+ isCollection );
}
-/*
- else
+ catch ( star::ucb::ContentCreationException & )
{
- OSL_ENSURE( sal_False, "createNewContent called on non-folder object!" );
return uno::Reference< star::ucb::XContent >();
}
-*/
}
//=========================================================================