kit/ChildSession.cpp |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit f0799ce78e8df8f7da92181ec732648e6d4e1976
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Tue Oct 1 16:38:35 2019 +0300
Commit:     Tor Lillqvist <[email protected]>
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 <[email protected]>
    Reviewed-by: Tor Lillqvist <[email protected]>
    Tested-by: Tor Lillqvist <[email protected]>

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
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to