diff options
author | Peter Burow <pb@openoffice.org> | 2001-07-03 12:48:07 +0000 |
---|---|---|
committer | Peter Burow <pb@openoffice.org> | 2001-07-03 12:48:07 +0000 |
commit | 9465996a580ccd8e3685246f347f8e1165cbc0fc (patch) | |
tree | 1202fb0754ce0714a3c7cdb377edfab9ca1bb1b0 /unotools/source/ucbhelper/ucbhelper.cxx | |
parent | db72927bcf7c100d66cb07a267360504ca2b06fa (diff) |
fix: #89182# catch exception in HasParentFolder()
Diffstat (limited to 'unotools/source/ucbhelper/ucbhelper.cxx')
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 0ee835ec095b..0f77824e23af 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ucbhelper.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: dv $ $Date: 2001-06-29 12:47:37 $ + * last change: $Author: pb $ $Date: 2001-07-03 13:48:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -615,17 +615,28 @@ sal_Bool UCBContentHelper::MakeFolder( const String& rFolder ) sal_Bool UCBContentHelper::HasParentFolder( const String& rFolder ) { sal_Bool bRet = sal_False; - Content aCnt( rFolder, Reference< XCommandEnvironment > () ); - Reference< XChild > xChild( aCnt.get(), UNO_QUERY ); - if ( xChild.is() ) + try { - Reference< XContent > xParent( xChild->getParent(), UNO_QUERY ); - if ( xParent.is() ) + Content aCnt( rFolder, Reference< XCommandEnvironment > () ); + Reference< XChild > xChild( aCnt.get(), UNO_QUERY ); + if ( xChild.is() ) { - String aParentURL = String( xParent->getIdentifier()->getContentIdentifier() ); - bRet = ( aParentURL.Len() > 0 && aParentURL != rFolder ); + Reference< XContent > xParent( xChild->getParent(), UNO_QUERY ); + if ( xParent.is() ) + { + String aParentURL = String( xParent->getIdentifier()->getContentIdentifier() ); + bRet = ( aParentURL.Len() > 0 && aParentURL != rFolder ); + } } } + catch( ::com::sun::star::ucb::CommandAbortedException& ) + { + DBG_ERRORFILE( "UCBContentHelper::HasParentFolder(): CommandAbortedException" ); + } + catch( ::com::sun::star::uno::Exception& ) + { + DBG_ERRORFILE( "UCBContentHelper::HasParentFolder(): Any other exception" ); + } return bRet; } |