[Libreoffice-commits] online.git: ios/Mobile

2020-09-30 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d0edfeabbdc969a9a66cf90976a63c2f4403a6d3
Author: Tor Lillqvist 
AuthorDate: Wed Sep 30 17:00:11 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 30 21:57:11 2020 +0200

tdf#133279: Use CollaboraOnlineWebViewKeyboardManager also for hw keyboards

In theory, this doesn't make sense. In practice, it helps.

Change-Id: I34d03a812c543e1b112851c9e9ff512f2482a20c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103714
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 5be21cd0f..53b2d4488 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -102,10 +102,8 @@ static IMP standardImpOfInputAccessoryView = nil;
 // contents is handled fully in JavaScript, the WebView has no knowledge 
of that.)
 self.webView.scrollView.delegate = self;
 
-if (!isExternalKeyboardAttached()) {
-keyboardManager =
-[[CollaboraOnlineWebViewKeyboardManager alloc] 
initForWebView:self.webView];
-}
+keyboardManager =
+[[CollaboraOnlineWebViewKeyboardManager alloc] 
initForWebView:self.webView];
 
 [self.view addSubview:self.webView];
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-09-28 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2375cccad50634a56f21aa85df9ed283398db891
Author: Tor Lillqvist 
AuthorDate: Mon Sep 28 17:34:13 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Sep 28 17:34:39 2020 +0300

Change CFBundleShortVersionString to 6.4.0

Change-Id: I953474692323b52a87994e8b30f4a4ea87ce859f

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index eb4b08e9b..3428b52bd 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -214,7 +214,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
-   4.2.6
+   6.4.0
CFBundleVersion
@IOSAPP_BUNDLE_VERSION@
LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-09-11 Thread Andras Timar (via logerrit)
 dev/null |binary
 ios/Mobile/Resources/Templates/Blank.otp |binary
 ios/Mobile/Resources/Templates/Blank.otp.png |binary
 ios/Mobile/Resources/Templates/Blank.ots |binary
 ios/Mobile/Resources/Templates/Blank.ots.png |binary
 ios/Mobile/Resources/Templates/Blank.ott |binary
 ios/Mobile/Resources/Templates/Blank.ott.png |binary
 7 files changed

New commits:
commit 209313f41c81c2b45218574535b39d668ae832bb
Author: Andras Timar 
AuthorDate: Wed Sep 9 10:37:10 2020 +0200
Commit: Andras Timar 
CommitDate: Fri Sep 11 10:05:38 2020 +0200

Very minimal empty ODF templates for iOS

These files contain no data at all. This guarantees that when the
user opens a new document in the app, the language of paragraph,
page size, cell date format, currency, etc. will be according to
the current locale.

Change-Id: If1804ad4c63b8eb76c229a9e683d207191c385c5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102284
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/ios/Mobile/Resources/Templates/Blank (A4).ott 
b/ios/Mobile/Resources/Templates/Blank (A4).ott
deleted file mode 100644
index 98a75d538..0
Binary files a/ios/Mobile/Resources/Templates/Blank (A4).ott and /dev/null 
differ
diff --git a/ios/Mobile/Resources/Templates/Blank (A4).ott.png 
b/ios/Mobile/Resources/Templates/Blank (A4).ott.png
deleted file mode 100644
index 055df5e94..0
Binary files a/ios/Mobile/Resources/Templates/Blank (A4).ott.png and /dev/null 
differ
diff --git a/ios/Mobile/Resources/Templates/Blank (widescreen).otp 
b/ios/Mobile/Resources/Templates/Blank (widescreen).otp
deleted file mode 100644
index 93ee3a917..0
Binary files a/ios/Mobile/Resources/Templates/Blank (widescreen).otp and 
/dev/null differ
diff --git a/ios/Mobile/Resources/Templates/Blank (widescreen).otp.png 
b/ios/Mobile/Resources/Templates/Blank (widescreen).otp.png
deleted file mode 100644
index e4e7254f2..0
Binary files a/ios/Mobile/Resources/Templates/Blank (widescreen).otp.png and 
/dev/null differ
diff --git a/ios/Mobile/Resources/Templates/Blank.otp 
b/ios/Mobile/Resources/Templates/Blank.otp
index 0c7d486cd..ccba6e40d 100644
Binary files a/ios/Mobile/Resources/Templates/Blank.otp and 
b/ios/Mobile/Resources/Templates/Blank.otp differ
diff --git a/ios/Mobile/Resources/Templates/Blank.otp.png 
b/ios/Mobile/Resources/Templates/Blank.otp.png
index da2dc775c..985c2118c 100644
Binary files a/ios/Mobile/Resources/Templates/Blank.otp.png and 
b/ios/Mobile/Resources/Templates/Blank.otp.png differ
diff --git a/ios/Mobile/Resources/Templates/Blank.ots 
b/ios/Mobile/Resources/Templates/Blank.ots
index 9da8db435..20756df20 100644
Binary files a/ios/Mobile/Resources/Templates/Blank.ots and 
b/ios/Mobile/Resources/Templates/Blank.ots differ
diff --git a/ios/Mobile/Resources/Templates/Blank.ots.png 
b/ios/Mobile/Resources/Templates/Blank.ots.png
index c176b1e22..b248e433d 100644
Binary files a/ios/Mobile/Resources/Templates/Blank.ots.png and 
b/ios/Mobile/Resources/Templates/Blank.ots.png differ
diff --git a/ios/Mobile/Resources/Templates/Blank.ott 
b/ios/Mobile/Resources/Templates/Blank.ott
new file mode 100644
index 0..d15474453
Binary files /dev/null and b/ios/Mobile/Resources/Templates/Blank.ott differ
diff --git a/ios/Mobile/Resources/Templates/Blank.ott.png 
b/ios/Mobile/Resources/Templates/Blank.ott.png
new file mode 100644
index 0..241c5d694
Binary files /dev/null and b/ios/Mobile/Resources/Templates/Blank.ott.png differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-07-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/AppDelegate.mm |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit 377e9266c9cd18de3e39032f79f9d2d544b72e7b
Author: Tor Lillqvist 
AuthorDate: Thu Jul 23 19:11:29 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Jul 23 19:18:55 2020 +0300

tdf#134832: Clear the cache directory if it is for another version of the 
app

We don't want to use cached scaled icons (and other stuff that might
be in the cache?) if from a potentially incompatible version of the
app. Store the core and online hashes in files in the cache to be able
to compare.

Change-Id: I593ece5dae71f91f204d4c040bd9f744b3bc498f

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index d6962b840..207d59393 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -191,6 +191,37 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 Log::initialize("Mobile", trace, false, false, {});
 Util::setThreadName("main");
 
+// Clear the cache directory if it is for another build of the app
+NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
NSUserDomainMask, YES);
+NSString *userDirectory = [paths objectAtIndex:0];
+NSString *cacheDirectory = [userDirectory 
stringByAppendingPathComponent:@"cache"];
+
+NSString *coreVersionHashFile = [cacheDirectory 
stringByAppendingPathComponent:@"core_version_hash"];
+NSString *loolwsdVersionHashFile = [cacheDirectory 
stringByAppendingPathComponent:@"loolwsd_version_hash"];
+
+NSData *oldCoreVersionHash = [NSData 
dataWithContentsOfFile:coreVersionHashFile];
+NSData *oldLoolwsdVersionHash = [NSData 
dataWithContentsOfFile:loolwsdVersionHashFile];
+
+NSData *coreVersionHash = [NSData dataWithBytes:CORE_VERSION_HASH 
length:strlen(CORE_VERSION_HASH)];
+NSData *loolwsdVersionHash = [NSData dataWithBytes:LOOLWSD_VERSION_HASH 
length:strlen(LOOLWSD_VERSION_HASH)];
+
+if (oldCoreVersionHash == nil
+|| ![oldCoreVersionHash isEqualToData:coreVersionHash]
+|| oldLoolwsdVersionHash == nil
+|| ![oldLoolwsdVersionHash isEqualToData:loolwsdVersionHash]) {
+
+[[NSFileManager defaultManager] removeItemAtPath:cacheDirectory 
error:nil];
+
+if (![[NSFileManager defaultManager] 
createDirectoryAtPath:cacheDirectory withIntermediateDirectories:NO 
attributes:nil error:nil])
+NSLog(@"Could not create %@", cacheDirectory);
+
+if (![[NSFileManager defaultManager] 
createFileAtPath:coreVersionHashFile contents:coreVersionHash attributes:nil])
+NSLog(@"Could not create %@", coreVersionHashFile);
+
+if (![[NSFileManager defaultManager] 
createFileAtPath:loolwsdVersionHashFile contents:loolwsdVersionHash 
attributes:nil])
+NSLog(@"Could not create %@", loolwsdVersionHashFile);
+}
+
 // Having LANG in the environment is expected to happen only when 
debugging from Xcode. When
 // testing some language one doesn't know it might be risky to simply set 
one's iPad to that
 // language, as it might be hard to find the way to set it back to a known 
language.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-07-14 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/AppDelegate.mm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ef7e79a20b1ad487164eabe827092ed1da294690
Author: Tor Lillqvist 
AuthorDate: Tue Jul 14 16:46:40 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jul 14 16:55:12 2020 +0200

Use LOG_INF_NOFILE() for the FakeSocket logging callbacks

(Why not call LOG_INF directly in FakeSocket.cpp instead? Good
question. I guess my idea was originally to keep FakeSocket separately
testable without all the Online logging stuff.)

Change-Id: I1e6b730a9742ad653d431774d88fec6a36d98850
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98736
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index c98211205..d6962b840 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -249,7 +249,7 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 
 fakeSocketSetLoggingCallback([](const std::string& line)
  {
- LOG_INF(line);
+ LOG_INF_NOFILE(line);
  });
 
 dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 
0),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-07-07 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/CODocument.mm |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit ea4a6575731fb261d0557feba668fa087d5764b9
Author: Tor Lillqvist 
AuthorDate: Tue Jul 7 16:13:25 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jul 7 16:01:19 2020 +0200

Use a separate temp directory for each document during the iOS app lifetime

This prevents an assertion failure when you quickly open the same
document again after closing it.

Change-Id: I26b8c53d57bd1d33f0473a3c5a332ec02c37455d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98263
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/CODocument.mm b/ios/Mobile/CODocument.mm
index c12bd2e91..d25c7ded7 100644
--- a/ios/Mobile/CODocument.mm
+++ b/ios/Mobile/CODocument.mm
@@ -56,7 +56,14 @@ static std::atomic appDocIdCounter(1);
 
 fakeClientFd = fakeSocketSocket();
 
-copyFileURL = [[[NSFileManager defaultManager] temporaryDirectory] 
URLByAppendingPathComponent:[[[self fileURL] path] lastPathComponent]];
+appDocId = appDocIdCounter++;
+NSURL *copyFileDirectory = [[NSFileManager.defaultManager 
temporaryDirectory] URLByAppendingPathComponent:[NSString 
stringWithFormat:@"%d", appDocId]];
+if (![NSFileManager.defaultManager createDirectoryAtURL:copyFileDirectory 
withIntermediateDirectories:YES attributes:nil error:nil]) {
+LOG_ERR("Could not create directory " << [[copyFileDirectory path] 
UTF8String]);
+return NO;
+}
+
+copyFileURL = [copyFileDirectory URLByAppendingPathComponent:[[[self 
fileURL] path] lastPathComponent]];
 
 NSError *error;
 [[NSFileManager defaultManager] removeItemAtURL:copyFileURL error:nil];
@@ -66,7 +73,6 @@ static std::atomic appDocIdCounter(1);
 
 NSURL *url = [[NSBundle mainBundle] URLForResource:@"loleaflet" 
withExtension:@"html"];
 NSURLComponents *components = [NSURLComponents componentsWithURL:url 
resolvingAgainstBaseURL:NO];
-appDocId = appDocIdCounter++;
 allocateDocumentDataForMobileAppDocId(appDocId).coDocument = self;
 components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"file_path" 
value:[copyFileURL absoluteString]],
[NSURLQueryItem 
queryItemWithName:@"closebutton" value:@"1"],
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-06-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9c517608be297e938caebeb122c2e31c56bae7cc
Author: Tor Lillqvist 
AuthorDate: Tue Jun 23 16:46:10 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jun 23 16:46:13 2020 +0300

Bump the internal iOS app version to 4.2.6

Build 4.2.5 (57) was released (as 4.2.4).

Change-Id: I76a49b7851c2d8fa68f623c08ae211d2ac549d26

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 2b716ded1..54d68f36c 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -214,7 +214,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
-   4.2.4
+   4.2.6
CFBundleVersion
@IOSAPP_BUNDLE_VERSION@
LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-06-01 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |   26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 2bd05d68f790b3ca278d39da8f6b062666df8cf9
Author: Tor Lillqvist 
AuthorDate: Mon Jun 1 16:54:36 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 1 17:08:38 2020 +0200

tdf#133278: Don't overwrite the copy of the document that we are editing

When exporting a copy, let core write the copy to a temp subdirectory
before invoking UIDocumentPickerViewController to select where to
store it permanently.

Change-Id: I3d2292414a3c824515ba6d98ad09b296e543cea9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95295
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 54932be3f..c94161c02 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -16,6 +16,7 @@
 #import 
 
 #import 
+#import 
 
 #import "ios.h"
 #import "FakeSocket.hpp"
