summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-20 17:10:31 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 14:39:02 +0200
commit39e75be271667d156044d7641ff2347b9f8a513c (patch)
treed507c28ce3f2ad1052c0db623ee2c6cda15c2cf0 /sfx2
parent917bcea4b4660c516bb18691e4f8ee60313804ef (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/docslots.sdi5
-rw-r--r--sfx2/sdi/sfx.sdi17
-rw-r--r--sfx2/source/appl/appuno.cxx4
-rw-r--r--sfx2/source/doc/guisaveas.cxx7
-rw-r--r--sfx2/source/doc/objserv.cxx2
5 files changed, 32 insertions, 3 deletions
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi
index 04039af5728a..a6da56c2488d 100644
--- a/sfx2/sdi/docslots.sdi
+++ b/sfx2/sdi/docslots.sdi
@@ -239,6 +239,11 @@ shell SfxObjectShell
ExecMethod = ExecFile_Impl ;
StateMethod = GetState_Impl ;
]
+ SID_DIRECTEXPORTDOCASEPUB
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
SID_SIGNATURE
[
ExecMethod = ExecFile_Impl;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 75b883ae5508..bb32b9745c71 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4795,6 +4795,23 @@ SfxVoidItem ExportToEPUB SID_EXPORTDOCASEPUB
GroupId = SfxGroupId::Document;
]
+SfxVoidItem ExportDirectToEPUB SID_DIRECTEXPORTDOCASEPUB
+(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME)
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Document;
+]
+
SfxImageItem ImageOrientation SID_IMAGE_ORIENTATION
[
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 534baecfe967..84e113e8bca6 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -170,7 +170,7 @@ static bool isMediaDescriptor( sal_uInt16 nSlotId )
nSlotId == SID_SAVEASDOC || nSlotId == SID_SAVEDOC ||
nSlotId == SID_SAVETO || nSlotId == SID_SAVEACOPY ||
nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF ||
- nSlotId == SID_EXPORTDOCASEPUB ||
+ nSlotId == SID_EXPORTDOCASEPUB || nSlotId == SID_DIRECTEXPORTDOCASEPUB ||
nSlotId == SID_SAVEACOPYITEM);
}
@@ -1331,7 +1331,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
if ( nSlotId == SID_OPENDOC || nSlotId == SID_EXPORTDOC || nSlotId == SID_SAVEASDOC || nSlotId == SID_SAVEDOC ||
nSlotId == SID_SAVETO || nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF ||
- nSlotId == SID_EXPORTDOCASEPUB ||
+ nSlotId == SID_EXPORTDOCASEPUB || nSlotId == SID_DIRECTEXPORTDOCASEPUB ||
nSlotId == SID_SAVEACOPY )
{
const SfxPoolItem *pItem=nullptr;
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;
}