#106116# file-content throws NameClashException in case catalog exists

This commit is contained in:
Mikhail Voitenko 2002-12-09 15:29:09 +00:00
parent e6e224d2a8
commit 2f7858fd1e

View file

@ -2,9 +2,9 @@
*
* $RCSfile: ucbhelper.cxx,v $
*
* $Revision: 1.15 $
* $Revision: 1.16 $
*
* last change: $Author: mav $ $Date: 2002-11-05 09:00:53 $
* last change: $Author: mav $ $Date: 2002-12-09 16:29:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -76,6 +76,9 @@
#ifndef _COM_SUN_STAR_UCB_ILLEGALIDENTIFIEREXCEPTION_HPP_
#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_NAMECLASHEXCEPTION_HPP_
#include <com/sun/star/ucb/NameClashException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HPP_
#include <com/sun/star/ucb/NameClash.hpp>
#endif
@ -604,6 +607,8 @@ sal_Bool UCBContentHelper::MakeFolder( const String& rFolder )
sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Content& rNew )
{
sal_Bool bRecover = sal_False;
try
{
Reference< XContentCreator > xCreator = Reference< XContentCreator >( aCnt.get(), UNO_QUERY );
@ -648,12 +653,13 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont
{
if ( r.Code == IOErrorCode_ALREADY_EXISTING )
{
INetURLObject aObj( aCnt.getURL() );
aObj.Append( aTitle );
rNew = Content( aObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >() );
return TRUE;
bRecover = sal_True;
}
}
catch ( NameClashException& )
{
bRecover = sal_True;
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
{
}
@ -664,6 +670,14 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont
{
}
if( bRecover )
{
INetURLObject aObj( aCnt.getURL() );
aObj.Append( aTitle );
rNew = Content( aObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >() );
return sal_True;
}
return sal_False;
}