@@ -465,8 +466,13 @@ static IMP standardImpOfInputAccessoryView = nil;
 // 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:@"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 @@ static IMP standardImpOfInputAccessoryView = nil;
 struct stat statBuf;
 if (stat([[downloadAsTmpURL path] UTF8String], ) == 
-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 @@ static IMP standardImpOfInputAccessoryView = nil;
 
 - (void)documentPicker:(UIDocumentPickerViewController *)controller 
didPickDocumentsAtURLs:(NSArray *)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 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-04-28 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/AppDelegate.mm |1 -
 1 file changed, 1 deletion(-)

New commits:
commit fe9edb5e8bdb68f34a9bc18f01dd7738d0c1a0f1
Author: Tor Lillqvist 
AuthorDate: Tue Apr 28 18:50:52 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Apr 28 22:13:16 2020 +0200

Bin leftover unused variable

Change-Id: I21eaec0f070698db119d396f4b24c6d3b785c1f3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93107
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 074230ff8..b76158806 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -33,7 +33,6 @@
 static LOOLWSD *loolwsd = nullptr;
 
 NSString *app_locale;
-BOOL empty_tile_cache;
 
 static void download(NSURL *source, NSURL *destination) {
 [[[NSURLSession sharedSession] downloadTaskWithURL:source
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile kit/ChildSession.cpp

2020-04-13 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |   51 +-
 kit/ChildSession.cpp |   52 +--
 2 files changed, 52 insertions(+), 51 deletions(-)

New commits:
commit 909734e2615cdf259f26ffde58696544859aca34
Author: Tor Lillqvist 
AuthorDate: Mon Apr 13 15:48:51 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Apr 13 15:35:13 2020 +0200

Implement the "download as" functionality properly in the iOS app

We need to catch the downloadas message already in
-[DocumentViewController
userContentController:didReceiveScriptMessage:] and use an
UIDocumentPickerViewController to let the user choose where to
download (or export) the document. The iOS-specific code in
ChildSession::downloadAs() can go away.

Change-Id: I626b9986ec6156f7e83bda02b04e65f7819f8017
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92112
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 97ac7ab96..54932be3f 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -28,8 +28,9 @@
 
 static DocumentViewController* theSingleton = nil;
 
-@interface DocumentViewController()  {
+@interface DocumentViewController()  {
 int closeNotificationPipeForForwardingThread[2];
+NSURL *downloadAsTmpURL;
 }
 
 @end
@@ -449,6 +450,46 @@ static IMP standardImpOfInputAccessoryView = nil;
 [application openURL:url options:@{} completionHandler:nil];
 return;
 }
+} else if ([message.body hasPrefix:@"downloadas "]) {
+NSArray *messageBodyItems = [message.body 
componentsSeparatedByString:@" "];
+NSString *format = nil;
+if ([messageBodyItems count] >= 2) {
+for (int i = 1; i < [messageBodyItems count]; i++) {
+if ([messageBodyItems[i] hasPrefix:@"format="])
+format = [messageBodyItems[i] 
substringFromIndex:[@"format=" length]];
+}
+
+if (format == nil)
+return; // Warn?
+
+// First save it in the requested format to a temporary 
location. First remove any
+// leftover identically named temporary file.
+
+NSString *tmpFileName = [[[self.document->copyFileURL 
lastPathComponent] stringByDeletingPathExtension] stringByAppendingString:[@"." 
stringByAppendingString:format]];
+downloadAsTmpURL = [[NSFileManager.defaultManager 
temporaryDirectory] URLByAppendingPathComponent:tmpFileName];
+
+std::remove([[downloadAsTmpURL path] UTF8String]);
+
+lok_document->saveAs([[downloadAsTmpURL absoluteString] 
UTF8String], [format UTF8String], nullptr);
+
+// Then verify that it indeed was saved, and then use an
+// UIDocumentPickerViewController to ask the user where to 
store the exported
+// document.
+
+struct stat statBuf;
+if (stat([[downloadAsTmpURL path] UTF8String], ) == 
-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;
+}
 }
 
 const char *buf = [message.body UTF8String];
@@ -461,6 +502,14 @@ static IMP standardImpOfInputAccessoryView = nil;
 }
 }
 
+- (void)documentPicker:(UIDocumentPickerViewController *)controller 
didPickDocumentsAtURLs:(NSArray *)urls {
+std::remove([[downloadAsTmpURL path] UTF8String]);
+}
+
+- (void)documentPickerWasCancelled:(UIDocumentPickerViewController 
*)controller {
+std::remove([[downloadAsTmpURL path] UTF8String]);
+}
+
 - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView 
*)view {
 scrollView.pinchGestureRecognizer.enabled = NO;
 }
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 534d6c2fb..edbe7e8c0 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -921,56 +921,8 @@ bool ChildSession::downloadAs(const char* /*buffer*/, int 
/*length*/, const Stri
 }
 
 #ifdef IOS
-NSURL *docURL = [NSURL URLWithString:[NSString 
stringWithUTF8String:getDocURL().c_str()]];
-
-#if 0
-// Experimentation
-
-// Check if we can figure out the name of the file provider service 

[Libreoffice-commits] online.git: ios/Mobile

2020-04-13 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 34c27a6b9b7ce8231c8459c8ef4b3952ff1293ef
Author: Tor Lillqvist 
AuthorDate: Mon Apr 13 11:00:46 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Apr 13 11:00:46 2020 +0300

Bump the internal iOS app version number to 4.2.4

Change-Id: I087b2ab81f4b3c8b3b85e9419743e5ce72dd398c

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index b210255bf..8971a6d7e 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -410,7 +410,7 @@
 CFBundlePackageType
 APPL
 CFBundleShortVersionString
-4.2.3
+4.2.4
 CFBundleVersion
 @IOSAPP_BUNDLE_VERSION@
 LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile wsd/DocumentBroker.cpp

2020-04-07 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/CODocument.h  |1 
 ios/Mobile/CODocument.mm |   20 +--
 ios/Mobile/DocumentViewController.mm |   36 +++
 wsd/DocumentBroker.cpp   |8 +++
 4 files changed, 35 insertions(+), 30 deletions(-)

New commits:
commit 0930286e2d8fd2ba1e4820758246ee3766040254
Author: Tor Lillqvist 
AuthorDate: Tue Apr 7 21:21:55 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 8 00:01:30 2020 +0200

Fix problems after my 293f4913d2cdfe5385e2cdc0e3bebde281da1578

It is enough to call the -[UIDocument
saveToURL:forSaveOperation:completionHandler:] only in
DocumentBroker::sendUnoSave(). And on the other hand, in
-[DocumentViewController bye] we can't want for the
LOOLWSD::lokit_main_mutex as the main queue is needed for parts of
what the saveToURL does.

Also, use a separate copy of the document as the file that is actually
edited by LO core. This matches what the Android app does. I think it
is useful to do this in order to avoid some hangs that I noticed. They
probably were caused by both LO core and the system frameworks
occasionally accessing the same document file at the same time.

Change-Id: Idb65be23a7cb6ad1288fbbd23c7471e0fb8d52f4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91851
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/CODocument.h b/ios/Mobile/CODocument.h
index 82e2e80e3..79f772a1b 100644
--- a/ios/Mobile/CODocument.h
+++ b/ios/Mobile/CODocument.h
@@ -18,6 +18,7 @@
 @interface CODocument : UIDocument {
 @public
 int fakeClientFd;
+NSURL *copyFileURL;
 }
 
 @property (weak) DocumentViewController *viewController;
diff --git a/ios/Mobile/CODocument.mm b/ios/Mobile/CODocument.mm
index 095d449ea..5dcd9b136 100644
--- a/ios/Mobile/CODocument.mm
+++ b/ios/Mobile/CODocument.mm
@@ -37,14 +37,7 @@
 @implementation CODocument
 
 - (id)contentsForType:(NSString*)typeName error:(NSError **)errorPtr {
-// Somehow this doesn't feel right, creating an NSFileWrapper around the 
file that was given to
-// us for loadFromContents. I get the vague feeling that the file is 
perhaps just a temporary
-// data container created by the system for us to be used while loading 
the document data, and
-// not the actual permanent document, especially in the case of things 
like NextCloud. Or is it?
-// Is saving back to the file (which we have already saved to in the core 
code by the time we
-// get here) correct? This does seem to work, though. Sadly the Apple 
documentation is a bit
-// lacking about how these things *really* work.
-return [[NSFileWrapper alloc] initWithURL:[self fileURL] options:0 
error:errorPtr];
+return [NSData dataWithContentsOfFile:[copyFileURL path] options:0 
error:errorPtr];
 }
 
 - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName 
error:(NSError **)errorPtr {
@@ -55,11 +48,18 @@
 return YES;
 
 fakeClientFd = fakeSocketSocket();
-NSString *uri = [[self fileURL] absoluteString];
+
+copyFileURL = [[[NSFileManager defaultManager] temporaryDirectory] 
URLByAppendingPathComponent:[[[self fileURL] path] lastPathComponent]];
+
+NSError *error;
+[[NSFileManager defaultManager] removeItemAtURL:copyFileURL error:nil];
+[[NSFileManager defaultManager] copyItemAtURL:[self fileURL] 
toURL:copyFileURL error:];
+if (error != nil)
+return NO;
 
 NSURL *url = [[NSBundle mainBundle] URLForResource:@"loleaflet" 
withExtension:@"html"];
 NSURLComponents *components = [NSURLComponents componentsWithURL:url 
resolvingAgainstBaseURL:NO];
-components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"file_path" 
value:uri],
+components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"file_path" 
value:[copyFileURL absoluteString]],
[NSURLQueryItem 
queryItemWithName:@"closebutton" value:@"1"],
[NSURLQueryItem queryItemWithName:@"permission" 
value:@"edit"],
[NSURLQueryItem queryItemWithName:@"lang" 
value:app_locale]
diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 94dbd839c..97ac7ab96 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -348,7 +348,7 @@ static IMP standardImpOfInputAccessoryView = nil;
 
 // First we simply send it the URL. This corresponds to the GET 
request with Upgrade to
 // WebSocket.
-std::string url([[[self.document fileURL] absoluteString] 
UTF8String]);
+std::string url([[self.document->copyFileURL absoluteString] 
UTF8String]);
 p.fd = self.document->fakeClientFd;
 p.events = POLLOUT;
 fakeSocketPoll(, 1, -1);
@@ -469,21 +469,25 @@ static IMP standardImpOfInputAccessoryView = 

[Libreoffice-commits] online.git: ios/Mobile

2020-04-06 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 312caf918b464556be0847d2c695a3a5a5e18388
Author: Tor Lillqvist 
AuthorDate: Mon Apr 6 12:36:03 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Apr 6 12:49:18 2020 +0200

Add comment

Change-Id: I452b1d6fc150d014a5d55df71e9dae96288e67de
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91740
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 7bd3bca6d..94dbd839c 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -469,6 +469,8 @@ static IMP standardImpOfInputAccessoryView = nil;
 // Close one end of the socket pair, that will wake up the forwarding 
thread above
 fakeSocketClose(closeNotificationPipeForForwardingThread[0]);
 
+// I suspect that what this will do (in -[CODocument 
contentsForType:error:]) is to read the
+// contents of the file that LO core already saved, and overwrite it with 
the same contents.
 [self.document saveToURL:[self.document fileURL]
 forSaveOperation:UIDocumentSaveForOverwriting
completionHandler:^(BOOL success) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-04-06 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/CODocument.mm |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 05a29a19d57957b48bfad6f65c776dc890aad6f8
Author: Tor Lillqvist 
AuthorDate: Mon Apr 6 12:33:41 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Apr 6 12:48:01 2020 +0200

Fix typo in comment and elaborate

Change-Id: I2e5560a27d8471188ebb159efd29192a10295547
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91739
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/CODocument.mm b/ios/Mobile/CODocument.mm
index 0a08d59f8..095d449ea 100644
--- a/ios/Mobile/CODocument.mm
+++ b/ios/Mobile/CODocument.mm
@@ -41,9 +41,9 @@
 // us for loadFromContents. I get the vague feeling that the file is 
perhaps just a temporary
 // data container created by the system for us to be used while loading 
the document data, and
 // not the actual permanent document, especially in the case of things 
like NextCloud. Or is it?
-// Is savng back to it (which we have already done by the time we get 
here, in the LO core code)
-// correct? This does seem to work, though. Anyway, clearly I need to read 
more documentation
-// for UIDocument etc.
+// Is saving back to the file (which we have already saved to in the core 
code by the time we
+// get here) correct? This does seem to work, though. Sadly the Apple 
documentation is a bit
+// lacking about how these things *really* work.
 return [[NSFileWrapper alloc] initWithURL:[self fileURL] options:0 
error:errorPtr];
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-04-03 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/AppDelegate.mm   |2 +-
 ios/Mobile/CODocument.h |2 +-
 ios/Mobile/CODocument.mm|6 +++---
 ios/Mobile/DocumentBrowserViewController.mm |4 ++--
 ios/Mobile/DocumentViewController.h |4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 95de5a74cce717cda5e1819761eead8e908b3dcf
Author: Tor Lillqvist 
AuthorDate: Sat Apr 4 00:04:20 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Sat Apr 4 00:07:35 2020 +0300

Rename our Objective-C Document class to CODocument

There are already several classes called Document on the C++ side.
Let's reduce confusion a bit. (Also, we might need to use the
Objective-C Document class from some of the Online C++ code (which is
actually compiled as Objective-C++).)

Change-Id: I34347ba0161c067b14bb125c3410eefd89bbca31

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 50f323883..074230ff8 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -21,8 +21,8 @@
 #import "ios.h"
 #import "AppDelegate.h"
 #import "DocumentBrowserViewController.h"
+#import "CODocument.h"
 #import "DocumentViewController.h"
-#import "Document.h"
 
 #import "FakeSocket.hpp"
 #import "Kit.hpp"
diff --git a/ios/Mobile/Document.h b/ios/Mobile/CODocument.h
similarity index 95%
rename from ios/Mobile/Document.h
rename to ios/Mobile/CODocument.h
index a843dc7f1..82e2e80e3 100644
--- a/ios/Mobile/Document.h
+++ b/ios/Mobile/CODocument.h
@@ -15,7 +15,7 @@
 
 @class DocumentViewController;
 
