summaryrefslogtreecommitdiff
path: root/fileaccess
diff options
context:
space:
mode:
authorAndreas Bregas <ab@openoffice.org>2001-08-21 09:59:11 +0000
committerAndreas Bregas <ab@openoffice.org>2001-08-21 09:59:11 +0000
commit2eec344cd7d3ee375a95fe482633e801057e68cf (patch)
treeac2858b0aa175a9cb7695d146ead331eabc9df9c /fileaccess
parent5d6af1e45a8d4cf6ebf0571b6984cb09573c5ff8 (diff)
#91330# openFileReadWrite(): Catch com.sun.ucb.NameClashException
Diffstat (limited to 'fileaccess')
-rw-r--r--fileaccess/source/FileAccess.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index 94ea4fd031..f7bf46b6c9 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FileAccess.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: ab $ $Date: 2001-08-10 15:39:11 $
+ * last change: $Author: ab $ $Date: 2001-08-21 10:59:11 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,6 +85,7 @@ using namespace ::ucb;
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/NameClashException.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/beans/Property.hpp>
@@ -548,7 +549,12 @@ Reference< XStream > OFileAccess::openFileReadWrite( const OUString& FileURL )
Any aCmdArg;
aCmdArg <<= aInsertArg;
- aCnt.executeCommand( OUString::createFromAscii( "insert" ), aCmdArg );
+ try
+ {
+ // #91330 Insert throws exception when file exists
+ aCnt.executeCommand( OUString::createFromAscii( "insert" ), aCmdArg );
+ }
+ catch (NameClashException &) {}
Reference< XActiveDataStreamer > xSink = (XActiveDataStreamer*)new OActiveDataStreamer();
Reference< XInterface > xSinkIface = Reference< XInterface >::query( xSink );