From 39e75be271667d156044d7641ff2347b9f8a513c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 20 Sep 2017 17:10:31 +0200 Subject: EPUB export: add uno command to bypass options dialog Similarly how this is possible with PDF. The toolbar button is hidden by default in Writer, though. Change-Id: Iaf3b61ac2160578f7eaabd194ce8932792575c29 Reviewed-on: https://gerrit.libreoffice.org/42554 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sfx2/source/doc/guisaveas.cxx | 7 ++++++- sfx2/source/doc/objserv.cxx | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'sfx2/source/doc') diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 4fff1155a0a7..75a6c4f9353b 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -114,6 +114,7 @@ #define SAVEAS_REQUESTED 32 #define SAVEACOPY_REQUESTED 64 #define EPUBEXPORT_REQUESTED 128 +#define EPUBDIRECTEXPORT_REQUESTED 256 #define SAVEASREMOTE_REQUESTED -1 // possible statuses of save operation @@ -145,6 +146,8 @@ sal_uInt16 getSlotIDFromMode( sal_Int16 nStoreMode ) nResult = SID_EXPORTDOCASEPUB; else if ( nStoreMode == ( EXPORT_REQUESTED | PDFEXPORT_REQUESTED | PDFDIRECTEXPORT_REQUESTED ) ) nResult = SID_DIRECTEXPORTDOCASPDF; + else if ( nStoreMode == ( EXPORT_REQUESTED | EPUBEXPORT_REQUESTED | EPUBDIRECTEXPORT_REQUESTED ) ) + nResult = SID_DIRECTEXPORTDOCASEPUB; else if ( nStoreMode == SAVEAS_REQUESTED || nStoreMode == ( EXPORT_REQUESTED | WIDEEXPORT_REQUESTED ) ) nResult = SID_SAVEASDOC; else if ( nStoreMode == SAVEASREMOTE_REQUESTED ) @@ -168,6 +171,8 @@ sal_Int16 getStoreModeFromSlotName( const OUString& aSlotName ) nResult = EXPORT_REQUESTED | PDFEXPORT_REQUESTED | PDFDIRECTEXPORT_REQUESTED; else if ( aSlotName == "ExportToEPUB" ) nResult = EXPORT_REQUESTED | EPUBEXPORT_REQUESTED; + else if ( aSlotName == "ExportDirectToEPUB" ) + nResult = EXPORT_REQUESTED | EPUBEXPORT_REQUESTED | EPUBDIRECTEXPORT_REQUESTED; else if ( aSlotName == "Save" ) nResult = SAVE_REQUESTED; else if ( aSlotName == "SaveAs" ) @@ -1448,7 +1453,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo const OUString sFilterFlagsString("FilterFlags"); bool bPDFOptions = (nStoreMode & PDFEXPORT_REQUESTED) && !(nStoreMode & PDFDIRECTEXPORT_REQUESTED); - bool bEPUBOptions = (nStoreMode & EPUBEXPORT_REQUESTED); + bool bEPUBOptions = (nStoreMode & EPUBEXPORT_REQUESTED) && !(nStoreMode & EPUBDIRECTEXPORT_REQUESTED); if ( ( nStoreMode & EXPORT_REQUESTED ) && (bPDFOptions || bEPUBOptions) ) { // this is PDF or EPUB export, the filter options dialog should be shown before the export diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index da09164f0317..0dfd5b80959f 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -500,6 +500,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) bIsPDFExport = true; SAL_FALLTHROUGH; case SID_EXPORTDOCASEPUB: + case SID_DIRECTEXPORTDOCASEPUB: case SID_EXPORTDOC: case SID_SAVEASDOC: case SID_SAVEASREMOTE: @@ -979,6 +980,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) case SID_EXPORTDOCASPDF: case SID_DIRECTEXPORTDOCASPDF: case SID_EXPORTDOCASEPUB: + case SID_DIRECTEXPORTDOCASEPUB: { break; } -- cgit