-@interface Document : UIDocument {
+@interface CODocument : UIDocument {
 @public
 int fakeClientFd;
 }
diff --git a/ios/Mobile/Document.mm b/ios/Mobile/CODocument.mm
similarity index 96%
rename from ios/Mobile/Document.mm
rename to ios/Mobile/CODocument.mm
index 3dba318d4..0a08d59f8 100644
--- a/ios/Mobile/Document.mm
+++ b/ios/Mobile/CODocument.mm
@@ -22,7 +22,7 @@
 
 #import "ios.h"
 #import "AppDelegate.h"
-#import "Document.h"
+#import "CODocument.h"
 #import "DocumentViewController.h"
 
 #import "ClientSession.hpp"
@@ -34,7 +34,7 @@
 #import "LOOLWSD.hpp"
 #import "Protocol.hpp"
 
-@implementation Document
+@implementation CODocument
 
 - (id)contentsForType:(NSString*)typeName error:(NSError **)errorPtr {
 // Somehow this doesn't feel right, creating an NSFileWrapper around the 
file that was given to
@@ -49,7 +49,7 @@
 
 - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName 
error:(NSError **)errorPtr {
 
-// If this method is called a second time on the same Document object, 
just ignore it. This
+// If this method is called a second time on the same CODocument object, 
just ignore it. This
 // seems to happen occastionally when the device is awakened after sleep. 
See tdf#122543.
 if (fakeClientFd >= 0)
 return YES;
diff --git a/ios/Mobile/DocumentBrowserViewController.mm 
b/ios/Mobile/DocumentBrowserViewController.mm
index bea28774a..92a9dedf0 100644
--- a/ios/Mobile/DocumentBrowserViewController.mm
+++ b/ios/Mobile/DocumentBrowserViewController.mm
@@ -9,8 +9,8 @@
 #import "config.h"
 
 #import "AppDelegate.h"
+#import "CODocument.h"
 #import "DocumentBrowserViewController.h"
-#import "Document.h"
 #import "DocumentViewController.h"
 #import "TemplateCollectionViewController.h"
 
@@ -67,7 +67,7 @@
 - (void)presentDocumentAtURL:(NSURL *)documentURL {
 UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" 
bundle:nil];
 DocumentViewController *documentViewController = [storyBoard 
instantiateViewControllerWithIdentifier:@"DocumentViewController"];
-documentViewController.document = [[Document alloc] 
initWithFileURL:documentURL];
+documentViewController.document = [[CODocument alloc] 
initWithFileURL:documentURL];
 documentViewController.document->fakeClientFd = -1;
 documentViewController.document.viewController = documentViewController;
 [self presentViewController:documentViewController animated:YES 
completion:nil];
diff --git a/ios/Mobile/DocumentViewController.h 
b/ios/Mobile/DocumentViewController.h
index 1f443b206..297255999 100644
--- a/ios/Mobile/DocumentViewController.h
+++ b/ios/Mobile/DocumentViewController.h
@@ -9,11 +9,11 @@
 #import 
 #import 
 
-#import "Document.h"
+#import "CODocument.h"
 
 @interface DocumentViewController : UIViewController
 
-@property (strong) Document *document;
+@property (strong) CODocument *document;
 @property (strong) WKWebView *webView;
 @property (strong) WKWebView *slideshowWebView;
 @property std::string slideshowFile;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-03-23 Thread Miklos Vajna (via logerrit)
 ios/Mobile/DocumentViewController.mm |8 
 1 file changed, 8 insertions(+)

New commits:
commit 6890d2fdaaa8671c335dfbdbf157aa153a1811a2
Author: Miklos Vajna 
AuthorDate: Mon Mar 23 14:39:27 2020 +0100
Commit: Miklos Vajna 
CommitDate: Mon Mar 23 17:33:45 2020 +0100

ios: fix opening hyperlinks

This was added in commit 2174206de1a8f5a87efef934b208c8b95db03447 (android:
Don't hang after returning from a hyperlink., 2020-02-14), but the new 
command
was only handled on Android. Handle HYPERLINK on iOS, too.

Change-Id: I8c942c1a64c8a52462a749989e312d0d9899a841
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90917
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 3bd967675..7bd3bca6d 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -441,6 +441,14 @@ static IMP standardImpOfInputAccessoryView = nil;
 }];
 
 return;
+} else if ([message.body hasPrefix:@"HYPERLINK"]) {
+NSArray *messageBodyItems = [message.body 
componentsSeparatedByString:@" "];
+if ([messageBodyItems count] >= 2) {
+NSURL *url = [[NSURL alloc] 
initWithString:messageBodyItems[1]];
+UIApplication *application = [UIApplication sharedApplication];
+[application openURL:url options:@{} completionHandler:nil];
+return;
+}
 }
 
 const char *buf = [message.body UTF8String];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-03-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 16fbe5441d83468967fec55666e42c08300304bc
Author: Tor Lillqvist 
AuthorDate: Mon Mar 23 12:54:46 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Mar 23 12:55:14 2020 +0200

Bump the internal iOS app version number to 4.2.3

Change-Id: I083ed1dd96aba75da1fc6d6d47c8cbd7b1d62a24

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 33517ab14..c5b9ea0df 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -410,7 +410,7 @@
 CFBundlePackageType
 APPL
 CFBundleShortVersionString
-4.2.2
+4.2.3
 CFBundleVersion
 @IOSAPP_BUNDLE_VERSION@
 LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-03-20 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 --
 1 file changed, 2 deletions(-)

New commits:
commit d474f060409328c1f40c63074396b1bc579de72e
Author: Tor Lillqvist 
AuthorDate: Fri Mar 20 16:02:08 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 20 16:03:19 2020 +0200

Force portrait for the moment also for iPhone in the iOS app

Change-Id: I1def28e7969cea753e7fc36094fe6514c17d61af

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 628e95e7b..33517ab14 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -430,8 +430,6 @@
 UISupportedInterfaceOrientations
 
 UIInterfaceOrientationPortrait
-UIInterfaceOrientationLandscapeLeft
-UIInterfaceOrientationLandscapeRight
 
 UISupportedInterfaceOrientations~ipad
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-03-11 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2004a0198d1727694d595501aec948f5cbb03f13
Author: Tor Lillqvist 
AuthorDate: Mon Mar 9 14:03:25 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Mar 11 14:08:36 2020 +0200

Bump the internal iOS app version number to 4.2.2

Otherwise, when one validates (or uploads) a new build, even just for
TestFlight purposes, one gets an error in Xcode: "The value for key
CFBundleShortVersionString [4.2.1] in the Info.plist file must contain
a higher version than that of the previously approved version
[4.2.1]."

(cherry picked from commit 585cf6be86c6535a9cf6b2ab45e9e606788433d2)

Change-Id: I2ea1342980384a8eb81312734747be5e686da347

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 291a77a83..628e95e7b 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -410,7 +410,7 @@
 CFBundlePackageType
 APPL
 CFBundleShortVersionString
-4.2.1
+4.2.2
 CFBundleVersion
 @IOSAPP_BUNDLE_VERSION@
 LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-02-21 Thread Andras Timar (via logerrit)
 ios/Mobile/Resources/Templates/Blank.ots |binary
 1 file changed

New commits:
commit fdc05239afedce42fb6403c0e73a932947bfd838
Author: Andras Timar 
AuthorDate: Fri Feb 21 10:30:59 2020 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 21 11:34:21 2020 +0100

Remove hardcoded tab name Sheet1 from iOS spreadsheet template

Change-Id: I0916e968b33395cf682bf4ddc313c959526e7adf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89171
Tested-by: Jenkins CollaboraOffice 
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/ios/Mobile/Resources/Templates/Blank.ots 
b/ios/Mobile/Resources/Templates/Blank.ots
index a7b96671f..ea7269b28 100644
Binary files a/ios/Mobile/Resources/Templates/Blank.ots and 
b/ios/Mobile/Resources/Templates/Blank.ots differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-02-19 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |   37 +--
 1 file changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 624b42d58a0dad5da0a3b45d2f5bc5da3f15398b
Author: Tor Lillqvist 
AuthorDate: Wed Feb 19 15:35:20 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Feb 19 15:17:56 2020 +0100

Hackaround for on-screen keyboard problem

We want to be able to force the on-screen keyboard to be displayed
(when there is no external hardware keyboard) from our JavaScript.

Change-Id: I0678d84ca941a03316ffb68cfd9c3e93a6ea7e57
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89023
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 8c97826e9..3bd967675 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -125,8 +125,41 @@ static IMP standardImpOfInputAccessoryView = nil;
 IMP oldImp = method_setImplementation(method, newImp);
 if (standardImpOfInputAccessoryView == nil)
 standardImpOfInputAccessoryView = oldImp;
-} else if (standardImpOfInputAccessoryView != nil) {
-method_setImplementation(method, standardImpOfInputAccessoryView);
+} else {
+// If the external keyboard has been disconnected, restore the normal 
behaviour.
+if (standardImpOfInputAccessoryView != nil) {
+method_setImplementation(method, standardImpOfInputAccessoryView);
+}
+
+// Hack to make the on-screen keyboard pop up more eagerly when focus 
set to the textarea
+// using JavaScript.
+
+// From 
https://stackoverflow.com/questions/32449870/programmatically-focus-on-a-form-in-a-webview-wkwebview/32845699
+
+static bool doneThisAlready = false;
+if (!doneThisAlready) {
+const char * methodSignature;
+doneThisAlready = true;
+
+if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: 
(NSOperatingSystemVersion){13, 0, 0}]) {
+methodSignature = 
"_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:";
+} else {
+methodSignature = 
"_elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:";
+}
+
+// Override that internal method with an own wrapper that always 
passes the
+// userIsInteracting parameter as TRUE. That will cause the 
on-screen keyboard to pop up
+// when we call the focus() method on the textarea element in 
JavaScript.
+SEL selector = sel_getUid(methodSignature);
+Method method = class_getInstanceMethod(webBrowserClass, selector);
+if (method != nil) {
+IMP original = method_getImplementation(method);
+IMP override = imp_implementationWithBlock(^void(id me, void* 
arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
+((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, 
id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
+});
+method_setImplementation(method, override);
+}
+}
 }
 
 WKWebView *webViewP = self.webView;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-02-13 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 58205c9818a92cbff36ba3252cdef9d8587c9256
Author: Tor Lillqvist 
AuthorDate: Thu Feb 13 16:13:17 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Feb 13 16:14:59 2020 +0200

Bump version to 4.2.1

As a build of 4.2 has been approved for release in the App Store, we must 
bump
this before any new build can be uploaded, even just for TestFlight.

Change-Id: I60de542eaf6d10776ad287c8c9c5d36e0feed70c

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 8738559fe..291a77a83 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -410,7 +410,7 @@
 CFBundlePackageType
 APPL
 CFBundleShortVersionString
-4.2
+4.2.1
 CFBundleVersion
 @IOSAPP_BUNDLE_VERSION@
 LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2020-01-31 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |   64 +++
 1 file changed, 64 insertions(+)

New commits:
commit 56d310636db734edcef75b07d266b93007472c45
Author: Tor Lillqvist 
AuthorDate: Fri Jan 31 15:29:12 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Jan 31 15:52:27 2020 +0100

tdf#129380: Don't show the "shortcut bar" if a hardware keyboard is used

Change-Id: If1138185e52b7240ff6190ddf3f7af01d2a47115
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87769
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 47d096553..a7731ced8 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -12,6 +12,9 @@
 #import 
 #import 
 
+#import 
+#import 
+
 #import 
 
 #import "ios.h"
@@ -30,8 +33,46 @@ static DocumentViewController* theSingleton = nil;
 
 @end
 
