summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-11-19 16:09:21 +0000
committerAndreas Bille <abi@openoffice.org>2001-11-19 16:09:21 +0000
commit211275dcf0bef60ac22be6994ddb543ffda5525a (patch)
treede9971834ebff035881f678aa3f8f8a034dafc35
parent156eb30c0244a463b9645db1808e443a8e62f92d (diff)
#80835# using interactionhandler in bc.cxx
-rw-r--r--ucb/source/ucp/file/bc.cxx45
-rw-r--r--ucb/source/ucp/file/filinpstr.cxx13
2 files changed, 47 insertions, 11 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 81b07c0c0cb6..1be8ddf0a36a 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.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: abi $ $Date: 2001-11-05 07:43:30 $
+ * last change: $Author: abi $ $Date: 2001-11-19 17:09:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,6 +124,9 @@
#ifndef _FILERROR_HXX_
#include "filerror.hxx"
#endif
+#ifndef _FILINSREQ_HXX_
+#include "filinsreq.hxx"
+#endif
using namespace fileaccess;
@@ -1242,21 +1245,43 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
}
- sal_Bool success;
+ sal_Bool success = false;
if( bDocument )
success = m_pMyShell->mkfil( nMyCommandIdentifier,
m_aUncPath,
aInsertArgument.ReplaceExisting,
aInsertArgument.Data );
else
- success = m_pMyShell->mkdir( nMyCommandIdentifier,
- m_aUncPath,
- aInsertArgument.ReplaceExisting );
+ {
+ while( ! success )
+ {
+ success = m_pMyShell->mkdir( nMyCommandIdentifier,
+ m_aUncPath,
+ aInsertArgument.ReplaceExisting );
+ if( success )
+ break;
+
+ XInteractionRequestImpl *aRequestImpl = new XInteractionRequestImpl;
+ uno::Reference< task::XInteractionRequest > aReq( aRequestImpl );
-// if( ! success )
-// {
-// return;
-// }
+ m_pMyShell->handleTask( nMyCommandIdentifier,aReq );
+ if( aRequestImpl->aborted() ||
+ !aRequestImpl->newName().getLength() )
+ // means aborting
+ break;
+
+ // determine new uncpath
+ m_pMyShell->clearError( nMyCommandIdentifier );
+ m_aUncPath = getParentName( m_aUncPath );
+ if( m_aUncPath.lastIndexOf( sal_Unicode('/') ) != m_aUncPath.getLength() - 1 )
+ m_aUncPath += rtl::OUString::createFromAscii("/");
+
+ m_aUncPath += rtl::Uri::encode( aRequestImpl->newName(),
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ }
+ }
FileContentIdentifier* p = new FileContentIdentifier( m_pMyShell,m_aUncPath );
m_xContentIdentifier = Reference< XContentIdentifier >( p );
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index ae754ffb6d52..8f91e249d5e7 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -41,7 +41,18 @@ XInputStream_impl::XInputStream_impl( shell* pMyShell,const rtl::OUString& aUncP
XInputStream_impl::~XInputStream_impl()
{
- closeInput();
+ try
+ {
+ closeInput();
+ }
+ catch (io::IOException const &)
+ {
+ OSL_ENSURE(false, "unexpected situation");
+ }
+ catch (uno::RuntimeException const &)
+ {
+ OSL_ENSURE(false, "unexpected situation");
+ }
}