[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 1 20:33:22 UTC 2019


 kit/ChildSession.cpp                     |    7 +++++--
 loleaflet/src/control/Control.Menubar.js |   19 ++++++++++++++++---
 2 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit 078c9f2848033355b9f32eae72e86e4fbe7fc32f
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Oct 1 16:34:17 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Oct 1 22:33:18 2019 +0200

    tdf#127669: Add more export formats for mobile apps
    
    The same formats are offered as for "Download as" in web-based Online.
    But in the apps, the menu entry is called "Export as", not "Download
    as", because the document is not being edited on some server from
    which it would be downloaded.
    
    Change-Id: I5b1bfc3300bae2c213812c2534ae6b583423662c
    Reviewed-on: https://gerrit.libreoffice.org/79964
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit c7bfc05dcb1c475c1bf9a70d39732790793380d9)
    Reviewed-on: https://gerrit.libreoffice.org/80000

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index dd2e92287..b1f08a722 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -27,7 +27,12 @@ L.Control.Menubar = L.Control.extend({
 					{name: _('Word 2003 Document (.doc)'), id: 'downloadas-doc', type: 'action'},
 					{name: _('Word Document (.docx)'), id: 'downloadas-docx', type: 'action'},
 					{name: _('Rich Text (.rtf)'), id: 'downloadas-rtf', type: 'action'}]},
-				{name: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'},
+				{name: _('Export as'), id: 'downloadas', type: 'menu', mobileapp: true, menu: [
+					{name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'},
+					{name: _('ODF text document (.odt)'), id: 'downloadas-odt', type: 'action'},
+					{name: _('Word 2003 Document (.doc)'), id: 'downloadas-doc', type: 'action'},
+					{name: _('Word Document (.docx)'), id: 'downloadas-docx', type: 'action'},
+					{name: _('Rich Text (.rtf)'), id: 'downloadas-rtf', type: 'action'}]},
 				{name: _('Sign document'), id: 'signdocument', type: 'action'},
 				{type: 'separator'},
 				{name: _('Close document'), id: 'closedocument', type: 'action'}
@@ -255,7 +260,11 @@ L.Control.Menubar = L.Control.extend({
 					{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: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'},
+				{name: _('Export as'), id: 'downloadas', type: 'menu', mobileapp: true, 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'}]},
 				{type: 'separator'},
 				{name: _('Close document'), id: 'closedocument', type: 'action'}
 			]},
@@ -346,7 +355,11 @@ L.Control.Menubar = L.Control.extend({
 					{name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'},
 					{name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type: 'action'},
 					{name: _('Excel Spreadsheet (.xlsx)'), id: 'downloadas-xlsx', type: 'action'}]},
-				{name: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'},
+				{name: _('Export as'), id:'downloadas', type: 'menu', mobileapp: true, menu: [
+					{name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'},
+					{name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'},
+					{name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type: 'action'},
+					{name: _('Excel Spreadsheet (.xlsx)'), id: 'downloadas-xlsx', type: 'action'}]},
 				{type: 'separator'},
 				{name: _('Close document'), id: 'closedocument', type: 'action'}
 			]},
commit e4a763b2844f1115d54f4fec475ed0ff5e4b587f
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Oct 1 16:38:35 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Oct 1 22:33:03 2019 +0200

    tdf#127669: Implement "export as" in the iOS app in general, not just for PDF
    
    Change-Id: Ib0c20e3e818f498e0fe386676698b38358c84658
    Reviewed-on: https://gerrit.libreoffice.org/79965
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit f0799ce78e8df8f7da92181ec732648e6d4e1976)
    Reviewed-on: https://gerrit.libreoffice.org/79999

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 815a8c54d..2880e73d0 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -885,8 +885,11 @@ bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, const std:
     NSArray<NSString *> *pathComponents = [[NSURL URLWithString:[NSString stringWithUTF8String:getDocURL().c_str()]] pathComponents];
     NSString *baseName = [[pathComponents lastObject] stringByDeletingPathExtension];
     NSURL *documentDirectory = [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0];
-    NSURL *pdfURL = [documentDirectory URLByAppendingPathComponent:[baseName stringByAppendingString:@".pdf"]];
-    getLOKitDocument()->saveAs([[pdfURL absoluteString] UTF8String],
+    NSString *dotFormat = [@"." stringByAppendingString:[NSString stringWithUTF8String:format.c_str()]];
+    NSURL *exportedURL = [documentDirectory URLByAppendingPathComponent:[baseName stringByAppendingString:dotFormat]];
+    LOG_TRC("Exporting as " << [[exportedURL absoluteString] UTF8String]);
+
+    getLOKitDocument()->saveAs([[exportedURL absoluteString] UTF8String],
                                format.empty() ? nullptr : format.c_str(),
                                filterOptions.empty() ? nullptr : filterOptions.c_str());
 #else


More information about the Libreoffice-commits mailing list