From e9891e5dd8e9c83a1bf0483aa314e743a1c02e50 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 30 Jun 2016 11:19:43 +0200 Subject: Add new open dialog type: Preview only (without link) This is needed e.g. for the "Insert Photo Album" dialog where we don't want the "Insert Link" option in the file open dialog (tdf#65356) Change-Id: I01aecaaf8194a8123931b0482b4a37155654dfc2 Reviewed-on: https://gerrit.libreoffice.org/26796 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- fpicker/source/aqua/ControlHelper.mm | 3 +++ fpicker/source/aqua/SalAquaFilePicker.mm | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'fpicker/source/aqua') diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index 5727cdf35cdf..0cecb40b1cea 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -216,6 +216,9 @@ void ControlHelper::initialize( sal_Int16 nTemplateId ) case FILESAVE_AUTOEXTENSION: m_bToggleVisibility[AUTOEXTENSION] = true; break; + case FILEOPEN_PREVIEW: + m_bToggleVisibility[PREVIEW] = true; + break; } createControls(); diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index 78ec4f8cf640..eef8f425e91c 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -204,7 +204,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) default: throw uno::RuntimeException( - "The dialog returned with an unknown result!", + "The dialog returned with an unknown result!", static_cast( static_cast( this ) )); break; } @@ -288,7 +288,7 @@ uno::Sequence SAL_CALL SalAquaFilePicker::getSelectedFiles() thro SAL_INFO("fpicker.aqua", "# of items: " << nFiles); uno::Sequence< rtl::OUString > aSelectedFiles(nFiles); - + for(long nIndex = 0; nIndex < nFiles; nIndex += 1) { NSURL *url = [files objectAtIndex:nIndex]; @@ -483,6 +483,9 @@ throw( uno::Exception, uno::RuntimeException ) case FILESAVE_AUTOEXTENSION: m_nDialogType = NAVIGATIONSERVICES_SAVE; break; + case FILEOPEN_PREVIEW: + m_nDialogType = NAVIGATIONSERVICES_OPEN; + break; default: throw lang::IllegalArgumentException("Unknown template", static_cast( static_cast(this) ), -- cgit