loleaflet/src/control/Control.Menubar.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
New commits: commit 9a6d3561e05480533c4b3d96c812d4e89b2048d2 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Thu Jul 2 16:00:14 2020 +0530 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sun Jul 5 10:42:56 2020 +0200 leaflet: Removed impress download options from drawing doc Change-Id: Iaddc3f8330733ec89af0cb0ec6ed14d1f51999ff Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97740 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit 32185682de346c9a729a2ef2efb0d66713a6a84d) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97800 Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 63278bf62..3eea9a713 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -257,9 +257,11 @@ L.Control.Menubar = L.Control.extend({ {name: _('See revision history'), id: 'rev-history', type: 'action'}, {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [ {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, - {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, - {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}]}, + {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action', drawing: false}, + {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false}, + {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action', drawing: false}, + {name: _('ODF Drawing (.odg)'), id: 'downloadas-odg', type: 'action'} + ]}, {type: 'separator'}, {name: _('Close document'), id: 'closedocument', type: 'action'} ]}, @@ -538,9 +540,10 @@ L.Control.Menubar = L.Control.extend({ ]}, {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [ {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, - {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, - {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}, + {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action', drawing: false}, + {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false}, + {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action', drawing: false}, + {name: _('ODF Drawing (.odg)'), id: 'downloadas-odg', type: 'action'} ]}, {name: _UNO('.uno:EditMenu', 'presentation'), id: 'editmenu', type: 'menu', menu: [ {uno: '.uno:Undo'}, @@ -1384,6 +1387,12 @@ L.Control.Menubar = L.Control.extend({ if (menuItem.id === 'changesmenu' && this._map['wopi'].HideChangeTrackingControls) return false; + if (menuItem.drawing === false && this._map.getDocType() === 'drawing') + return false; + + if (menuItem.id === 'downloadas-odg' && !this._map['wopi'].BaseFileName.endsWith('.odg')) + return false; + // Keep track of all 'downloadas-' options and register them as // export formats with docLayer which can then be publicly accessed unlike // this Menubar control for which there doesn't seem to be any easy way _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits