diff options
-rwxr-xr-x | ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift index ddfd77d2c301..a03ec08f38ef 100755 --- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift +++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift @@ -19,11 +19,23 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC // this is normal functions every controller must implement + // holds known document types + var KnownDocumentTypes : [String] = [] + // called once controller is loaded override func viewDidLoad() { super.viewDidLoad() + + // loading known document types, so we can use them for the open call + let path = Bundle.main.path(forResource: "Info", ofType: "plist") + let plist = NSDictionary(contentsOfFile: path!) + for dict in (plist!.object(forKey: "UTExportedTypeDeclarations") as! [NSDictionary]) + + (plist!.object(forKey: "UTImportedTypeDeclarations") as! [NSDictionary]) { + let x = ((dict["UTTypeTagSpecification"] as! NSDictionary)["public.filename-extension"] as! NSArray) + KnownDocumentTypes.append( x[0] as! String ) + } } |