+// From https://gist.github.com/myell0w/d8dfabde43f8da543f9c
+static BOOL isExternalKeyboardAttached()
+{
+BOOL externalKeyboardAttached = NO;
+
+@try {
+NSString *keyboardClassName = [@[@"UI", @"Key", @"boa", @"rd", @"Im", 
@"pl"] componentsJoinedByString:@""];
+Class c = NSClassFromString(keyboardClassName);
+SEL sharedInstanceSEL = NSSelectorFromString(@"sharedInstance");
+if (c == Nil || ![c respondsToSelector:sharedInstanceSEL]) {
+return NO;
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+id sharedKeyboardInstance = [c performSelector:sharedInstanceSEL];
+#pragma clang diagnostic pop
+
+if (![sharedKeyboardInstance 
isKindOfClass:NSClassFromString(keyboardClassName)]) {
+return NO;
+}
+
+NSString *externalKeyboardSelectorName = [@[@"is", @"InH", @"ardw", 
@"areK", @"eyb", @"oard", @"Mode"] componentsJoinedByString:@""];
+SEL externalKeyboardSEL = 
NSSelectorFromString(externalKeyboardSelectorName);
+if (![sharedKeyboardInstance respondsToSelector:externalKeyboardSEL]) {
+return NO;
+}
+
+externalKeyboardAttached = ((BOOL ( *)(id, 
SEL))objc_msgSend)(sharedKeyboardInstance, externalKeyboardSEL);
+} @catch(__unused NSException *ex) {
+externalKeyboardAttached = NO;
+}
+
+return externalKeyboardAttached;
+}
+
 @implementation DocumentViewController
 
+static IMP standardImpOfInputAccessoryView = nil;
+
 - (void)viewDidLoad {
 [super viewDidLoad];
 
@@ -64,6 +105,29 @@ static DocumentViewController* theSingleton = nil;
 self.webView.navigationDelegate = self;
 self.webView.UIDelegate = self;
 
+// Hack for tdf#129380: Don't show the "shortcut bar" if a hardware 
keyboard is used.
+
+// From 
https://inneka.com/programming/objective-c/hide-shortcut-keyboard-bar-for-uiwebview-in-ios-9/
+Class webBrowserClass = NSClassFromString(@"WKContentView");
+Method method = class_getInstanceMethod(webBrowserClass, 
@selector(inputAccessoryView));
+
+if (isExternalKeyboardAttached()) {
+IMP newImp = imp_implementationWithBlock(^(id _s) {
+if ([self.webView 
respondsToSelector:@selector(inputAssistantItem)]) {
+UITextInputAssistantItem *inputAssistantItem = 
[self.webView inputAssistantItem];
+inputAssistantItem.leadingBarButtonGroups = @[];
+inputAssistantItem.trailingBarButtonGroups = @[];
+}
+return nil;
+});
+
+IMP oldImp = method_setImplementation(method, newImp);
+if (standardImpOfInputAccessoryView == nil)
+standardImpOfInputAccessoryView = oldImp;
+} else if (standardImpOfInputAccessoryView != nil) {
+method_setImplementation(method, standardImpOfInputAccessoryView);
+}
+
 WKWebView *webViewP = self.webView;
 NSDictionary *views = NSDictionaryOfVariableBindings(webViewP);
 [self.view addConstraints:[NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|-0-[webViewP(>=0)]-0-|"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2019-11-21 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 26860d8f35cd03fef582b6011c763993919d95f1
Author: Tor Lillqvist 
AuthorDate: Wed Nov 13 11:38:15 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Nov 21 10:24:17 2019 +0200

Add public.content to the UTTypeConformsTo arrays of the exported UTIs

The Nextcloud app looks for that.

Change-Id: I91d26f7dced0b0ca35275db7ebabf322e50e734d
(cherry picked from commit 481f498dfb31ad364c4dfae179c1a2baef8118ab)

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 972608c15..8738559fe 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -449,6 +449,7 @@
 UTTypeConformsTo
 
 public.data
+public.content
 
 UTTypeDescription
 OpenDocument Text
@@ -466,6 +467,7 @@
 UTTypeConformsTo
 
 public.data
+public.content
 
 UTTypeDescription
 OpenDocument Flat Text
@@ -481,6 +483,7 @@
 UTTypeConformsTo
 
 public.data
+public.content
 
 UTTypeDescription
 OpenDocument Spreadsheet
@@ -498,6 +501,7 @@
 UTTypeConformsTo
 
 public.data
+public.content
 
 UTTypeDescription
 OpenDocument Presentation
@@ -515,6 +519,7 @@
 UTTypeConformsTo
 
 public.data
+public.content
 
 UTTypeDescription
 Visio Document
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-11-04 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ed4558001fcab508f31773ddc0c3df7e2e8a7612
Author: Tor Lillqvist 
AuthorDate: Mon Nov 4 15:49:44 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Nov 4 15:24:41 2019 +0100

Set CFBundleShortVersionString to 4.2

Change-Id: I9115a9dc571c1b27e6b80181ec38732cb91ec799
Reviewed-on: https://gerrit.libreoffice.org/82019
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 5d4a759ba..972608c15 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -410,7 +410,7 @@
 CFBundlePackageType
 APPL
 CFBundleShortVersionString
-0.1
+4.2
 CFBundleVersion
 @IOSAPP_BUNDLE_VERSION@
 LSRequiresIPhoneOS
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-11-04 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0c9bc2159b2d81de2981444bb14024f507f664c5
Author: Tor Lillqvist 
AuthorDate: Mon Nov 4 14:06:07 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Nov 4 15:24:22 2019 +0100

Add LSSupportsOpeningDocumentsInPlace

Probably a good idea, although doesn't seem to have much effect? At
least not on tdf#128577.

Change-Id: I7b66a2e9ba44bd4cef583c0861883edfae11eb1d
Reviewed-on: https://gerrit.libreoffice.org/82006
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
(cherry picked from commit 2990203dff05f977dfdc77b493deca051b54ca79)
Reviewed-on: https://gerrit.libreoffice.org/82020

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index ecf7bf642..5d4a759ba 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -417,6 +417,8 @@
 
 UIFileSharingEnabled
 
+LSSupportsOpeningDocumentsInPlace
+
 UILaunchStoryboardName
 LaunchScreen
 UIMainStoryboardFile
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-10-10 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/TemplateCollectionViewController.mm |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 1cf3bec303bc8b3d10e5dd673731906d3704b7b3
Author: Tor Lillqvist 
AuthorDate: Thu Oct 10 19:03:50 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Oct 10 19:35:30 2019 +0300

tdf#123741: Call LibreOfficeKit::setLanguageTag() also when loading a 
template

Sadly I have no understanding why not doing that caused such a
mysterious end result. But I am glad I thought of trying this simple
thing before spending any more time trying to understand what is going
on.

Change-Id: I129f8fffa32fa087e21c444f9657394de0e255a1

diff --git a/ios/Mobile/TemplateCollectionViewController.mm 
b/ios/Mobile/TemplateCollectionViewController.mm
index a31f3a655..153fefb6f 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -6,6 +6,10 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#define LIBO_INTERNAL_ONLY
+#include 
+#include 
+
 #import "svtools/strings.hrc"
 
 #import 
@@ -137,9 +141,10 @@ static NSString *mapTemplateExtensionToActual(NSString 
*templateName) {
 NSURL *cacheDirectory = [NSFileManager.defaultManager 
URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask][0];
 NSURL *newURL = [cacheDirectory 
URLByAppendingPathComponent:mapTemplateExtensionToActual(selectedTemplate.lastPathComponent)
 isDirectory:NO];
-
 LibreOfficeKit *lo_kit = lok_init_2(nullptr, nullptr);
 
+
comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(OUString::fromUtf8(OString([app_locale
 UTF8String])), true));
+
 // Load the template into LibreOffice core, save as the corresponding 
document type (with the
 // same basename), and then proceed to edit that.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-10-09 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/AppDelegate.mm |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 39ddc5242d9378566626d9c3a73e9fda91d1129a
Author: Tor Lillqvist 
AuthorDate: Wed Oct 9 14:21:48 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Oct 9 14:30:20 2019 +0300

tdf#126974: When we are about to be killed, just exit bluntly

Letting the system call exit() will cause destructors of global C++
objects to be called, and doing that at an arbitrary point in time
will cause a crash. So just call std::_Exit() in the AppDelegate's
applicationWillTerminate: method.

Change-Id: I15d7a761db931a6b7aed588bb407fa0d3b4a9465
(cherry picked from commit 4c2cb838ff5fa2485ec74db11e239883a53f7ff9)

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 227c895eb..8b9badcc7 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -271,6 +271,9 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 }
 
 - (void)applicationWillTerminate:(UIApplication *)application {
+// tdf#126974 We don't want any global object destructors to be called, 
the code
+// is not prepared for that.
+std::_Exit(1);
 }
 
 - (BOOL)application:(UIApplication *)app openURL:(NSURL *)inputURL 
options:(NSDictionary *)options {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-10-05 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/DocumentViewController.mm |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0e49800418d26c0a213638bc693b3d01aa58909e
Author: Tor Lillqvist 
AuthorDate: Fri Oct 4 14:45:05 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Sat Oct 5 11:41:18 2019 +0300

tdf#127942: Avoid the WKWebView popup with "Share...", "Add to Photos" etc

Seems that setting allowsLinkPreview to NO for the WKWebView affects
this functionality, too. Was just an educated guess, and it worked!
Single-line fixes to what initially seems like a hard problem are the
best.

Change-Id: Ic88bf53b883d857338c0316188e079e6797a4d76
Reviewed-on: https://gerrit.libreoffice.org/80208
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
(cherry picked from commit c7e38e6348a98c0a6fcaf20876c57cb01d56f4cc)

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 6f1891b35..183e57250 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -44,6 +44,7 @@
 
 self.webView = [[WKWebView alloc] initWithFrame:CGRectZero 
configuration:configuration];
 self.webView.translatesAutoresizingMaskIntoConstraints = NO;
+self.webView.allowsLinkPreview = NO;
 
 // Prevent the WebView from scrolling. Sadly I couldn't figure out how to 
do it in the JS,
 // so the problem is still there when using Online from Mobile Safari.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-09-25 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Base.lproj/Main.storyboard |   17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit a04ddab0bf9a925142951fe6ab86f5c52757955c
Author: Tor Lillqvist 
AuthorDate: Wed Sep 25 17:20:24 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 25 18:00:30 2019 +0200

Set the Presentation of the Document View Controller to fullScreen

Otherwise, on iPadOS 13.1, the document will show up in a view that
doesn't cover all the screen, which looks weird, and also makes our
JavaScript code not realize it is on a tablet, so it uses the
phone-style UI, with toolbar at the bottom, no permanently visible
menu bar etc.

This also contains some other changes made by Xcode to the storyboard
file. The only intentional change was changing the Presentation to
"Full Screen", which added a modalPresentationStyle attribute to the
viewController element of the Document View Controller scene.

Change-Id: If33b53981ce40948c54b9adfe791b88a24c4e97d
Reviewed-on: https://gerrit.libreoffice.org/79558
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 
(cherry picked from commit 0ee9b408cd37c58a769cdd0775e1b1f072e0b6e0)
Reviewed-on: https://gerrit.libreoffice.org/79565

diff --git a/ios/Mobile/Base.lproj/Main.storyboard 
b/ios/Mobile/Base.lproj/Main.storyboard
index 8a253b27a..606a84358 100644
--- a/ios/Mobile/Base.lproj/Main.storyboard
+++ b/ios/Mobile/Base.lproj/Main.storyboard
@@ -1,11 +1,8 @@
 
-
-
-
-
+
+
 
-
-
+
 
 
 
@@ -28,7 +25,7 @@
 
 
 
-
+
 
 
 
@@ -63,10 +60,10 @@
 
 
 
-
+
 
 
-
+
 
 
 
@@ -79,7 +76,7 @@
 
 
 
-
+
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-09-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cc87beb06be992683df3894231dba4db9f068eb6
Author: Tor Lillqvist 
AuthorDate: Fri May 31 10:45:22 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Sep 23 10:44:10 2019 +0200

The UTExportedTypeDeclarations for fodt was missing its UTTypeDescription

Change-Id: I1b35b1c1663e59409662eda905c351c7c54ee18a
(cherry picked from commit 0a134d888be57dc32af86aeb1f7a84629484f2b3)
Reviewed-on: https://gerrit.libreoffice.org/79383
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index afb060b36..ecf7bf642 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -465,6 +465,8 @@
 
 public.data
 
+UTTypeDescription
+OpenDocument Flat Text
 UTTypeIdentifier
 com.collabora.office.uti.fodt
 UTTypeTagSpecification
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-09-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |   22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

New commits:
commit f9ed656c19d9d6119bde10f5c00ea5b59131ddf3
Author: Tor Lillqvist 
AuthorDate: Fri May 31 10:43:08 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Sep 23 10:43:53 2019 +0200

Fix some indentation glitches and add some comments

Change-Id: I352be04f9ca464f6306269da7263ba7f0a9c490e
(cherry picked from commit 8343d6ac02f13ca4c1532bf4817df03ed2e19e5c)
Reviewed-on: https://gerrit.libreoffice.org/79382
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index f58d87765..afb060b36 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -1,4 +1,4 @@
- 
+ 
 http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
 
 
@@ -230,8 +230,16 @@
 @APP_NAME@
 CFBundleDocumentTypes
 
-   
-   
+
+
+
 
 CFBundleTypeName
 OpenDocument Text
@@ -280,7 +288,7 @@
 com.microsoft.word.doc
 
 
-   
+
 CFBundleTypeIconFiles
 
 CFBundleTypeName
@@ -294,7 +302,7 @@
 public.text
 
 
-   
+
 
 CFBundleTypeIconFiles
 
@@ -337,7 +345,7 @@
 com.microsoft.excel.xls
 
 
-   
+
 
 CFBundleTypeName
 OpenDocument Presentation
@@ -434,6 +442,7 @@
 
 UTExportedTypeDeclarations
 
+
 
 UTTypeConformsTo
 
@@ -521,6 +530,7 @@
 
 UTImportedTypeDeclarations
 
+
 
 UTTypeConformsTo
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile loleaflet/util

2019-09-23 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Info.plist.in |   19 ++-
 loleaflet/util/create-l10n-all-js.pl |   30 ++
 2 files changed, 24 insertions(+), 25 deletions(-)

New commits:
commit 94799fbce3e1b019b40a3da92c606b83c2e33121
Author: Tor Lillqvist 
AuthorDate: Thu May 30 12:26:09 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Sep 23 10:43:01 2019 +0200

Try to unify the list of localisations with what I use to build LO core

(In the tree where I building the core branch used for the app as
distributed, that is.)

Change-Id: Ice622c79ff9c7f56f4e58f68fe65e5d89696681b
(cherry picked from commit 21dc19f7a28174fbd5eabd0f60b6f1cedcafd89c)
Reviewed-on: https://gerrit.libreoffice.org/79381
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 103b720d9..f58d87765 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -201,11 +201,28 @@
CFBundleLocalizations

en
+   da
de
-   fi
+   el
+es
fr
+   hu
+   is
it
+   ja
+   ko
+   nb
+   nl
+   nn
+   pl
+   pt
+   pt-BR
+   ru
+   sk
sv
+   tr
+   zh-CN
+   zh-TW

 CFBundleDevelopmentRegion
 $(DEVELOPMENT_LANGUAGE)
diff --git a/loleaflet/util/create-l10n-all-js.pl 
b/loleaflet/util/create-l10n-all-js.pl
index 0cdba7db2..22307a987 100644
--- a/loleaflet/util/create-l10n-all-js.pl
+++ b/loleaflet/util/create-l10n-all-js.pl
@@ -42,18 +42,6 @@ if (underscore > 0) {
 
 if (false) {
 ;
-} else if (onlylang == 'am') {
-window.LOCALIZATIONS = " . insert('am') . ";
-} else if (onlylang == 'ar') {
-window.LOCALIZATIONS = " . insert('ar') . ";
-} else if (onlylang == 'bg') {
-window.LOCALIZATIONS = " . insert('bg') . ";
-} else if (onlylang == 'ca') {
-window.LOCALIZATIONS = " . insert('ca') . ";
-} else if (onlylang == 'cs') {
-window.LOCALIZATIONS = " . insert('cs') . ";
-} else if (onlylang == 'cy') {
-window.LOCALIZATIONS = " . insert('cy') . ";
 } else if (onlylang == 'da') {
 window.LOCALIZATIONS = " . insert('da') . ";
 } else if (onlylang == 'de') {
@@ -62,34 +50,28 @@ if (false) {
 window.LOCALIZATIONS = " . insert('el') . ";
 } else if (window.LANG == 'en_GB') {
 window.LOCALIZATIONS = " . insert('en_GB') . ";
-} else if (onlylang == 'eo') {
-window.LOCALIZATIONS = " . insert('eo') . ";
 } else if (onlylang == 'es') {
 window.LOCALIZATIONS = " . insert('es') . ";
-} else if (onlylang == 'eu') {
-window.LOCALIZATIONS = " . insert('eu') . ";
-} else if (onlylang == 'et') {
-window.LOCALIZATIONS = " . insert('et') . ";
 } else if (onlylang == 'fr') {
 window.LOCALIZATIONS = " . insert('fr') . ";
-} else if (onlylang == 'gd') {
-window.LOCALIZATIONS = " . insert('gd') . ";
-} else if (onlylang == 'gl') {
-window.LOCALIZATIONS = " . insert('gl') . ";
-} else if (onlylang == 'hr') {
-window.LOCALIZATIONS = " . insert('hr') . ";
 } else if (onlylang == 'hu') {
 window.LOCALIZATIONS = " . insert('hu') . ";
 } else if (onlylang == 'is') {
 window.LOCALIZATIONS = " . insert('is') . ";
 } else if (onlylang == 'it') {
 window.LOCALIZATIONS = " . insert('it') . ";
+} else if (onlylang == 'ja') {
+window.LOCALIZATIONS = " . insert('ja') . ";
+} else if (onlylang == 'ko') {
+window.LOCALIZATIONS = " . insert('ko') . ";
 } else if (onlylang == 'nb') {
 window.LOCALIZATIONS = " . insert('nb') . ";
 } else if (onlylang == 'nl') {
 window.LOCALIZATIONS = " . insert('nl') . ";
 } else if (onlylang == 'nn') {
 window.LOCALIZATIONS = " . insert('nn') . ";
+} else if (onlylang == 'pl') {
+window.LOCALIZATIONS = " . insert('pl') . ";
 } else if (window.LANG == 'pt_BR') {
 window.LOCALIZATIONS = " . insert('pt_BR') . ";
 } else if (onlylang == 'pt') {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-06-10 Thread Tor Lillqvist (via logerrit)
 ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings |1 -
 ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings |1 -
 2 files changed, 2 deletions(-)

New commits:
commit f94a00ddc9f8bc0376504fefbaa2b7b113db6878
Author: Tor Lillqvist 
AuthorDate: Mon Jun 10 13:14:09 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 10 13:14:12 2019 +0300

No need for the emptyTileCache-related setting string here either now

The disk tile cache is now gone also in the collabora-online-4 branch,
so no need to keep the string here in master just to be translated.

Change-Id: Ibd496bee738f64152a5ca7a9634e439289b0cd80

diff --git a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
index 77a78d09b..08caa0eba 100644
--- a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
@@ -3,5 +3,4 @@
 "App info" = "App info";
 "Version" = "Version";
 "Settings" = "Settings";
-"Empty tile cache each time" = "Empty tile cache each time";
 "Template list URL" = "Template list URL";
diff --git a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
index 6bc722469..041205243 100644
--- a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
@@ -3,5 +3,4 @@
 "App info" = "Tietoa appista";
 "Version" = "Versio";
 "Settings" = "Asetukset";
-"Empty tile cache each time" = "Tyhjennä laattavälimuisti joka kerta";
 "Template list URL" = "Mallilistan URL";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-05-31 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |   34 ++
 1 file changed, 34 insertions(+)

New commits:
commit a9dabea550d0fa53d67cf69a737e41bd5e10c83a
Author: Tor Lillqvist 
AuthorDate: Fri May 31 12:48:47 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri May 31 12:52:44 2019 +0300

Add Visio Document, extensions vdx, vsd, vsdm, and vsdx

Together with two one-line changes to core, Visio files now open
(read-only) in the app.

Change-Id: I7dde2f7a8d1960c8fb9154c23e489ccc00a17b2d

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index a6d431808..34f675d18 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -359,6 +359,20 @@
 com.microsoft.powerpoint.ppt
 
 
+
+CFBundleTypeIconFiles
+
+CFBundleTypeName
+Visio Document
+CFBundleTypeRole
+Viewer
+LSHandlerRank
+Alternate
+LSItemContentTypes
+
+com.collabora.office.uti.vsd
+
+
 
 CFBundleExecutable
 $(EXECUTABLE_NAME)
@@ -467,6 +481,26 @@
 odp
 
 
+
+UTTypeConformsTo
+
+public.data
+
+UTTypeDescription
+Visio Document
+UTTypeIdentifier
+com.collabora.office.uti.vsd
+UTTypeTagSpecification
+
+public.filename-extension
+
+vdx
+vsd
+vsdm
+vsdx
+
+
+
 
 UTImportedTypeDeclarations
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-04-26 Thread Libreoffice Gerrit user
 ios/Mobile/Document.h|2 +-
 ios/Mobile/DocumentViewController.mm |6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f21665f2ac2514e2aab49785f09805c4f7dcca19
Author: Tor Lillqvist 
AuthorDate: Fri Apr 26 17:52:33 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 26 18:04:10 2019 +0300

tdf#124981: Fix a few object leaks

The pointer to the DocumentViewController object in the Document class
can be a weak property. This avoids a circular reference.

When the DocumentViewController is being dismissed, remove the script
message handlers and remove the view from its superview. Also, set the
webView property to nil.

diff --git a/ios/Mobile/Document.h b/ios/Mobile/Document.h
index 004bcce0b..a843dc7f1 100644
--- a/ios/Mobile/Document.h
+++ b/ios/Mobile/Document.h
@@ -20,7 +20,7 @@
 int fakeClientFd;
 }
 
-@property (strong) DocumentViewController *viewController;
+@property (weak) DocumentViewController *viewController;
 
 - (void)send2JS:(const char*)buffer length:(int)length;
 
diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 1d70b2882..76e64d0d8 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -84,6 +84,12 @@
 [self dismissViewControllerAnimated:YES completion:^ {
 [self.document closeWithCompletionHandler:^(BOOL success){
 LOG_TRC("close completion handler gets " << 
(success?"YES":"NO"));
+[self.webView.configuration.userContentController 
removeScriptMessageHandlerForName:@"debug"];
+[self.webView.configuration.userContentController 
removeScriptMessageHandlerForName:@"lool"];
+[self.webView.configuration.userContentController 
removeScriptMessageHandlerForName:@"error"];
+self.webView.configuration.userContentController = nil;
+[self.webView removeFromSuperview];
+self.webView = nil;
 }];
 }];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-04-24 Thread Libreoffice Gerrit user
 ios/Mobile/AppDelegate.mm |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 824834dfa8a071e2724cc8dd4c968aa19a540836
Author: Tor Lillqvist 
AuthorDate: Wed Apr 24 13:24:53 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 24 13:24:53 2019 +0300

Turn on Unipoll for the iOS app, too

Change-Id: Ib0b7ac53b7c936e75446004c4581ace415b1dd5c

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index b67caf194..a6b1827d3 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -155,6 +155,8 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 if (!trace)
 trace = strdup("warning");
 
+setenv("SAL_LOK_OPTIONS", "unipoll", 0);
+
 Log::initialize("Mobile", trace, false, false, {});
 Util::setThreadName("main");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-04-12 Thread Libreoffice Gerrit user
 ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings |3 ---
 ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings |3 ---
 2 files changed, 6 deletions(-)

New commits:
commit 4cfd2e8744e07bb13a8cfe6ff2c962300673eae6
Author: Tor Lillqvist 
AuthorDate: Fri Apr 12 23:04:08 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 12 23:06:29 2019 +0300

Bin three unnecessary translatable strings that don't occur anywhere

They for some reason appear when one adds a Settings Bundle to the
project using Xcode, but are not needed, as far as I see

(I already removed a fourth when I added the Finnish localisation.)

diff --git a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
index ce9f49df2..77a78d09b 100644
--- a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
@@ -1,8 +1,5 @@
 /* A single strings file, whose title is specified in your preferences schema. 
The strings files provide the localized content to display to the user for each 
of your preferences. */
 
-"Name" = "Name";
-"none given" = "none given";
-"Enabled" = "Enabled";
 "App info" = "App info";
 "Version" = "Version";
 "Settings" = "Settings";
diff --git a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
index 0cc7b8a28..6bc722469 100644
--- a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
@@ -1,8 +1,5 @@
 /* A single strings file, whose title is specified in your preferences schema. 
The strings files provide the localized content to display to the user for each 
of your preferences. */
 
-"Name" = "Nimi";
-"none given" = "ei mitään";
-"Enabled" = "On";
 "App info" = "Tietoa appista";
 "Version" = "Versio";
 "Settings" = "Asetukset";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-04-12 Thread Libreoffice Gerrit user
 ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings |1 +
 ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings |1 +
 2 files changed, 2 insertions(+)

New commits:
commit bf676c8643a89f9b05b9baead68e91246ccb4e51
Author: Tor Lillqvist 
AuthorDate: Fri Apr 12 22:46:33 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 12 22:46:33 2019 +0300

Add a string for translation from the collabora-online-4 branch

... even if it doesn't occur here in master, as the on-disk tile cache is 
gone.

Change-Id: I1ab5d5edde0386ca4c6c452b1cf4292c30a7e3df

diff --git a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
index 958682953..ce9f49df2 100644
--- a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
@@ -6,4 +6,5 @@
 "App info" = "App info";
 "Version" = "Version";
 "Settings" = "Settings";
+"Empty tile cache each time" = "Empty tile cache each time";
 "Template list URL" = "Template list URL";
diff --git a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
index 35c058abf..0cc7b8a28 100644
--- a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
+++ b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
@@ -6,4 +6,5 @@
 "App info" = "Tietoa appista";
 "Version" = "Versio";
 "Settings" = "Asetukset";
+"Empty tile cache each time" = "Tyhjennä laattavälimuisti joka kerta";
 "Template list URL" = "Mallilistan URL";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile ios/Mobile.xcodeproj

2019-04-12 Thread Libreoffice Gerrit user
 ios/Mobile.xcodeproj/project.pbxproj   |3 +++
 ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings |binary
 ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings |9 +
 3 files changed, 12 insertions(+)

New commits:
commit 095c4de38b13122e595b441270536622143067e1
Author: Tor Lillqvist 
AuthorDate: Fri Apr 12 21:16:46 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 12 21:26:37 2019 +0300

Experiment with adding localisation of the Settings.bundle

Add a sample Finnish localisation. The localised Root.strings files
are supposed to come from some Pootle-based workflow eventually.

Apparently there is some new and improved way to do localisation in
Xcode 10, "Base localisation", but our project file was created in an
earlier Xcode version and I couldn't figure out how to do it the new
way for Settings.bundle, so I manually added the fi.lproj directory.

I changed the English Root.strings file to be in UTF-8 instead of
UTF-16 (and it still works). (The Finnish one is UTF-8, too.) I added
the strings to be translated from Root.plist into it. That is the file
that should be used as a base for Pootle work, no need to extract
strings from the Root.plist, I think.

Change-Id: I80f1c3199ee14678bb1438e218eb9c2475cd66f8

diff --git a/ios/Mobile.xcodeproj/project.pbxproj 
b/ios/Mobile.xcodeproj/project.pbxproj
index 28be8d7fc..119e90303 100644
--- a/ios/Mobile.xcodeproj/project.pbxproj
+++ b/ios/Mobile.xcodeproj/project.pbxproj
@@ -1674,6 +1674,7 @@
knownRegions = (
en,
Base,
+   fi,
);
mainGroup = BE8D771E2136762500AC58EA;
productRefGroup = BE8D77282136762500AC58EA /* Products 
*/;
@@ -1782,6 +1783,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+   CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = 
YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = 
YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -1841,6 +1843,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+   CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = 
YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = 
YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
diff --git a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings
index 8cd87b9d6..958682953 100644
Binary files a/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings and 
b/ios/Mobile/Resources/Settings.bundle/en.lproj/Root.strings differ
diff --git a/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings 
b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
new file mode 100644
index 0..35c058abf
--- /dev/null
+++ b/ios/Mobile/Resources/Settings.bundle/fi.lproj/Root.strings
@@ -0,0 +1,9 @@
+/* A single strings file, whose title is specified in your preferences schema. 
The strings files provide the localized content to display to the user for each 
of your preferences. */
+
+"Name" = "Nimi";
+"none given" = "ei mitään";
+"Enabled" = "On";
+"App info" = "Tietoa appista";
+"Version" = "Versio";
+"Settings" = "Asetukset";
+"Template list URL" = "Mallilistan URL";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-03-28 Thread Libreoffice Gerrit user
 ios/Mobile/AppDelegate.h   |1 -
 ios/Mobile/AppDelegate.mm  |6 --
 ios/Mobile/TemplateCollectionViewController.mm |5 +
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit e2f48faf1441d88e545ff87b42a90a14bfcc04ac
Author: Tor Lillqvist 
AuthorDate: Thu Mar 28 17:04:58 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Mar 28 17:28:26 2019 +0200

tdf#123742: Fix lifecycle issues for the "Office" object

Because of the use of std::shared_ptr in lokit_main(), the (singleton)
lok::Office (or LibLibreOffice_Impl) object gets destroyed when
lokit_main() exits. We shouldn't keep our own copy of a raw pointer to
it around. Just call lok_init_2() to get the pointer where we need it.
We don't need to call lok_init_2() already in -[AppDelegate
application:didFinishLaunchingWithOptions:].

diff --git a/ios/Mobile/AppDelegate.h b/ios/Mobile/AppDelegate.h
index d9c6c00cc..58c09bf46 100644
--- a/ios/Mobile/AppDelegate.h
+++ b/ios/Mobile/AppDelegate.h
@@ -17,7 +17,6 @@
 @end
 
 extern NSString *app_locale;
-extern LibreOfficeKit *lo_kit;
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
 
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 001f0f5c7..b67caf194 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -27,7 +27,6 @@
 static LOOLWSD *loolwsd = nullptr;
 
 NSString *app_locale;
-LibreOfficeKit *lo_kit;
 
 static void download(NSURL *source, NSURL *destination) {
 [[[NSURLSession sharedSession] downloadTaskWithURL:source
@@ -184,11 +183,6 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 }
 }
 
-// Initialize LibreOfficeKit.
-
-lo_kit = lok_init_2(nullptr, nullptr);
-lo_kit->pClass->registerCallback(lo_kit, [](int, const char *, void*){}, 
nullptr);
-
 fakeSocketSetLoggingCallback([](const std::string& line)
  {
  LOG_TRC_NOFILE(line);
diff --git a/ios/Mobile/TemplateCollectionViewController.mm 
b/ios/Mobile/TemplateCollectionViewController.mm
index c5da8ef05..a31f3a655 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -8,6 +8,8 @@
 
 #import "svtools/strings.hrc"
 
+#import 
+
 #import "AppDelegate.h"
 #import "L10n.h"
 #import "TemplateCollectionViewController.h"
@@ -136,8 +138,11 @@ static NSString *mapTemplateExtensionToActual(NSString 
*templateName) {
 NSURL *newURL = [cacheDirectory 
URLByAppendingPathComponent:mapTemplateExtensionToActual(selectedTemplate.lastPathComponent)
 isDirectory:NO];
 
+LibreOfficeKit *lo_kit = lok_init_2(nullptr, nullptr);
+
 // Load the template into LibreOffice core, save as the corresponding 
document type (with the
 // same basename), and then proceed to edit that.
+
 LibreOfficeKitDocument *doc = lo_kit->pClass->documentLoad(lo_kit, 
[[selectedTemplate absoluteString] UTF8String]);
 doc->pClass->saveAs(doc, [[newURL absoluteString] UTF8String], nullptr, 
nullptr);
 doc->pClass->destroy(doc);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-03-25 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |  176 +++
 1 file changed, 176 insertions(+)

New commits:
commit 3264f39d4848f1be9dc21675bf6be2d616a8ef63
Author: Tor Lillqvist 
AuthorDate: Mon Mar 25 19:17:21 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Mar 25 19:17:21 2019 +0200

Add all fonts from instdir/share/fonts

Change-Id: I02765079e34cd9cbc96aea9cf2b72f432473ad0a

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 5dd1931e1..d9423c112 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -4,6 +4,66 @@
 
UIAppFonts

+share/fonts/truetype/Alef-Bold.ttf
+share/fonts/truetype/Alef-Regular.ttf
+share/fonts/truetype/Amiri-Bold.ttf
+share/fonts/truetype/Amiri-BoldSlanted.ttf
+share/fonts/truetype/Amiri-Regular.ttf
+share/fonts/truetype/Amiri-Slanted.ttf
+share/fonts/truetype/AmiriQuran.ttf
+share/fonts/truetype/Caladea-Bold.ttf
+share/fonts/truetype/Caladea-BoldItalic.ttf
+share/fonts/truetype/Caladea-Italic.ttf
+share/fonts/truetype/Caladea-Regular.ttf
+share/fonts/truetype/Carlito-Bold.ttf
+share/fonts/truetype/Carlito-BoldItalic.ttf
+share/fonts/truetype/Carlito-Italic.ttf
+share/fonts/truetype/Carlito-Regular.ttf
+share/fonts/truetype/DavidCLM-Bold.ttf
+share/fonts/truetype/DavidCLM-BoldItalic.ttf
+share/fonts/truetype/DavidCLM-Medium.ttf
+share/fonts/truetype/DavidCLM-MediumItalic.ttf
+share/fonts/truetype/DavidLibre-Bold.ttf
+share/fonts/truetype/DavidLibre-Regular.ttf
+share/fonts/truetype/DejaVuMathTeXGyre.ttf
+share/fonts/truetype/DejaVuSans-Bold.ttf
+share/fonts/truetype/DejaVuSans-BoldOblique.ttf
+share/fonts/truetype/DejaVuSans-ExtraLight.ttf
+share/fonts/truetype/DejaVuSans-Oblique.ttf
+share/fonts/truetype/DejaVuSans.ttf
+share/fonts/truetype/DejaVuSansCondensed-Bold.ttf
+
share/fonts/truetype/DejaVuSansCondensed-BoldOblique.ttf
+share/fonts/truetype/DejaVuSansCondensed-Oblique.ttf
+share/fonts/truetype/DejaVuSansCondensed.ttf
+share/fonts/truetype/DejaVuSansMono-Bold.ttf
+share/fonts/truetype/DejaVuSansMono-BoldOblique.ttf
+share/fonts/truetype/DejaVuSansMono-Oblique.ttf
+share/fonts/truetype/DejaVuSansMono.ttf
+share/fonts/truetype/DejaVuSerif-Bold.ttf
+share/fonts/truetype/DejaVuSerif-BoldItalic.ttf
+share/fonts/truetype/DejaVuSerif-Italic.ttf
+share/fonts/truetype/DejaVuSerif.ttf
+share/fonts/truetype/DejaVuSerifCondensed-Bold.ttf
+
share/fonts/truetype/DejaVuSerifCondensed-BoldItalic.ttf
+share/fonts/truetype/DejaVuSerifCondensed-Italic.ttf
+share/fonts/truetype/DejaVuSerifCondensed.ttf
+share/fonts/truetype/EmojiOneColor-SVGinOT.ttf
+share/fonts/truetype/FrankRuehlCLM-Bold.ttf
+share/fonts/truetype/FrankRuehlCLM-BoldOblique.ttf
+share/fonts/truetype/FrankRuehlCLM-Medium.ttf
+share/fonts/truetype/FrankRuehlCLM-MediumOblique.ttf
+share/fonts/truetype/FrankRuhlHofshi-Bold.otf
+share/fonts/truetype/FrankRuhlHofshi-Regular.otf
+share/fonts/truetype/GenBasB.ttf
+share/fonts/truetype/GenBasBI.ttf
+share/fonts/truetype/GenBasI.ttf
+share/fonts/truetype/GenBasR.ttf
+share/fonts/truetype/GenBkBasB.ttf
+share/fonts/truetype/GenBkBasBI.ttf
+share/fonts/truetype/GenBkBasI.ttf
+share/fonts/truetype/GenBkBasR.ttf
+share/fonts/truetype/KacstBook.ttf
+share/fonts/truetype/KacstOffice.ttf
 share/fonts/truetype/LiberationMono-Bold.ttf
 share/fonts/truetype/LiberationMono-BoldItalic.ttf
 share/fonts/truetype/LiberationMono-Italic.ttf
@@ -20,6 +80,122 @@
 share/fonts/truetype/LiberationSerif-BoldItalic.ttf
 share/fonts/truetype/LiberationSerif-Italic.ttf
 share/fonts/truetype/LiberationSerif-Regular.ttf
+share/fonts/truetype/LinBiolinum_RB_G.ttf
+share/fonts/truetype/LinBiolinum_RI_G.ttf
+share/fonts/truetype/LinBiolinum_R_G.ttf
+share/fonts/truetype/LinLibertine_DR_G.ttf
+share/fonts/truetype/LinLibertine_RBI_G.ttf
+share/fonts/truetype/LinLibertine_RB_G.ttf
+share/fonts/truetype/LinLibertine_RI_G.ttf
+share/fonts/truetype/LinLibertine_RZI_G.ttf
+share/fonts/truetype/LinLibertine_RZ_G.ttf
+share/fonts/truetype/LinLibertine_R_G.ttf
+share/fonts/truetype/MiriamCLM-Bold.ttf
+share/fonts/truetype/MiriamCLM-Book.ttf
+share/fonts/truetype/MiriamLibre-Bold.otf
+share/fonts/truetype/MiriamLibre-Regular.otf
+share/fonts/truetype/MiriamMonoCLM-Bold.ttf
+share/fonts/truetype/MiriamMonoCLM-BoldOblique.ttf
+share/fonts/truetype/MiriamMonoCLM-Book.ttf
+

[Libreoffice-commits] online.git: ios/Mobile

2019-03-22 Thread Libreoffice Gerrit user
 ios/Mobile/Document.mm |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit cbbb2496ca449f784b91e071b89ad2e81cb4e711
Author: Tor Lillqvist 
AuthorDate: Fri Mar 22 16:37:32 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 22 16:37:32 2019 +0200

Truncate the JS expression for logging

Change-Id: Ia287f5e26a80bdf0547128b8b2c9c9aff2ef89cd

diff --git a/ios/Mobile/Document.mm b/ios/Mobile/Document.mm
index 0eec31bda..2d0d12187 100644
--- a/ios/Mobile/Document.mm
+++ b/ios/Mobile/Document.mm
@@ -96,14 +96,18 @@
 js = [js stringByAppendingString:[NSString 
stringWithUTF8String:data.data()]];
 js = [js stringByAppendingString:@"'});"];
 
-// LOG_TRC("Evaluating JavaScript: " << [js UTF8String]);
+NSString *subjs = [js substringToIndex:std::min(100ul, js.length)];
+if (subjs.length < js.length)
+subjs = [subjs stringByAppendingString:@"..."];
+
+// LOG_TRC("Evaluating JavaScript: " << [subjs UTF8String]);
 
 dispatch_async(dispatch_get_main_queue(), ^{
 [self.viewController.webView evaluateJavaScript:js
   completionHandler:^(id _Nullable 
obj, NSError * _Nullable error)
  {
  if (error) {
- LOG_ERR("Error after " << [js UTF8String] << ": " << 
[[error localizedDescription] UTF8String]);
+ LOG_ERR("Error after " << [subjs UTF8String] << ": " 
<< [[error localizedDescription] UTF8String]);
  NSString *jsException = 
error.userInfo[@"WKJavaScriptExceptionMessage"];
  if (jsException != nil)
  LOG_ERR("JavaScript exception: " << [jsException 
UTF8String]);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-02-26 Thread Libreoffice Gerrit user
 ios/Mobile/DocumentViewController.mm |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 18ca7ee00843e846168b17b97dab9ecc1f65fb55
Author: Tor Lillqvist 
AuthorDate: Tue Feb 26 17:52:58 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Feb 26 17:52:58 2019 +0200

Remove superfluous empty line at end of file

Change-Id: Ibdb25392622a12cedc1923c2d88ffe6b6e4f798c

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index b6c128b56..9a4503b41 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -335,4 +335,3 @@
 @end
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
-
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile loleaflet/src

2019-02-26 Thread Libreoffice Gerrit user
 ios/Mobile/DocumentViewController.mm |   27 +++
 loleaflet/src/control/Toolbar.js |8 ++--
 2 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 62ffd2c8358c7f7f9d52471a313f1a053eb967fb
Author: Tor Lillqvist 
AuthorDate: Tue Feb 26 17:44:00 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Feb 26 17:45:39 2019 +0200

tdf#122584: Implement printing in the iOS app

I don't have an AirPrint printer so I couldn't verify that it actually
prints, but the system print dialog is displayed and shows a preview
correctly, so I am fairly sure it works.

Change-Id: I5e8a704386cd5053b8689dc63f26e545df323193

diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index fa3d77648..b6c128b56 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -294,6 +294,32 @@
 self.webView.hidden = false;
 
 return;
+} else if ([message.body isEqualToString:@"PRINT"]) {
+
+// Create the PDF to print.
+
+std::string printFile = Util::createRandomTmpDir() + "/print.pdf";
+NSURL *printURL = [NSURL fileURLWithPath:[NSString 
stringWithUTF8String:printFile.c_str()] isDirectory:NO];
+lok_document->saveAs([[printURL absoluteString] UTF8String], 
"pdf", nullptr);
+
+UIPrintInteractionController *pic = [UIPrintInteractionController 
sharedPrintController];
+UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+printInfo.outputType = UIPrintInfoOutputGeneral;
+printInfo.orientation = UIPrintInfoOrientationPortrait; // FIXME 
Check the document?
+printInfo.jobName = @"Document"; // FIXME
+
+pic.printInfo = printInfo;
+pic.printingItem = printURL;
+
+[pic presentFromRect:CGRectZero
+  inView:self.webView
+animated:YES
+   completionHandler:^(UIPrintInteractionController *pic, BOOL 
completed, NSError *error) {
+LOG_TRC("print completion handler gets " << 
(completed?"YES":"NO"));
+std::remove(printFile.c_str());
+}];
+
+return;
 }
 
 const char *buf = [message.body UTF8String];
@@ -309,3 +335,4 @@
 @end
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 7e871a0db..3a2a2ddd2 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -81,8 +81,12 @@ L.Map.include({
},
 
print: function () {
-   this.showBusy(_('Downloading...'), false);
-   this.downloadAs('print.pdf', 'pdf', null, 'print');
+   if (window.ThisIsTheiOSApp) {
+   window.postMobileMessage('PRINT');
+   } else {
+   this.showBusy(_('Downloading...'), false);
+   this.downloadAs('print.pdf', 'pdf', null, 'print');
+   }
},
 
saveAs: function (url, format, options) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-02-18 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a43b1a02ba76ffd0e7bc413e4c0b26c507536a2
Author: Tor Lillqvist 
AuthorDate: Mon Feb 18 12:27:06 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Feb 18 12:27:11 2019 +0200

Bump CFBundleVersion

Yeah, a bit silly to have to do git commit for these bumps. I should
change things so that CFBundleVersion is taken from some local file in
the build tree, not from a file in git.

Change-Id: I99d68490aa7f084e8cfb34896c3398486bc6f8a2

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 9031eff41..d0f0e76f9 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-15
+16
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: ios/Mobile

2019-02-04 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f5a93b98cce4a68cd760883928e5214ad8e8278c
Author: Tor Lillqvist 
AuthorDate: Mon Feb 4 14:56:27 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Feb 4 14:56:27 2019 +0200

Bump CFBundleVersion

Change-Id: Iec25e7bbcec101209822c413eb8728b93ce9bfd4

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 4469e6793..9031eff41 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-14
+15
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2019-01-07 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2a2fd15ff1c9b8564b701730a535efe36ad7b3c
Author: Tor Lillqvist 
AuthorDate: Tue Jan 8 00:53:38 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Jan 8 00:53:38 2019 +0200

Bump CFBundleVersion

Change-Id: Ia5f21b74c16ed40ae8c1b5fd3f4413f0c9152c92

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index bce8578b8..4469e6793 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-13
+14
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-19 Thread Libreoffice Gerrit user
 ios/Mobile/AppDelegate.mm |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3ec92f137e7119d2bfdc32c29e91cdd665e39dd6
Author: Tor Lillqvist 
AuthorDate: Wed Dec 19 13:36:44 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 19 13:38:43 2018 +0200

Be less fragile in case of missing resources when downloading templates

It is not enough ot look at the NSError* parameter. Need to check the
HTTP status code, too.

Change-Id: I8db146c77626d4080ef6606999d27e6bb845876c

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index eadcda6a1..787a8a140 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -32,7 +32,7 @@ LibreOfficeKit *lo_kit;
 static void download(NSURL *source, NSURL *destination) {
 [[[NSURLSession sharedSession] downloadTaskWithURL:source
  completionHandler:^(NSURL *location, 
NSURLResponse *response, NSError *error) {
-if (error == nil  && [(NSHTTPURLResponse*)response statusCode] 
== 200) {
+if (error == nil && [response isKindOfClass:[NSHTTPURLResponse 
class]] && [(NSHTTPURLResponse*)response statusCode] == 200) {
 NSError *error = nil;
 NSURL *resultingItem = nil;
 if ([[NSFileManager defaultManager] 
replaceItemAtURL:destination
@@ -114,7 +114,7 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 [req setHTTPMethod:@"HEAD"];
 [[[NSURLSession sharedSession] dataTaskWithRequest:req
  completionHandler:^(NSData 
*data, NSURLResponse *response, NSError *error) {
-if (error == nil && [(NSHTTPURLResponse*)response 
statusCode] == 200) {
+if (error == nil && [response 
isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse*)response 
statusCode] == 200) {
 NSString *lastModified = 
[[(NSHTTPURLResponse*)response allHeaderFields] objectForKey:@"Last-Modified"];
 NSDateFormatter *df = [[NSDateFormatter alloc] 
init];
 df.dateFormat = @"EEE, dd MMM  HH:mm:ss z";
@@ -178,7 +178,7 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 if (url != nil) {
 [[[NSURLSession sharedSession] dataTaskWithURL:url
  completionHandler:^(NSData *data, 
NSURLResponse *response, NSError *error) {
-if (error == nil)
+if (error == nil && [response 
isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse*)response 
statusCode] == 200)
 updateTemplates(data, response);
 }] resume];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-18 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9deb186102b4e9d93c751480ee8108efa245a533
Author: Tor Lillqvist 
AuthorDate: Wed Dec 19 00:13:07 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 19 00:13:07 2018 +0200

Bump CFBundleVersion

Change-Id: I98233b5423e66ebca43426d5cc51af957e31d7b5

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 7af589605..bce8578b8 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-12
+13
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-07 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2768d8b9fd4b77d00cfaaf9e453294910fee1c86
Author: Tor Lillqvist 
AuthorDate: Fri Dec 7 15:27:17 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Dec 7 15:28:11 2018 +0200

Bump CFBundleVersion

Change-Id: I0278c745924787fdf5f258bb7d334fa6eef14fc0

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 7ff8ff3a8..7af589605 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-11
+12
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-07 Thread Libreoffice Gerrit user
 ios/Mobile/Base.lproj/Main.storyboard |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit deb92ad3ba1d5745ba7d4978dc018b29a917ceda
Author: Tor Lillqvist 
AuthorDate: Fri Dec 7 11:20:10 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Dec 7 11:20:15 2018 +0200

Finally figured out how to get 200x200 cells in the template collection

Change-Id: Idd977ccf52b2dd0e0aaae08f54f6d902791bcc6d

diff --git a/ios/Mobile/Base.lproj/Main.storyboard 
b/ios/Mobile/Base.lproj/Main.storyboard
index 062c453af..8a253b27a 100644
--- a/ios/Mobile/Base.lproj/Main.storyboard
+++ b/ios/Mobile/Base.lproj/Main.storyboard
@@ -49,17 +49,17 @@
 
 
 
-
+
 
 
 
 
 
 
-
+
 
 
-
+
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-06 Thread Libreoffice Gerrit user
 ios/Mobile/Base.lproj/Main.storyboard  |   53 -
 ios/Mobile/TemplateCollectionViewController.mm |   12 +++--
 2 files changed, 42 insertions(+), 23 deletions(-)

New commits:
commit da45975a5aea927bb8bdcaf4a58b0deced862b5c
Author: Tor Lillqvist 
AuthorDate: Thu Dec 6 17:14:47 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Dec 7 00:09:13 2018 +0200

Make the template collection view look much better

Now it finally looks like I want, but oh boy was that a pain. I am not
sure at all I understand what I am doing in Xcode's Interface Builder.

I tried hard at first to use the cell size 200x220 for the cell size
of the UICollectionView, consisting of a 200x200 UIImageView and a
200x20 UILabel below. But that did not seem to work, it still used a
(default?) size of 150x150. Weird. Anyway, let's commit this state now
that seems to work.

Change-Id: I4021133619fbf62cd633392d93f19c2bbc81311a

diff --git a/ios/Mobile/Base.lproj/Main.storyboard 
b/ios/Mobile/Base.lproj/Main.storyboard
index 64685855d..062c453af 100644
--- a/ios/Mobile/Base.lproj/Main.storyboard
+++ b/ios/Mobile/Base.lproj/Main.storyboard
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 
@@ -15,7 +15,7 @@
 
 
 
-
+
 
 
 
@@ -30,7 +30,7 @@
 
 
 
-
+
 
 
 
@@ -43,49 +43,66 @@
 
 
 
-
-
-
+
+
+
 
 
 
-
+
 
 
 
 
 
-
+
 
 
 
 
 
 
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
 
-
-
-
 
 
 
-
-
+
+
+
+
+
+
+
 
-
 
 
 
-
+
 
 
 
-
+
 
 
 
diff --git a/ios/Mobile/TemplateCollectionViewController.mm 
b/ios/Mobile/TemplateCollectionViewController.mm
index 91d5689d0..94a922825 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -12,8 +12,7 @@
 #import "TemplateCollectionViewController.h"
 #import "TemplateSectionHeaderView.h"
 
-static NSString 

[Libreoffice-commits] online.git: ios/Mobile

2018-12-06 Thread Libreoffice Gerrit user
 ios/Mobile/Base.lproj/Main.storyboard |   22 +++---
 ios/Mobile/Resources/Templates/Blank (A4).ott.png |binary
 ios/Mobile/Resources/Templates/Blank (widescreen).otp.png |binary
 ios/Mobile/Resources/Templates/Blank.otp.png  |binary
 ios/Mobile/Resources/Templates/Blank.ots.png  |binary
 ios/Mobile/TemplateCollectionViewController.mm|7 +++-
 6 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 8b106eb3127ed49a5af825826df0aad2af9603b0
Author: Tor Lillqvist 
AuthorDate: Thu Dec 6 16:33:39 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Dec 6 16:38:50 2018 +0200

Look for thumbnails of the templates and show them in the template browser

Add such thumbnails. Rename the presentation templates to not have
colons in their name, as that seems to be problematic for macOS and/or
iOS, sigh. (Shadows of pre-OS X MacOS, where the coln was the path
component separator, not the slash.)

Hack on the storyboard scene for the template browser. More work is
needed there; the thumbnails aren't scaled down for some reason. I
need to make sure the aspect ratio is maintained, too. Maybe to get it
to look like I want I need to do some coding and not just tweak the
storyboard in the Xcode UI designer, sigh.

Change-Id: I959d051352c2f033c8563188155af5281961c7d8

diff --git a/ios/Mobile/Base.lproj/Main.storyboard 
b/ios/Mobile/Base.lproj/Main.storyboard
index ed8b0784b..64685855d 100644
--- a/ios/Mobile/Base.lproj/Main.storyboard
+++ b/ios/Mobile/Base.lproj/Main.storyboard
@@ -47,7 +47,7 @@
 
 
 
-
+
 
 
 
@@ -56,28 +56,28 @@
 
 
 
-
-
+
+
 
-
+
 
 
 
-
+
 
-
+
 
 
 
-
+
 
 
 
 
-
-
+
+
 
-
+
 
 
 
@@ -88,7 +88,7 @@
 
 
 
-
+
 
 
 
diff --git a/ios/Mobile/Resources/Templates/Blank A4.ott 
b/ios/Mobile/Resources/Templates/Blank (A4).ott
similarity index 100%
rename from ios/Mobile/Resources/Templates/Blank A4.ott
rename to ios/Mobile/Resources/Templates/Blank (A4).ott
diff --git a/ios/Mobile/Resources/Templates/Blank (A4).ott.png 
b/ios/Mobile/Resources/Templates/Blank (A4).ott.png
new file mode 100644
index 0..055df5e94
Binary files /dev/null and b/ios/Mobile/Resources/Templates/Blank (A4).ott.png 
differ
diff --git a/ios/Mobile/Resources/Templates/Blank 16:9.otp 
b/ios/Mobile/Resources/Templates/Blank (widescreen).otp
similarity index 100%
rename from ios/Mobile/Resources/Templates/Blank 16:9.otp
rename to ios/Mobile/Resources/Templates/Blank (widescreen).otp
diff --git a/ios/Mobile/Resources/Templates/Blank (widescreen).otp.png 
b/ios/Mobile/Resources/Templates/Blank (widescreen).otp.png
new file mode 100644
index 0..e4e7254f2
Binary files /dev/null and b/ios/Mobile/Resources/Templates/Blank 
(widescreen).otp.png differ
diff --git a/ios/Mobile/Resources/Templates/Blank 4:3.otp 
b/ios/Mobile/Resources/Templates/Blank.otp
similarity index 100%
rename from ios/Mobile/Resources/Templates/Blank 4:3.otp
rename to ios/Mobile/Resources/Templates/Blank.otp
diff --git a/ios/Mobile/Resources/Templates/Blank.otp.png 
b/ios/Mobile/Resources/Templates/Blank.otp.png
new file mode 100644
index 0..da2dc775c
Binary 

[Libreoffice-commits] online.git: ios/Mobile

2018-12-05 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |   27 ---
 1 file changed, 27 deletions(-)

New commits:
commit 4c8d0f2e2564abb25c47ba37dbebb14136264d6b
Author: Tor Lillqvist 
AuthorDate: Wed Dec 5 23:35:08 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 5 23:41:49 2018 +0200

Revert "Work in progress: Add .ott"

Using a template has been implemented to work in a way more
appropriate for the platform.

There is little reason to allow direct opening of a template in the
iOS app as long as it don't have any way to save it as an actual
document, based on the template, after editing, (with a different file
name) anyway.

This reverts commit f01a73fa92c885a65cb04d90e4673f267243b866.

Change-Id: Iff4b2f299c6e6eda27c00e40a49374899af41cf0

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 5e1998741..7ff8ff3a8 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -51,16 +51,6 @@
 
 
 CFBundleTypeName
-OpenDocument Text Template
-LSHandlerRank
-Owner
-LSItemContentTypes
-
-org.oasis-open.opendocument.text-template
-
-
-
-CFBundleTypeName
 OpenDocument Flat Text
 LSHandlerRank
 Default
@@ -259,23 +249,6 @@
 
 public.data
 
-UTTypeDescription
-OpenDocument Text Template
-UTTypeIconFiles
-
-UTTypeIdentifier
-org.oasis-open.opendocument.text-template
-UTTypeTagSpecification
-
-public.filename-extension
-ott
-
-
-
-UTTypeConformsTo
-
-public.data
-
 UTTypeIdentifier
 com.collabora.office.uti.fodt
 UTTypeTagSpecification
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-05 Thread Libreoffice Gerrit user
 ios/Mobile/TemplateCollectionViewController.mm |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 1f0b0b6a0d41575850e35e4f3d645f863fdd69b0
Author: Tor Lillqvist 
AuthorDate: Wed Dec 5 22:13:26 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 5 22:13:26 2018 +0200

Bin leftover dummy NSLog() call

Change-Id: I0597be90ff211dfb7f5fd2f321bfb36c9ec01308

diff --git a/ios/Mobile/TemplateCollectionViewController.mm 
b/ios/Mobile/TemplateCollectionViewController.mm
index 66224cf3e..c6bb67be9 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -111,9 +111,7 @@ static NSString *mapTemplateExtensionToActual(NSString 
*templateName)
 
 self.importHandler(newURL, UIDocumentBrowserImportModeMove);
 
-[self dismissViewControllerAnimated:YES completion:^ {
-NSLog(@"foo");
-}];
+[self dismissViewControllerAnimated:YES completion:nil];
 
 return YES;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-12-05 Thread Libreoffice Gerrit user
 ios/Mobile/DocumentBrowserViewController.mm|   14 +---
 ios/Mobile/TemplateCollectionViewController.h  |2 +
 ios/Mobile/TemplateCollectionViewController.mm |   43 +
 3 files changed, 47 insertions(+), 12 deletions(-)

New commits:
commit 296e0eb8034c62a4266bb595d01e6d3fb1043730
Author: Tor Lillqvist 
AuthorDate: Wed Dec 5 20:12:34 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Dec 5 22:02:59 2018 +0200

More work on template selection for a new document

It took quite some time for me to understand how to do it. Not sure if
this is The Right Way, but at least it now works better.

The trick was to store the importHandler block as a property of the
TemplateCollectionViewController and call it when the right template
has been selected.

There is no need to call the importHandler already in the
documentBrowser:didRequestDocumentCreationWithHandler: instance method
and it would not be possible anyway as there apparently is no way to
have the presentViewController:animated:completion: method work in a
truly modal way, so that it would not return until the selection has
been done.

Change-Id: Ia229500c181844fcd99f1f099b2e6744c22b5266

diff --git a/ios/Mobile/DocumentBrowserViewController.mm 
b/ios/Mobile/DocumentBrowserViewController.mm
index 95b5bcd88..4e7c5c31b 100644
--- a/ios/Mobile/DocumentBrowserViewController.mm
+++ b/ios/Mobile/DocumentBrowserViewController.mm
@@ -37,19 +37,9 @@
 - (void)documentBrowser:(UIDocumentBrowserViewController *)controller 
didRequestDocumentCreationWithHandler:(void (^)(NSURL * _Nullable, 
UIDocumentBrowserImportMode))importHandler {
 UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" 
bundle:nil];
 TemplateCollectionViewController *templateCollectionViewController = 
[storyBoard 
instantiateViewControllerWithIdentifier:@"TemplateCollectionViewController"];
-[self presentViewController:templateCollectionViewController animated:YES 
completion:nil];
-
-#if 0
-NSURL *newDocumentURL = nil;
 
-// Set the URL for the new document here. Optionally, you can present a 
template chooser before calling the importHandler.
-// Make sure the importHandler is always called, even if the user cancels 
the creation request.
-if (newDocumentURL != nil) {
-importHandler(newDocumentURL, UIDocumentBrowserImportModeMove);
-} else {
-importHandler(newDocumentURL, UIDocumentBrowserImportModeNone);
-}
-#endif
+templateCollectionViewController.importHandler = importHandler;
+[self presentViewController:templateCollectionViewController animated:YES 
completion:nil];
 }
 
 -(void)documentBrowser:(UIDocumentBrowserViewController *)controller 
didPickDocumentURLs:(NSArray *)documentURLs {
diff --git a/ios/Mobile/TemplateCollectionViewController.h 
b/ios/Mobile/TemplateCollectionViewController.h
index 1e5ef3675..50861a599 100644
--- a/ios/Mobile/TemplateCollectionViewController.h
+++ b/ios/Mobile/TemplateCollectionViewController.h
@@ -14,6 +14,8 @@
 NSArray *templates[3];
 }
 
+@property (copy) void (^ _Nullable importHandler)(NSURL * _Nullable, 
UIDocumentBrowserImportMode);
+
 @end
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/Mobile/TemplateCollectionViewController.mm 
b/ios/Mobile/TemplateCollectionViewController.mm
index fcf6c1d8a..66224cf3e 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -6,9 +6,27 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#import 
+#import 
+
 #import "TemplateCollectionViewController.h"
 #import "TemplateSectionHeaderView.h"
 
+static NSString *mapTemplateExtensionToActual(NSString *templateName)
+{
+NSString *baseName = [templateName stringByDeletingPathExtension];
+NSString *extension = [templateName substringFromIndex:baseName.length];
+
+if ([extension isEqualToString:@".ott"])
+return [baseName stringByAppendingString:@".odt"];
+else if ([extension isEqualToString:@".ots"])
+return [baseName stringByAppendingString:@".ods"];
+else if ([extension isEqualToString:@".otp"])
+return [baseName stringByAppendingString:@".odp"];
+else
+assert(false);
+}
+
 @implementation TemplateCollectionViewController
 
 -(void)viewDidLoad {
@@ -75,6 +93,31 @@
 return header;
 }
 
+- (BOOL)collectionView:(UICollectionView *)collectionView 
shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+NSURL *selectedTemplate = templates[[indexPath 
indexAtPosition:0]][[indexPath indexAtPosition:1]];
+
+NSURL *cacheDirectory = [NSFileManager.defaultManager 
URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask][0];
+NSURL *newURL = [cacheDirectory 
URLByAppendingPathComponent:mapTemplateExtensionToActual(selectedTemplate.lastPathComponent)
+  

[Libreoffice-commits] online.git: ios/Mobile ios/Mobile.xcodeproj

2018-12-04 Thread Libreoffice Gerrit user
 ios/Mobile.xcodeproj/project.pbxproj   |   16 +
 ios/Mobile/Base.lproj/Main.storyboard  |   70 +
 ios/Mobile/DocumentBrowserViewController.mm|7 ++
 ios/Mobile/Resources/Templates/Blank 16:9.otp  |binary
 ios/Mobile/Resources/Templates/Blank 4:3.otp   |binary
 ios/Mobile/Resources/Templates/Blank A4.ott|binary
 ios/Mobile/Resources/Templates/Blank.ots   |binary
 ios/Mobile/TemplateCollectionViewController.h  |   19 +
 ios/Mobile/TemplateCollectionViewController.mm |   80 +
 ios/Mobile/TemplateSectionHeaderView.h |   17 +
 ios/Mobile/TemplateSectionHeaderView.m |   15 
 11 files changed, 222 insertions(+), 2 deletions(-)

New commits:
commit a3b44f2b8b375b1d9d8980ae70ee388e6de57d90
Author: Tor Lillqvist 
AuthorDate: Tue Dec 4 22:01:45 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Dec 4 22:12:39 2018 +0200

Work in progress on document creation using templates in the iOS app

When the "Create Document" button in the document browser is pressed,
we scan a set of ODF templates in the Templates subfolder of the app
bundle, and we display that list as a collection view. (So far that
view is not interactive, i.e. once it is displayed, you are stuck
there.)

Eventually, when the user chooses one of the templates, we will open
that and immediately, before the user has done any edits, do a Save As
of it as a real (not template) document in the app's document folder.
What name to use for it is unclear yet. Further saves will thus don't
need any dialog to choose the document name.

More work will be needed on i18n of the template support. Should we
have localised templates? At least localised template names. Etc.

Change-Id: I5675779a5b16bc4c70a943109aa0dd53cf4bd903

diff --git a/ios/Mobile.xcodeproj/project.pbxproj 
b/ios/Mobile.xcodeproj/project.pbxproj
index a5c577d82..5f5252c6e 100644
--- a/ios/Mobile.xcodeproj/project.pbxproj
+++ b/ios/Mobile.xcodeproj/project.pbxproj
@@ -32,6 +32,9 @@
BE5EB5DC2140480B00E0826C /* ICU.dat in Resources */ = {isa = 
PBXBuildFile; fileRef = BE5EB5DB2140480B00E0826C /* ICU.dat */; };
BE6362C22153B5B500F4237E /* MobileCoreServices.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = BE6362C12153B5B500F4237E /* 
MobileCoreServices.framework */; };
BE80E43221AD92F700859C97 /* Fonts in Resources */ = {isa = 
PBXBuildFile; fileRef = BE80E43121AD92F600859C97 /* Fonts */; };
+   BE80E45821B68F5700859C97 /* TemplateCollectionViewController.mm 
in Sources */ = {isa = PBXBuildFile; fileRef = BE80E45721B68F5700859C97 /* 
TemplateCollectionViewController.mm */; };
+   BE80E45E21B6CEF200859C97 /* TemplateSectionHeaderView.m in 
Sources */ = {isa = PBXBuildFile; fileRef = BE80E45D21B6CEF200859C97 /* 
TemplateSectionHeaderView.m */; };
+   BE80E46821B7066D00859C97 /* Templates in Resources */ = {isa = 
PBXBuildFile; fileRef = BE80E46721B7066C00859C97 /* Templates */; };
BE8D772C2136762500AC58EA /* AppDelegate.mm in Sources */ = {isa 
= PBXBuildFile; fileRef = BE8D772B2136762500AC58EA /* AppDelegate.mm */; };
BE8D772F2136762500AC58EA /* DocumentBrowserViewController.mm in 
Sources */ = {isa = PBXBuildFile; fileRef = BE8D772E2136762500AC58EA /* 
DocumentBrowserViewController.mm */; };
BE8D77322136762500AC58EA /* DocumentViewController.mm in 
Sources */ = {isa = PBXBuildFile; fileRef = BE8D77312136762500AC58EA /* 
DocumentViewController.mm */; };
@@ -370,6 +373,11 @@
BE80E45321B56E5000859C97 /* init.cxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = init.cxx; path 
= "../../ios-device/desktop/source/lib/init.cxx"; sourceTree = ""; };
BE80E45421B56E5000859C97 /* lokclipboard.cxx */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
lokclipboard.cxx; path = 
"../../ios-device/desktop/source/lib/lokclipboard.cxx"; sourceTree = ""; 
};
BE80E45521B56E5000859C97 /* lokinteractionhandler.cxx */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
lokinteractionhandler.cxx; path = 
"../../ios-device/desktop/source/lib/lokinteractionhandler.cxx"; sourceTree = 
""; };
+   BE80E45621B68F5000859C97 /* TemplateCollectionViewController.h 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.h; path = TemplateCollectionViewController.h; sourceTree = 
""; };
+   BE80E45721B68F5700859C97 /* TemplateCollectionViewController.mm 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.objcpp; path = TemplateCollectionViewController.mm; sourceTree = 
""; };
+   BE80E45C21B6CEF100859C97 /* TemplateSectionHeaderView.h */ = 
{isa = PBXFileReference; fileEncoding = 4; 

[Libreoffice-commits] online.git: ios/Mobile

2018-11-29 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e4ddfa313c3e86c60833db2a07b40a69f73e6424
Author: Tor Lillqvist 
AuthorDate: Thu Nov 29 21:13:21 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Nov 29 21:13:21 2018 +0200

Bump CFBundleVersion

Change-Id: Idee621d0fa41dd5a65157267da35e245405c125c

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 4f14d7eb1..7ff8ff3a8 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-10
+11
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-11-29 Thread Libreoffice Gerrit user
 ios/Mobile/DocumentBrowserViewController.mm |1 +
 ios/Mobile/DocumentViewController.mm|   10 --
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit e7ef0c29f9e045acab08a9884cf36d61bd3be023
Author: Tor Lillqvist 
AuthorDate: Thu Nov 29 19:21:49 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Nov 29 19:21:49 2018 +0200

Fix a problem when taking a photo to insert in a document in the iOS app

It turns out that the view of the DocumentViewController object is
removed from the view hierarchy when the camera is displayed, and
re-added after you choose to use the taken photo. Thus the
viewWillAppear: method is called again at that stage. The Document
object is stil quite intact, though. We should not call the Document
object's openWithCompletionHandler: method again, as that will cause
horrible brokenness.

Change-Id: Ib79bd8f292b01a19866278c4d95a2e816dcd9235

diff --git a/ios/Mobile/DocumentBrowserViewController.mm 
b/ios/Mobile/DocumentBrowserViewController.mm
index 633b4353b..d7edf887a 100644
--- a/ios/Mobile/DocumentBrowserViewController.mm
+++ b/ios/Mobile/DocumentBrowserViewController.mm
@@ -69,6 +69,7 @@
 UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" 
bundle:nil];
 DocumentViewController *documentViewController = [storyBoard 
instantiateViewControllerWithIdentifier:@"DocumentViewController"];
 documentViewController.document = [[Document alloc] 
initWithFileURL:documentURL];
+documentViewController.document->fakeClientFd = -1;
 documentViewController.document.viewController = documentViewController;
 [self presentViewController:documentViewController animated:YES 
completion:nil];
 }
diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index f60e31bbc..2c07e2448 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -62,11 +62,17 @@
 - (void)viewWillAppear:(BOOL)animated {
 [super viewWillAppear:animated];
 
-// Access the document
+// When the user uses the camer to insert a photo, when the camera is 
displayed, this view is
+// removed. After the photo is taken it is then added back to the 
hierarchy. Our Document object
+// is still there intact, however, so no need to re-open the document when 
we re-appear.
+
+// Check whether the Document object is an already initialised one.
+if (self.document->fakeClientFd >= 0)
+return;
+
 [self.document openWithCompletionHandler:^(BOOL success) {
 if (success) {
 // Display the content of the document
-
 } else {
 // Make sure to handle the failed import appropriately, e.g., by 
presenting an error message to the user.
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-11-28 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3ad5ca0167b75b45cd868f68cc3ce84a5c817f0a
Author: Tor Lillqvist 
AuthorDate: Wed Nov 28 19:07:00 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Nov 28 19:07:04 2018 +0200

Bump CFBundleVersion

Change-Id: I0f7aada06d3161abb012292d54d326128411e233

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index a2b80f32d..4f14d7eb1 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -197,7 +197,7 @@
 CFBundleShortVersionString
 0.1
 CFBundleVersion
-9
+10
 LSRequiresIPhoneOS
 
 UIFileSharingEnabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-11-27 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 4f37dcaa81c0c6b2c09b133a061cc651465d9d8f
Author: Tor Lillqvist 
AuthorDate: Tue Nov 27 15:33:29 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 27 15:33:29 2018 +0200

Include the Liberation fonts

Change-Id: I016e158c650a8ae57b7e0b17a763f997d5532abc

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 430213fd8..9087da624 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -2,6 +2,25 @@
 http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
 
 
+   UIAppFonts
+   
+share/fonts/truetype/LiberationMono-Bold.ttf
+share/fonts/truetype/LiberationMono-BoldItalic.ttf
+share/fonts/truetype/LiberationMono-Italic.ttf
+share/fonts/truetype/LiberationMono-Regular.ttf
+share/fonts/truetype/LiberationSans-Bold.ttf
+share/fonts/truetype/LiberationSans-BoldItalic.ttf
+share/fonts/truetype/LiberationSans-Italic.ttf
+share/fonts/truetype/LiberationSans-Regular.ttf
+share/fonts/truetype/LiberationSansNarrow-Bold.ttf
+
share/fonts/truetype/LiberationSansNarrow-BoldItalic.ttf
+share/fonts/truetype/LiberationSansNarrow-Italic.ttf
+share/fonts/truetype/LiberationSansNarrow-Regular.ttf
+share/fonts/truetype/LiberationSerif-Bold.ttf
+share/fonts/truetype/LiberationSerif-BoldItalic.ttf
+share/fonts/truetype/LiberationSerif-Italic.ttf
+share/fonts/truetype/LiberationSerif-Regular.ttf
+   
CFBundleLocalizations

en
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: ios/Mobile

2018-11-27 Thread Libreoffice Gerrit user
 ios/Mobile/Document.mm   |   10 --
 ios/Mobile/DocumentViewController.mm |6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit a2e1f383b989319f2873b92358a5da116178
Author: Tor Lillqvist 
AuthorDate: Tue Nov 27 13:18:24 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Nov 27 13:55:39 2018 +0200

Implement document saving properly to make saving to NextCloud work

Even if the LO core code, as called by the Online code, already has
saved the document back to the file from which it was loaded, in order
for a file provider extension like NextCloud to notice that, it is
essential to call saveToURL:forSaveOperation:completionHandler:. The
contentsForType:error: method can just return a NSFileWrapper for the
same, already saved, file, though.

Change-Id: Ic063c8603ca38930083866d973e500336cad517e

diff --git a/ios/Mobile/Document.mm b/ios/Mobile/Document.mm
index c2614f253..0676fd8ff 100644
--- a/ios/Mobile/Document.mm
+++ b/ios/Mobile/Document.mm
@@ -37,8 +37,14 @@
 @implementation Document
 
 - (id)contentsForType:(NSString*)typeName error:(NSError **)errorPtr {
-// Encode your document with an instance of NSData or NSFileWrapper
-return [[NSData alloc] init];
+// Somehow this doesn't feel right, creating an NSFileWrapper around the 
file that was given to
+// us for loadFromContents. I get the vague feeling that the file is 
perhaps just a temporary
+// data container created by the system for us to be used while loading 
the document data, and
+// not the actual permanent document, especially in the case of things 
like NextCloud. Or is it?
+// Is savng back to it (which we have already done by the time we get 
here, in the LO core code)
+// correct? This does seem to work, though. Anyway, clearly I need to read 
more documentation
+// for UIDocument etc.
+return [[NSFileWrapper alloc] initWithURL:[self fileURL] options:0 
error:errorPtr];
 }
 
 - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName 
error:(NSError **)errorPtr {
diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index 294851684..ff65b9a94 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -220,6 +220,12 @@
 // Close one end of the socket pair, that will wake up the 
forwarding thread above
 fakeSocketClose(closeNotificationPipeForForwardingThread[0]);
 
+[self.document saveToURL:[self.document fileURL]
+forSaveOperation:UIDocumentSaveForOverwriting
+   completionHandler:^(BOOL success) {
+  LOG_TRC("save completion handler gets " << 
(success?"YES":"NO"));
+   }];
+
 [self dismissDocumentViewController];
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits