Bläddra i källkod

fix view MS Office

Marino Faggiana 6 år sedan
förälder
incheckning
8febb0161b
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      iOSClient/Main/CCDetail.m

+ 5 - 1
iOSClient/Main/CCDetail.m

@@ -277,7 +277,6 @@
 - (void)viewDocument
 {
     CGFloat safeAreaBottom = 0;
-    NSString *fileNamePath = [CCUtility getDirectoryProviderStorageFileID:self.metadataDetail.fileID fileName:self.metadataDetail.fileNameView];
     
     if (@available(iOS 11, *)) {
         safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
@@ -289,6 +288,11 @@
         return;
     }
     
+    NSString *fileNamePath = [NSTemporaryDirectory() stringByAppendingString:self.metadataDetail.fileNameView];
+    
+    [[NSFileManager defaultManager] removeItemAtPath:fileNamePath error:nil];
+    [[NSFileManager defaultManager] linkItemAtPath:[CCUtility getDirectoryProviderStorageFileID:self.metadataDetail.fileID fileName:self.metadataDetail.fileNameView] toPath:fileNamePath error:nil];
+    
     NSURL *url = [NSURL fileURLWithPath:fileNamePath];
 
     WKPreferences *wkPreferences = [[WKPreferences alloc] init];