mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] fix bug 54685
This commit is contained in:
@ -90,6 +90,22 @@
|
||||
//
|
||||
// return event;
|
||||
// }];
|
||||
|
||||
NSArray * arguments = [[NSProcessInfo processInfo] arguments];
|
||||
for (NSString * arg in arguments) {
|
||||
if ( [arg hasPrefix:@"--new:"] || [arg hasPrefix:@"--new="] ) {
|
||||
NSString * param = [arg substringFromIndex:6];
|
||||
NSLog(@"input arg new: %@", param);
|
||||
|
||||
if ( [@[@"word",@"cell",@"slide",@"form"] containsObject:param] ) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab
|
||||
object:nil
|
||||
userInfo:@{ @"action" : @(ASCTabActionCreateLocalFile),
|
||||
@"type" : param,
|
||||
@"active" : @(YES) }];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// If your delegate implements this method, AppKit does not call the application(_:openFile:)
|
||||
|
||||
@ -1674,8 +1674,15 @@
|
||||
}
|
||||
|
||||
case ASCTabActionCreateLocalFile: {
|
||||
int docType = [tab.params[@"type"] intValue];
|
||||
|
||||
int docType = CEFDocumentDocument;
|
||||
if ( [tab.params[@"type"] isKindOfClass:[NSString class]] ) {
|
||||
NSString * param = tab.params[@"type"];
|
||||
if ([param isEqualToString:@"cell"]) docType = CEFDocumentSpreadsheet;
|
||||
else if ([param isEqualToString:@"slide"]) docType = CEFDocumentPresentation;
|
||||
else if ([param isEqualToString:@"form"]) docType = CEFDocumentForm;
|
||||
else /*if ([param isEqualToString:@"word"])*/ docType = CEFDocumentDocument;
|
||||
} else docType = [tab.params[@"type"] intValue];
|
||||
|
||||
NSString * docName = NSLocalizedString(@"Untitled", nil);
|
||||
|
||||
switch (docType) {
|
||||
|
||||
Reference in New Issue
Block a user