summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.hxx3
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.mm24
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx32
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx1
-rw-r--r--fpicker/source/win32/filepicker/FilePicker.cxx2
-rw-r--r--fpicker/source/win32/filepicker/FilePicker.hxx4
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.cxx9
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.hxx7
-rw-r--r--offapi/com/sun/star/ui/dialogs/XFilePicker2.idl2
-rw-r--r--offapi/com/sun/star/ui/dialogs/XFilePicker3.idl4
-rw-r--r--offapi/type_reference/offapi.idl6
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx1
-rw-r--r--vcl/unx/kde4/KDE4FilePicker.hxx4
13 files changed, 45 insertions, 54 deletions
diff --git a/fpicker/source/aqua/SalAquaFilePicker.hxx b/fpicker/source/aqua/SalAquaFilePicker.hxx
index 9a32f31f95c4..f018f86df25f 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.hxx
+++ b/fpicker/source/aqua/SalAquaFilePicker.hxx
@@ -83,6 +83,9 @@ public:
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFiles( )
throw( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedFiles( )
+ throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
// XFilterManager functions
virtual void SAL_CALL appendFilter( const OUString& aTitle, const OUString& aFilter )
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index 431381843150..5ee58921e7a6 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -305,6 +305,20 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
+ uno::Sequence< rtl::OUString > aSelectedFiles = getSelectedFiles();
+ // multiselection doesn't really work with getFiles
+ // so just retrieve the first url
+ if (aSelectedFiles.getLength() > 1)
+ aSelectedFiles.realloc(1);
+
+ DBG_PRINT_EXIT(CLASS_NAME, __func__);
+ return aSelectedFiles;
+}
+
+uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles() throw( uno::RuntimeException, std::exception )
+{
+ DBG_PRINT_ENTRY(CLASS_NAME, __func__);
+
SolarMutexGuard aGuard;
#if HAVE_FEATURE_MACOSX_SANDBOX
@@ -319,11 +333,6 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
#endif
// OSL_TRACE("starting work");
- /*
- * If more than one file is selected in an OpenDialog, then the first result
- * is the directory and the remaining results contain just the files' names
- * without the basedir path.
- */
NSArray *files = nil;
if (m_nDialogType == NAVIGATIONSERVICES_OPEN) {
files = [(NSOpenPanel*)m_pDialog URLs];
@@ -335,11 +344,6 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
long nFiles = [files count];
SAL_INFO("fpicker.aqua", "# of items: " << nFiles);
- // multiselection doesn't really work
- // so just retrieve the first url
- if (nFiles > 1)
- nFiles = 1;
-
uno::Sequence< rtl::OUString > aSelectedFiles(nFiles);
for(long nIndex = 0; nIndex < nFiles; nIndex += 1)
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index f52cdfe112ac..134b661b78a9 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -591,7 +591,7 @@ OUString SAL_CALL SvtFilePicker::getDisplayDirectory() throw( RuntimeException,
return m_aDisplayDirectory;
}
-Sequence< OUString > SAL_CALL SvtFilePicker::getFiles() throw( RuntimeException, std::exception )
+Sequence< OUString > SAL_CALL SvtFilePicker::getSelectedFiles() throw( RuntimeException, std::exception )
{
checkAlive();
@@ -602,31 +602,25 @@ Sequence< OUString > SAL_CALL SvtFilePicker::getFiles() throw( RuntimeException,
return aEmpty;
}
- // if there is more than one path we have to return the path to the
- // files first and then the list of the selected entries
-
std::vector<OUString> aPathList(getDialog()->GetPathList());
size_t nCount = aPathList.size();
- size_t nTotal = nCount > 1 ? nCount+1: nCount;
- Sequence< OUString > aPath( nTotal );
+ Sequence< OUString > aFiles(nCount);
- if ( nCount == 1 )
- aPath[0] = aPathList[0];
- else if ( nCount > 1 )
+ for(size_t i = 0; i < aPathList.size(); ++i)
{
- INetURLObject aObj(aPathList[0]);
- aObj.removeSegment();
- aPath[0] = aObj.GetMainURL( INetURLObject::NO_DECODE );
-
- for(size_t i = 0; i < aPathList.size(); ++i)
- {
- aObj.SetURL(aPathList[i]);
- aPath[i + 1] = aObj.getName();
- }
+ aFiles[i] = aPathList[i];
}
- return aPath;
+ return aFiles;
+}
+
+Sequence< OUString > SAL_CALL SvtFilePicker::getFiles() throw( RuntimeException, std::exception )
+{
+ Sequence< OUString > aFiles = getSelectedFiles();
+ if (aFiles.getLength() > 1)
+ aFiles.realloc(1);
+ return aFiles;
}
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index df6ad1c7b195..3fa7c6e62fa4 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -119,6 +119,7 @@ public:
virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual OUString SAL_CALL getDisplayDirectory() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getFiles() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedFiles() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// XFilePickerControlAccess functions
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx
index fda664ac5496..d80c74020e25 100644
--- a/fpicker/source/win32/filepicker/FilePicker.cxx
+++ b/fpicker/source/win32/filepicker/FilePicker.cxx
@@ -372,7 +372,7 @@ uno::Sequence<OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeExcep
-uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException)
+uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException, std::exception)
{
OSL_ASSERT(0 != m_pImpl.get());
osl::MutexGuard aGuard(m_aMutex);
diff --git a/fpicker/source/win32/filepicker/FilePicker.hxx b/fpicker/source/win32/filepicker/FilePicker.hxx
index 0ba721420fd8..c6231526195c 100644
--- a/fpicker/source/win32/filepicker/FilePicker.hxx
+++ b/fpicker/source/win32/filepicker/FilePicker.hxx
@@ -25,7 +25,6 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
@@ -46,7 +45,6 @@ protected:
};
typedef ::cppu::WeakComponentImplHelper <
- ::com::sun::star::ui::dialogs::XFilePicker2,
::com::sun::star::ui::dialogs::XFilePicker3,
::com::sun::star::ui::dialogs::XFilePickerControlAccess,
::com::sun::star::ui::dialogs::XFilePreview,
@@ -97,7 +95,7 @@ public:
// XFilePicker2 functions
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedFiles( )
- throw (::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::uno::RuntimeException, std::exception);
// XFilterManager functions
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index 2411c74d2965..4970b4e3dbca 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -256,12 +256,7 @@ OUString SAL_CALL VistaFilePicker::getDisplayDirectory()
css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles()
throw(css::uno::RuntimeException)
{
- RequestRef rRequest(new Request());
- rRequest->setRequest (VistaFilePickerImpl::E_GET_SELECTED_FILES);
-
- m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED);
-
- css::uno::Sequence< OUString > lFiles = rRequest->getArgumentOrDefault(PROP_SELECTED_FILES, css::uno::Sequence< OUString >());
+ css::uno::Sequence< OUString > lFiles = getSelectedFiles();
// multiselection doesn't really work
// so just retrieve the first url
if (lFiles.getLength() > 1)
@@ -272,7 +267,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles()
css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles()
- throw(css::uno::RuntimeException)
+ throw(css::uno::RuntimeException, std::exception)
{
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_GET_SELECTED_FILES);
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
index f133303609a6..01b6da335893 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
@@ -27,7 +27,6 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
@@ -45,7 +44,6 @@ namespace vista{
typedef ::cppu::WeakComponentImplHelper<
- css::ui::dialogs::XFilePicker2,
css::ui::dialogs::XFilePicker3,
css::ui::dialogs::XFilePickerControlAccess,
css::ui::dialogs::XFilePreview,
@@ -112,12 +110,9 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getFiles( )
throw( css::uno::RuntimeException );
-
// XFilePicker2 functions
-
-
virtual css::uno::Sequence< OUString > SAL_CALL getSelectedFiles( )
- throw( css::uno::RuntimeException );
+ throw( css::uno::RuntimeException, std::exception );
// XFilterManager functions
diff --git a/offapi/com/sun/star/ui/dialogs/XFilePicker2.idl b/offapi/com/sun/star/ui/dialogs/XFilePicker2.idl
index 91189a6f9f15..b04517f517f7 100644
--- a/offapi/com/sun/star/ui/dialogs/XFilePicker2.idl
+++ b/offapi/com/sun/star/ui/dialogs/XFilePicker2.idl
@@ -27,7 +27,7 @@ module com { module sun { module star { module ui { module dialogs {
/** extends file picker interface to workaround some design problems.
*/
-interface XFilePicker2 : ::com::sun::star::ui::dialogs::XFilePicker
+published interface XFilePicker2 : ::com::sun::star::ui::dialogs::XFilePicker
{
/** Returns a sequence of the selected files including path information in
URL format, conforming to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>.
diff --git a/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl b/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl
index c33e8eb4cdbd..d2ee0e2d72f6 100644
--- a/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl
+++ b/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl
@@ -22,7 +22,7 @@
#include <com/sun/star/lang/XComponent.idl>
#include <com/sun/star/util/XCancellable.idl>
-#include <com/sun/star/ui/dialogs/XFilePicker.idl>
+#include <com/sun/star/ui/dialogs/XFilePicker2.idl>
#include <com/sun/star/ui/dialogs/XFilePickerNotifier.idl>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.idl>
#include <com/sun/star/ui/dialogs/XFilterManager.idl>
@@ -40,7 +40,7 @@ module com { module sun { module star { module ui { module dialogs {
*/
published interface XFilePicker3
{
- interface XFilePicker;
+ interface XFilePicker2;
/** Provides the ability to request notifications about changes.
*/
diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl
index f95e6b7f1844..c4bd5c4b1322 100644
--- a/offapi/type_reference/offapi.idl
+++ b/offapi/type_reference/offapi.idl
@@ -16956,8 +16956,12 @@ module com {
void setCurrentFilter([in] string aTitle) raises (::com::sun::star::lang::IllegalArgumentException);
string getCurrentFilter();
};
- published interface XFilePicker3 {
+ published interface XFilePicker2 {
interface ::com::sun::star::ui::dialogs::XFilePicker;
+ sequence< string > getSelectedFiles();
+ };
+ published interface XFilePicker3 {
+ interface ::com::sun::star::ui::dialogs::XFilePicker2;
interface ::com::sun::star::ui::dialogs::XFilePickerNotifier;
interface ::com::sun::star::ui::dialogs::XFilterManager;
interface ::com::sun::star::ui::dialogs::XFilterGroupManager;
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
index 1830f210ffb5..e55d2d29dd1d 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
@@ -48,7 +48,6 @@ typedef ::com::sun::star::uno::Sequence< UnoFilterEntry > UnoFilterList; // c
typedef cppu::WeakComponentImplHelper<
::com::sun::star::ui::dialogs::XFilePickerControlAccess,
::com::sun::star::ui::dialogs::XFilePreview,
- ::com::sun::star::ui::dialogs::XFilePicker2,
::com::sun::star::ui::dialogs::XFilePicker3,
::com::sun::star::lang::XInitialization
> SalGtkFilePicker_Base;
diff --git a/vcl/unx/kde4/KDE4FilePicker.hxx b/vcl/unx/kde4/KDE4FilePicker.hxx
index c29f4d89c355..186e57a29cbf 100644
--- a/vcl/unx/kde4/KDE4FilePicker.hxx
+++ b/vcl/unx/kde4/KDE4FilePicker.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -42,8 +41,7 @@ class QWidget;
class QLayout;
typedef ::cppu::WeakComponentImplHelper
-< ::com::sun::star::ui::dialogs::XFilePicker2
-, ::com::sun::star::ui::dialogs::XFilePicker3
+< ::com::sun::star::ui::dialogs::XFilePicker3
, ::com::sun::star::ui::dialogs::XFilePickerControlAccess
// TODO ::com::sun::star::ui::dialogs::XFilePreview
, ::com::sun::star::lang::XInitialization