summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-07 10:24:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-07 13:46:57 +0100
commit055be3f4be764e445064effabf06de9d1ed819f7 (patch)
tree0b2f908a8bc6ffb34ff6f2ae7472dfc4a7e95cc2 /sfx2/source/appl
parente53168c6875223d718df49e23b733ad6f40e0b7f (diff)
sfx2: introduce a new .uno:SignPDF
It's similar to File -> Open, but the file picker only offers PDF files in this case, and the import is read-only -- i.e. it's the import equivalent of .uno:ExportToPDF. Change-Id: I7be9d6711e0ea93643e538575c0604d41cff9b26
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/app.src4
-rw-r--r--sfx2/source/appl/appopen.cxx19
2 files changed, 21 insertions, 2 deletions
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 3384f4a5a677..21c5f9175f2e 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -333,6 +333,10 @@ String STR_SFX_FILTERNAME_ALL
{
Text [ en-US ] = "All files" ;
};
+String STR_SFX_FILTERNAME_PDF
+{
+ Text [ en-US ] = "PDF files" ;
+};
String RID_SVXSTR_EDITGRFLINK
{
Text [ en-US ] = "Link Image" ;
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 5b0fddd80e78..caec98f9e705 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -624,6 +624,15 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( pRemoteDialogItem && pRemoteDialogItem->GetValue())
nDialog = SFX2_IMPL_DIALOG_REMOTE;
+ sal_Int16 nDialogType = ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION;
+ FileDialogFlags eDialogFlags = FileDialogFlags::MultiSelection;
+ const SfxBoolItem* pSignPDFItem = rReq.GetArg<SfxBoolItem>(SID_SIGNPDF);
+ if (pSignPDFItem && pSignPDFItem->GetValue())
+ {
+ eDialogFlags |= FileDialogFlags::SignPDF;
+ nDialogType = ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+ }
+
OUString sStandardDir;
const SfxStringItem* pStandardDirItem = rReq.GetArg<SfxStringItem>(SID_STANDARD_DIR);
@@ -638,8 +647,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl(
- ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
- FileDialogFlags::MultiSelection, OUString(), aURLList,
+ nDialogType,
+ eDialogFlags, OUString(), aURLList,
aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList );
if ( nErr == ERRCODE_ABORT )
@@ -1127,4 +1136,10 @@ void SfxApplication::OpenRemoteExec_Impl( SfxRequest& rReq )
GetDispatcher_Impl()->Execute( SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs() );
}
+void SfxApplication::SignPDFExec_Impl(SfxRequest& rReq)
+{
+ rReq.AppendItem(SfxBoolItem(SID_SIGNPDF, true));
+ GetDispatcher_Impl()->Execute(SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */