Bugzilla – Attachment 161493 Details for
Bug 133278
Export as ODF doesn't work on iOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patch
0001-tdf-133278-WIP-Attempt-to-fix-problem-but-does-not-w.patch (text/plain), 3.95 KB, created by
How can I remove my account?
on 2020-06-01 13:57:59 UTC
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
How can I remove my account?
Created:
2020-06-01 13:57:59 UTC
Size:
3.95 KB
patch
obsolete
>From c4f102493898c63b56d89590dae9cd05bd133d81 Mon Sep 17 00:00:00 2001 >From: Tor Lillqvist <tml@collabora.com> >Date: Mon, 1 Jun 2020 16:54:36 +0300 >Subject: [PATCH] tdf#133278: WIP: Attempt to fix problem, but does not work > >Change-Id: I3d2292414a3c824515ba6d98ad09b296e543cea9 >--- > ios/Mobile/DocumentViewController.mm | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > >diff --git a/ios/Mobile/DocumentViewController.mm b/ios/Mobile/DocumentViewController.mm >index 54932be3f..0a146a691 100644 >--- a/ios/Mobile/DocumentViewController.mm >+++ b/ios/Mobile/DocumentViewController.mm >@@ -16,6 +16,7 @@ > #import <objc/runtime.h> > > #import <poll.h> >+#import <sys/stat.h> > > #import "ios.h" > #import "FakeSocket.hpp" >@@ -465,8 +466,13 @@ - (void)userContentController:(WKUserContentController *)userContentController d > // First save it in the requested format to a temporary location. First remove any > // leftover identically named temporary file. > >+ NSURL *tmpFileDirectory = [[NSFileManager.defaultManager temporaryDirectory] URLByAppendingPathComponent:@"tmp.export"]; >+ if (![NSFileManager.defaultManager createDirectoryAtURL:tmpFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]) { >+ LOG_ERR("Could not create directory " << [[tmpFileDirectory path] UTF8String]); >+ return; >+ } > NSString *tmpFileName = [[[self.document->copyFileURL lastPathComponent] stringByDeletingPathExtension] stringByAppendingString:[@"." stringByAppendingString:format]]; >- downloadAsTmpURL = [[NSFileManager.defaultManager temporaryDirectory] URLByAppendingPathComponent:tmpFileName]; >+ downloadAsTmpURL = [tmpFileDirectory URLByAppendingPathComponent:tmpFileName]; > > std::remove([[downloadAsTmpURL path] UTF8String]); > >@@ -479,15 +485,15 @@ - (void)userContentController:(WKUserContentController *)userContentController d > struct stat statBuf; > if (stat([[downloadAsTmpURL path] UTF8String], &statBuf) == -1) { > LOG_ERR("Could apparently not save to '" << [[downloadAsTmpURL path] UTF8String] << "'"); >- } else { >- UIDocumentPickerViewController *picker = >- [[UIDocumentPickerViewController alloc] initWithURL:downloadAsTmpURL >- inMode:UIDocumentPickerModeExportToService]; >- picker.delegate = self; >- [self presentViewController:picker >- animated:YES >- completion:nil]; >+ return; > } >+ UIDocumentPickerViewController *picker = >+ [[UIDocumentPickerViewController alloc] initWithURL:downloadAsTmpURL >+ inMode:UIDocumentPickerModeExportToService]; >+ picker.delegate = self; >+ [self presentViewController:picker >+ animated:YES >+ completion:nil]; > return; > } > } >@@ -504,10 +510,12 @@ - (void)userContentController:(WKUserContentController *)userContentController d > > - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls { > std::remove([[downloadAsTmpURL path] UTF8String]); >+ std::remove([[[downloadAsTmpURL URLByDeletingLastPathComponent] path] UTF8String]); > } > > - (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller { > std::remove([[downloadAsTmpURL path] UTF8String]); >+ std::remove([[[downloadAsTmpURL URLByDeletingLastPathComponent] path] UTF8String]); > } > > - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view { >-- >2.24.3 (Apple Git-128) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 133278
: 161493