diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-08-21 09:59:11 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-08-21 09:59:11 +0000 |
commit | 4c5be38a7d2398f83faa4d64aedea42fbd6f674f (patch) | |
tree | 8b0a00f6fc9d458342bc8f7ff6af564a7c362077 /fileaccess | |
parent | 741d84762a3d7b58ca14f4db321c54056fb4275d (diff) |
#91330# openFileReadWrite(): Catch com.sun.ucb.NameClashException
Diffstat (limited to 'fileaccess')
-rw-r--r-- | fileaccess/source/FileAccess.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx index 3caf2d49e14b..4aa9c38db063 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 ); |