summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2022-10-18 17:08:36 -0400
committerMiklos Vajna <vmiklos@collabora.com>2022-11-04 08:41:06 +0100
commit1e007e8f1703851b01c68884e87c906f6bae5a5e (patch)
tree833ebb55d38837f7d17f9418e4e7318af0a5c029 /sfx2
parentfb8d94e77f16e0f9d3af42d64756bd771de9d17c (diff)
sw: fix merge mail to direct export as pdf
In order to export directly to PDF, the document must remove the hidden sections (if format condition), the data source should stay on current selected record finally restore the hidden sections. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: Idf8e2a26d5c9cbe61ddac6c35cc2e1df1175da27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141520 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 9398787eb3bf..91493e2eb616 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -967,12 +967,26 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
+ const SfxBoolItem *pItem = nId != SID_DIRECTEXPORTDOCASPDF ? nullptr :
+ dynamic_cast<const SfxBoolItem*>( GetSlotState(SID_MAIL_PREPAREEXPORT) );
+ if (pItem && pItem->GetValue())
+ {
+ SfxRequest aRequest(SID_MAIL_PREPAREEXPORT, SfxCallMode::SYNCHRON, GetPool());
+ aRequest.AppendItem(SfxBoolItem(FN_PARAM_1, true));
+ ExecuteSlot(aRequest);
+ }
+
aHelper.GUIStoreModel( GetModel(),
OUString::createFromAscii( pSlot->GetUnoName() ),
aDispatchArgs,
bPreselectPassword,
GetDocumentSignatureState() );
+ if (pItem && pItem->GetValue())
+ {
+ SfxRequest aRequest(SID_MAIL_EXPORT_FINISHED, SfxCallMode::SYNCHRON, GetPool());
+ ExecuteSlot(aRequest);
+ }
// merge aDispatchArgs to the request
SfxAllItemSet aResultParams( GetPool() );