diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2006-08-03 12:21:55 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2006-08-03 12:21:55 +0000 |
commit | 0552cda562a5f93426030dd4baf186fa0fa92d28 (patch) | |
tree | 1d9def66cbd24d567eb6ff85e0193bdcef075882 /sfx2 | |
parent | e7d297c874327fc2ad23a256ccc6944b4b021bfd (diff) |
INTEGRATION: CWS fpicker6 (1.123.68); FILE MERGED
2006/08/01 17:45:08 cmc 1.123.68.1: #i63263# multiselect support
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 24bacaaa5870..626e619b025a 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: filedlghelper.cxx,v $ * - * $Revision: 1.123 $ + * $Revision: 1.124 $ * - * last change: $Author: hr $ $Date: 2006-06-19 22:21:27 $ + * last change: $Author: ihi $ $Date: 2006-08-03 13:21:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -69,6 +69,9 @@ #ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERNOTIFIER_HPP_ #include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp> #endif +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERWORKAROUND_HPP_ +#include <com/sun/star/ui/dialogs/XFilePickerWorkaround.hpp> +#endif #ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPREVIEW_HPP_ #include <com/sun/star/ui/dialogs/XFilePreview.hpp> #endif @@ -1551,10 +1554,30 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList, getRealFilter( rFilter ); // fill the rpURLList - Sequence < OUString > aPathSeq = mxFileDlg->getFiles(); + Reference<XFilePickerWorkaround> xFileWorkarounds(mxFileDlg, UNO_QUERY); + Sequence < OUString > aPathSeq; + if (xFileWorkarounds.is()) + { + aPathSeq = xFileWorkarounds->getFilesAsURIs(); + if ( !aPathSeq.getLength() ) + return ERRCODE_ABORT; - if ( aPathSeq.getLength() ) + rpURLList = new SvStringsDtor; + + for ( USHORT i = 0; i < aPathSeq.getLength(); ++i ) + { + String* pURL = new String( aPathSeq[i] ); + rpURLList->Insert( pURL, rpURLList->Count() ); + } + } + else { + OSL_TRACE("Obsolete & broken multiselect code path"); + aPathSeq = mxFileDlg->getFiles(); + + if ( !aPathSeq.getLength() ) + return ERRCODE_ABORT; + rpURLList = new SvStringsDtor; if ( aPathSeq.getLength() == 1 ) @@ -1580,11 +1603,9 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList, rpURLList->Insert( pURL, rpURLList->Count() ); } } - SaveLastUsedFilter(); - return ERRCODE_NONE; } - else - return ERRCODE_ABORT; + SaveLastUsedFilter(); + return ERRCODE_NONE; } else return ERRCODE_ABORT; |