diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2005-11-11 11:22:56 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2005-11-11 11:22:56 +0000 |
commit | 5c5822d899de38878d18d166eed9d08551f97eb0 (patch) | |
tree | e4adbeaac5a9d82c825fd9415699bc2d9076845c /sfx2 | |
parent | 3d5b5dac4d47a7375a4379f43c3f2ad129507a00 (diff) |
INTEGRATION: CWS c06 (1.115.200); FILE MERGED
2005/10/07 15:30:00 kso 1.115.200.1: #125964# - Fixed FileDialogHelper::SetDisplayDirectory(). Exceptions from
UCB must be taken into account.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index bc5ab38e722a..c73a85a13069 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: filedlghelper.cxx,v $ * - * $Revision: 1.117 $ + * $Revision: 1.118 $ * - * last change: $Author: hr $ $Date: 2005-09-23 13:54:20 $ + * last change: $Author: rt $ $Date: 2005-11-11 12:22:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -99,6 +99,9 @@ #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERQUERY_HPP_ #include <com/sun/star/container/XContainerQuery.hpp> #endif +#ifndef _COM_SUN_STAR_UCB_INTERACTIVEAUGMENTEDIOEXCEPTION_HPP_ +#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> +#endif #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> @@ -222,7 +225,7 @@ //----------------------------------------------------------------------------- -using namespace ::com::sun::star; +using namespace ::com::sun; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ui::dialogs; @@ -757,15 +760,15 @@ void FileDialogHelper_Impl::updateVersions() { try { - uno::Reference< embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromURL( + star::uno::Reference< star::embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromURL( aObj.GetMainURL( INetURLObject::NO_DECODE ), - embed::ElementModes::READ ); + star::embed::ElementModes::READ ); DBG_ASSERT( xStorage.is(), "The method must return the storage or throw an exception!" ); if ( !xStorage.is() ) - throw uno::RuntimeException(); + throw star::uno::RuntimeException(); - uno::Sequence < util::RevisionTag > xVersions = SfxMedium::GetVersionList( xStorage ); + star::uno::Sequence < star::util::RevisionTag > xVersions = SfxMedium::GetVersionList( xStorage ); aEntries.realloc( xVersions.getLength() + 1 ); aEntries[0] = OUString( String ( SfxResId( STR_SFX_FILEDLG_ACTUALVERSION ) ) ); @@ -785,7 +788,7 @@ void FileDialogHelper_Impl::updateVersions() //REMOVE } //REMOVE } } - catch( uno::Exception& ) + catch( star::uno::Exception& ) { } } @@ -2397,16 +2400,25 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) ::rtl::OUString sFileName; INetURLObject aObj( _rPath ); - if ( !::utl::UCBContentHelper::IsFolder( _rPath ) ) + try + { + ::ucb::Content aContent( + _rPath, star::uno::Reference< star::ucb::XCommandEnvironment >() ); + if ( !aContent.isFolder() ) + { + sFileName = aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ); + aObj.removeSegment(); + mpImp->setFileName( sFileName ); + } + } + catch ( star::ucb::ContentCreationException const & ) + { + } + catch ( star::ucb::InteractiveAugmentedIOException const & ) { - sFileName = aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ); - aObj.removeSegment(); } - sPath = aObj.GetMainURL( INetURLObject::NO_DECODE ); - - mpImp->displayFolder( sPath ); - mpImp->setFileName( sFileName ); + mpImp->displayFolder( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } // ------------------------------------------------------------------------ |