From 4b76748ff1f96eaf408b4e8884cb8870a2c0e466 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Thu, 4 May 2006 13:33:20 +0000 Subject: INTEGRATION: CWS pb15 (1.120.22); FILE MERGED 2006/04/26 06:47:04 pb 1.120.22.1: fix: #i64206# impl_isFolder() now catches all Exceptions --- sfx2/source/dialog/filedlghelper.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 68fa4078c812..5b214b66ad67 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: filedlghelper.cxx,v $ * - * $Revision: 1.121 $ + * $Revision: 1.122 $ * - * last change: $Author: rt $ $Date: 2006-05-02 16:34:01 $ + * last change: $Author: rt $ $Date: 2006-05-04 14:33:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -132,6 +132,9 @@ #ifndef _VOS_MUTEX_HXX_ #include #endif +#ifndef _VOS_SECURITY_HXX_ +#include +#endif #ifndef _SV_CVTGRF_HXX #include @@ -2397,10 +2400,7 @@ static int impl_isFolder( const OUString& rPath ) return 0; } - catch ( star::ucb::ContentCreationException const & ) - { - } - catch ( star::ucb::InteractiveAugmentedIOException const & ) + catch ( Exception const & ) { } @@ -2432,7 +2432,14 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) else { INetURLObject aObjPathName( _rPath ); - mpImp->displayFolder( aObjPathName.GetMainURL( INetURLObject::NO_DECODE ) ); + ::rtl::OUString sFolder( aObjPathName.GetMainURL( INetURLObject::NO_DECODE ) ); + if ( sFolder.getLength() == 0 ) + { + // _rPath is not a valid path -> fallback to home directory + NAMESPACE_VOS( OSecurity ) aSecurity; + aSecurity.getHomeDir( sFolder ); + } + mpImp->displayFolder( sFolder ); } } -- cgit