[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - kit/ChildSession.cpp
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 1 14:18:28 UTC 2019
kit/ChildSession.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit f0799ce78e8df8f7da92181ec732648e6d4e1976
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 16:18:09 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>
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index d0029fb71..63307d414 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -866,8 +866,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