[Libreoffice-commits] online.git: android/lib common/Session.hpp loleaflet/src wsd/ClientSession.cpp

2020-09-15 Thread mert (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 +++
 common/Session.hpp   |4 +++
 loleaflet/src/core/Socket.js |3 ++
 wsd/ClientSession.cpp|   13 
++
 4 files changed, 24 insertions(+)

New commits:
commit 115bb1b652dc931344c4a19f0bafd7363115914b
Author: mert 
AuthorDate: Thu Sep 10 17:04:36 2020 +0300
Commit: Mert Tumer 
CommitDate: Tue Sep 15 15:14:40 2020 +0200

Fix unable to open password protected documents on mobile

Change-Id: Ifd67cb6f3640784176abfe483f0364c1dfe4b5d9
Signed-off-by: mert 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102388
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102729

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 88b1fdafd..2066a1fd6 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -943,6 +943,10 @@ public class LOActivity extends AppCompatActivity {
 }
 return false;
 }
+case "loadwithpassword": {
+mProgressDialog.determinate(R.string.loading);
+return true;
+}
 }
 return true;
 }
diff --git a/common/Session.hpp b/common/Session.hpp
index e88a59d89..61e35ff42 100644
--- a/common/Session.hpp
+++ b/common/Session.hpp
@@ -193,6 +193,10 @@ public:
 
 bool getHaveDocPassword() const { return _haveDocPassword; }
 
+void setHaveDocPassword(const bool val) { _haveDocPassword = val; }
+
+void setDocPassword(const std::string& password) { _docPassword = 
password; }
+
 const std::string& getDocPassword() const { return _docPassword; }
 
 const std::string& getUserExtraInfo() const { return _userExtraInfo; }
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 8a22e0c8d..750e98bd6 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -696,6 +696,9 @@ L.Socket = L.Class.extend({
callback: L.bind(function(data) {
if (data) {
this._map._docPassword 
= data.password;
+   if 
(window.ThisIsAMobileApp) {
+   
window.postMobileMessage('loadwithpassword password=' + data.password);
+   }

this._map.loadDocument();
} else if (passwordType === 
'to-modify') {
this._map._docPassword 
= '';
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 60733a0c5..44b3f0271 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -395,6 +395,19 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
 
 return loadDocument(buffer, length, tokens, docBroker);
 }
+else if (tokens.equals(0, "loadwithpassword"))
+{
+std::string docPassword;
+if (tokens.size() > 1 && getTokenString(tokens[1], "password", 
docPassword))
+{
+if (!docPassword.empty())
+{
+setHaveDocPassword(true);
+setDocPassword(docPassword);
+}
+}
+return loadDocument(buffer, length, tokens, docBroker);
+}
 else if (getDocURL().empty())
 {
 sendTextFrameAndLogError("error: cmd=" + tokens[0] + " 
kind=nodocloaded");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/css loleaflet/src

2020-09-15 Thread mert (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   15 
+++
 loleaflet/css/toolbar.css|1 
 loleaflet/src/control/Control.MobileTopBar.js|2 
 loleaflet/src/control/Control.Toolbar.js |8 +++
 loleaflet/src/control/Control.UIManager.js   |   21 
+-
 loleaflet/src/control/Permission.js  |7 +++
 loleaflet/src/map/Map.js |5 ++
 7 files changed, 56 insertions(+), 3 deletions(-)

New commits:
commit 4cd1baa02d0b36e68a7194c77fdeb68c5af59f8a
Author: mert 
AuthorDate: Wed Feb 12 20:53:34 2020 +0300
Commit: Mert Tumer 
CommitDate: Tue Sep 15 12:22:10 2020 +0200

android: back button switches to readonly mode instead of closing

Currently pressing back button on edit mode closes the document,
this patch may prevent unintentional touches

Change-Id: Ic7061186fa8794203fd4614c07a11b219d3a10d9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100666
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mert Tumer 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88555

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 77f9e0e68..88b1fdafd 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -122,6 +122,7 @@ public class LOActivity extends AppCompatActivity {
 
 /** In case the mobile-wizard is visible, we have to intercept the 
Android's Back button. */
 private boolean mMobileWizardVisible = false;
+private boolean mIsEditModeActive = false;
 
 private ValueCallback valueCallback;
 
@@ -697,6 +698,9 @@ public class LOActivity extends AppCompatActivity {
 // just return one level up in the mobile-wizard (or close it)
 callFakeWebsocketOnMessage("'mobile: mobilewizardback'");
 return;
+} else if (mIsEditModeActive) {
+callFakeWebsocketOnMessage("'mobile: readonlymode'");
+return;
 }
 
 finishWithProgress();
@@ -928,6 +932,17 @@ public class LOActivity extends AppCompatActivity {
 startActivity(intent);
 return false;
 }
+case "EDITMODE": {
+switch (messageAndParam[1]) {
+case "on":
+mIsEditModeActive = true;
+break;
+case "off":
+mIsEditModeActive = false;
+break;
+}
+return false;
+}
 }
 return true;
 }
diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 343ebd8d6..a994cd4b2 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -753,6 +753,7 @@ button.leaflet-control-search-next
 .w2ui-icon.users{ background: url('images/contacts-dark.svg') no-repeat 
center; }
 .w2ui-icon.fullscreen{ background: url('images/lc_fullscreen.svg') no-repeat 
center !important; }
 .w2ui-icon.closemobile{ background: url('images/lc_closedocmobile.svg') 
no-repeat center !important; }
+.w2ui-icon.editmode { background: url('images/lc_listitem-selected.svg') 
no-repeat center / 28px !important; }
 .w2ui-icon.closetoolbar{ background: url('images/close_toolbar.svg') no-repeat 
center !important; }
 .w2ui-icon.sidebar_modify_page{ background: 
url('images/lc_formproperties.svg') no-repeat center !important; }
 .w2ui-icon.sidebar_slide_change{ background: 
url('images/sidebar-transition-large.svg') no-repeat center !important; }
diff --git a/loleaflet/src/control/Control.MobileTopBar.js 
b/loleaflet/src/control/Control.MobileTopBar.js
index 05fd7c7ed..b562c0153 100644
--- a/loleaflet/src/control/Control.MobileTopBar.js
+++ b/loleaflet/src/control/Control.MobileTopBar.js
@@ -193,6 +193,7 @@ L.Control.MobileTopBar = L.Control.extend({
toolbarDownButtons.forEach(function(id) {
toolbar.enable(id);
});
+   toolbar.set('closemobile', {img: 'editmode'});
}
} else {
toolbar = w2ui['actionbar'];
@@ -200,6 +201,7 @@ L.Control.MobileTopBar = L.Control.extend({
toolbarDownButtons.forEach(function(id) {
toolbar.disable(id);
});
+   toolbar.set('closemobile', {img: 
'closemobile'});
}
}
},
diff --git a/loleaflet/src/control/Control.Toolbar.js 

[Libreoffice-commits] online.git: android/lib

2020-08-26 Thread mert (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 

 1 file changed, 4 insertions(+)

New commits:
commit 851bdeb949d28dd5ee5d451b85b121eecb160a6f
Author: mert 
AuthorDate: Tue Aug 25 22:44:12 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Aug 26 09:19:04 2020 +0200

Fix insert image dialog only opens once

Change-Id: I5a184feadcf25e22829f80ad4da20d25e04d3f27
Signed-off-by: mert 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101348
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 24319e215..77f9e0e68 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -577,6 +577,10 @@ public class LOActivity extends AppCompatActivity {
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent 
intent) {
 if (resultCode != RESULT_OK) {
+if (requestCode == REQUEST_SELECT_IMAGE_FILE) {
+valueCallback.onReceiveValue(null);
+valueCallback = null;
+}
 return;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/po

2020-08-17 Thread Weblate (via logerrit)
 android/lib/src/main/res/values-gl/strings.xml |1 
 loleaflet/po/ui-ast.po |   10 -
 loleaflet/po/ui-bg.po  |   48 +++--
 loleaflet/po/ui-ca.po  |   18 +--
 loleaflet/po/ui-cs.po  |   64 
 loleaflet/po/ui-cy.po  |   52 +++---
 loleaflet/po/ui-dsb.po |   48 +++--
 loleaflet/po/ui-eo.po  |   70 +
 loleaflet/po/ui-eu.po  |   48 +++--
 loleaflet/po/ui-gl.po  |   73 +-
 loleaflet/po/ui-hsb.po |   48 +++--
 loleaflet/po/ui-it.po  |   50 +++--
 loleaflet/po/ui-nb.po  |   48 +++--
 loleaflet/po/ui-pt_BR.po   |   42 ++--
 loleaflet/po/ui-sk.po  |   64 
 loleaflet/po/ui-sl.po  |   48 +++--
 loleaflet/po/ui-uk.po  |  127 -
 17 files changed, 315 insertions(+), 544 deletions(-)

New commits:
commit 0d0d2334cd1e61f7328e8a30cb0c5de23004d309
Author: Weblate 
AuthorDate: Mon Aug 17 13:54:42 2020 +0200
Commit: Andras Timar 
CommitDate: Mon Aug 17 17:55:45 2020 +0200

update translations

LibreOffice Online/android-lib (Galician)
Currently translated at 100.0% (13 of 13 strings)

Change-Id: I20825affea2fe6337ab098e8f92eaad0a8f7b483

update translations

LibreOffice Online/loleaflet-ui (Galician)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I4ce0e74f4f24509fa01774fdaa1a4514228c6a03

update translations

LibreOffice Online/loleaflet-ui (Esperanto)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I00e4fa474159c57e0c60d81f1c8fd9498d8c9ffc

update translations

LibreOffice Online/loleaflet-ui (Ukrainian)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I0e13f812d94e99d06d37b08ee203f00b7790bc6b

update translations

LibreOffice Online/loleaflet-ui (Ukrainian)
Currently translated at 99.4% (342 of 344 strings)

Change-Id: I49438a1a4262b8cd7d6d54a445afb67fcd60

update translations

LibreOffice Online/loleaflet-ui (Portuguese (Brazil))
Currently translated at 98.8% (340 of 344 strings)

Change-Id: I36528b4d19081e26af92ce6d347cac67797a7167

update translations

LibreOffice Online/loleaflet-ui (Slovak)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: Ifd57a6e733dcf75deeed9cb9d3110b956eea150a

update translations

LibreOffice Online/loleaflet-ui (Norwegian Bokmål)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I321b475d23782bd70d7864cb9309294ef2c0415c

update translations

LibreOffice Online/loleaflet-ui (Welsh)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I02ad16334449b5e12da58f6f2b1c8af2167bf9c4

update translations

LibreOffice Online/loleaflet-ui (Bulgarian)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: Ie87d597b441272feac170f4d5fd9adfa49092779

update translations

LibreOffice Online/loleaflet-ui (Asturian)
Currently translated at 45.0% (155 of 344 strings)

Change-Id: I3d290dcf34fd852eaaa35ebe6d47a20ed099c9c8

update translations

LibreOffice Online/loleaflet-ui (Slovenian)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I5616691719811850135b66ee45fe8c7ac6d513da

update translations

LibreOffice Online/loleaflet-ui (Portuguese (Brazil))
Currently translated at 98.2% (338 of 344 strings)

Change-Id: I1ce2107e08e626361cb4edb7e5abd8d212d6226e

update translations

LibreOffice Online/loleaflet-ui (Slovenian)
Currently translated at 97.9% (337 of 344 strings)

Change-Id: I63ed0d3308ae96d354f3d53caa447150247bb9d7

update translations

LibreOffice Online/loleaflet-ui (Italian)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I6d0a2b0861327e657994d3841f05d5a28a1d6b25

update translations

LibreOffice Online/loleaflet-ui (Basque)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I771df8992bbe4dcda956ade9e9b4150d3cd1879d

update translations

LibreOffice Online/loleaflet-ui (Ukrainian)
Currently translated at 98.2% (338 of 344 strings)

Change-Id: I471972b34fa801ead2a003d8681a563c4bfe1166

update translations

LibreOffice Online/loleaflet-ui (Czech)
Currently translated at 100.0% (344 of 344 strings)

Change-Id: I8a374fe008d533681e6489a5e1c3035f3fbd7231

update translations


[Libreoffice-commits] online.git: android/lib

2020-08-12 Thread Henry Castro (via logerrit)
 android/lib/build.gradle |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8f394bdd548f27972fd264b793487e9cc9605542
Author: Henry Castro 
AuthorDate: Tue Aug 11 17:37:34 2020 -0400
Commit: Henry Castro 
CommitDate: Wed Aug 12 14:49:44 2020 +0200

android: fix build loleaflet assets

By default it is generated by automake,
but if someone wants to change manually,
do not forget to adjust this directory too.

Change-Id: I17e36364ac467d889e876be2995ef08e3c06da9e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100569
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 90fb964f5..bffb8d0db 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -296,11 +296,11 @@ preBuild.dependsOn 'createRCfiles',
 'copyBrandTheme'
 
 task generateLoleafletDebugAssets(type: Exec) {
-   commandLine 'make', '-C', '../../', 
"DIST_FOLDER=${project.getProjectDir()}/src/debug/assets/dist", 'BUNDLE=DEBUG'
+   commandLine 'make', '-C', 
"${rootProject.getBuildDir()}/../../loleaflet", 
"DIST_FOLDER=${project.getProjectDir()}/src/debug/assets/dist", 'BUNDLE=DEBUG'
 }
 
 task generateLoleafletReleaseAssets(type: Exec) {
-   commandLine 'make', '-C', '../../', 
"DIST_FOLDER=${project.getProjectDir()}/src/release/assets/dist", 
'BUNDLE=RELEASE'
+   commandLine 'make', '-C', 
"${rootProject.getBuildDir()}/../../loleaflet", 
"DIST_FOLDER=${project.getProjectDir()}/src/release/assets/dist", 
'BUNDLE=RELEASE'
 }
 
 afterEvaluate {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-08-12 Thread Henry Castro (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b6520bdaeb23f66a951a9458594f1c8bfc900093
Author: Henry Castro 
AuthorDate: Tue Aug 11 17:35:05 2020 -0400
Commit: Henry Castro 
CommitDate: Wed Aug 12 13:38:30 2020 +0200

android: fix the include directories when builddir != srcdir

Change-Id: I81e823354129c510c43d606f0e56f0cbf92c5eef
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100568
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 4c4e1344a..2a9fc36b0 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -52,7 +52,8 @@ set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-nat
 
 target_include_directories(androidapp PRIVATE
. # path to androidapp.h
-   ../../../../..# path to config.h
+  @abs_top_builddir@# path to config.h
+  @abs_top_srcdir@
../../../../../common # the needed loolwsd includes
../../../../../kit
../../../../../net
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-08-07 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle  |6 +++---
 android/lib/libSettings.gradle.in |3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit efea5137fc4d9620ad92ba6e7a865509cf74c4d7
Author: Jan Holesovsky 
AuthorDate: Fri Aug 7 14:23:11 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Fri Aug 7 15:09:49 2020 +0200

android: Show the real core git hash in the About dialog.

In the editing activity.

Change-Id: I87190044b501d80f83600b8a146c4d77a5f4e4f7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100228
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 6177d0ca5..90fb964f5 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -26,7 +26,7 @@ android {
 buildTypes {
 debug {
 resValue "string", "app_name", "${liboAppName} Debug"
-buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "String", "GIT_COMMIT", "\"${liboOVersionHash}\""
 buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
@@ -36,7 +36,7 @@ android {
 }
 release {
 resValue "string", "app_name", "${liboAppName}"
-buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "String", "GIT_COMMIT", "\"${liboOVersionHash}\""
 buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
@@ -278,7 +278,7 @@ UNO_USER_PACKAGES_CACHE=$UNO_USER_PACKAGES/cache
 [Version]
 AllLanguages=en-US
 BuildVersion=
-buildid=''' + "${liboGitFullCommit}" + '''
+buildid=''' + "${liboCoreVersionHash}" + '''
 ReferenceOOoMajorMinor=4.1
 '''.stripIndent()
 }
diff --git a/android/lib/libSettings.gradle.in 
b/android/lib/libSettings.gradle.in
index afa68ee1f..a4fe37d66 100644
--- a/android/lib/libSettings.gradle.in
+++ b/android/lib/libSettings.gradle.in
@@ -8,7 +8,8 @@ ext {
 liboExampleDocument = '@LOBUILDDIR@/android/default-document/example.odt'
 liboVersionMajor= '@LOOLWSD_VERSION_MAJOR@'
 liboVersionMinor= '@LOOLWSD_VERSION_MAJOR@'
-liboGitFullCommit   = '@LOOLWSD_VERSION_HASH@'
+liboOVersionHash= '@LOOLWSD_VERSION_HASH@'
+liboCoreVersionHash = '@CORE_VERSION_HASH@'
 liboApplicationId   = '@ANDROID_PACKAGE_NAME@'
 liboBrandingDir = '@APP_BRANDING_DIR@'
 liboAndroidAbi  = '@ANDROID_ABI@'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-29 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f869b84f4b6ad86a9ce478272f2a13c3580e1970
Author: Jan Holesovsky 
AuthorDate: Fri Jul 17 16:02:46 2020 +0200
Commit: Andras Timar 
CommitDate: Wed Jul 29 10:41:28 2020 +0200

android: Log when we disable editing for easier debugging.

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

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 221c83174..24319e215 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -272,6 +272,7 @@ public class LOActivity extends AppCompatActivity {
 // is it read-only?
 if ((getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0) {
 isDocEditable = false;
+Log.d(TAG, "Disabled editing: Read-only");
 Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
 }
 
@@ -282,6 +283,7 @@ public class LOActivity extends AppCompatActivity {
 if (isDocEditable && 
(getIntent().getData().toString().startsWith("content://org.chromium.arc.chromecontentprovider/externalfile")
 ||
   
getIntent().getData().toString().startsWith("content://org.chromium.arc.volumeprovider/")))
 {
 isDocEditable = false;
+Log.d(TAG, "Disabled editing: Chrome OS unsupported 
content providers");
 Toast.makeText(this, 
getResources().getString(R.string.file_chromeos_read_only), 
Toast.LENGTH_LONG).show();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-17 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   18 
+++---
 android/lib/src/main/res/values/strings.xml  |1 
 2 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 95d683f6ab84132c11f41bf4873b50327b32ba05
Author: Jan Holesovsky 
AuthorDate: Fri Jul 17 09:56:25 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Fri Jul 17 11:29:47 2020 +0200

android: One more location that fails to save on Chrome OS.

Turns out that saving directly to "My files" is problematic in some
cases too; suggest to use the "Play files" location.

Change-Id: Ifb88fc048685596f85e7cf39a57c60864da12d83
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98955
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index e904c6d74..221c83174 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -267,15 +267,23 @@ public class LOActivity extends AppCompatActivity {
 if (getIntent().getData() != null) {
 
 if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
-isDocEditable = (getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0;
+isDocEditable = true;
+
+// is it read-only?
+if ((getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0) {
+isDocEditable = false;
+Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
+}
 
 // turns out that on ChromeOS, it is not possible to save back
 // to Google Drive; detect it already here to avoid 
disappointment
-if 
(getIntent().getData().toString().startsWith("content://org.chromium.arc.chromecontentprovider/externalfile"))
+// also the volumeprovider does not work for saving back,
+// which is much more serious :-(
+if (isDocEditable && 
(getIntent().getData().toString().startsWith("content://org.chromium.arc.chromecontentprovider/externalfile")
 ||
+  
getIntent().getData().toString().startsWith("content://org.chromium.arc.volumeprovider/")))
 {
 isDocEditable = false;
-
-if (!isDocEditable)
-Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
+Toast.makeText(this, 
getResources().getString(R.string.file_chromeos_read_only), 
Toast.LENGTH_LONG).show();
+}
 
 if (copyFileToTemp() && mTempFile != null) {
 documentUri = mTempFile.toURI();
diff --git a/android/lib/src/main/res/values/strings.xml 
b/android/lib/src/main/res/values/strings.xml
index dff5fb931..5fcb5e742 100644
--- a/android/lib/src/main/res/values/strings.xml
+++ b/android/lib/src/main/res/values/strings.xml
@@ -1,5 +1,6 @@
 
 This file is read-only, saving is 
disabled.
+This file cannot be saved in this 
location, opening it read-only. Move it to the "Play files" for full read/write 
access.
 Storage permission is 
required
 Failed to determine the file to 
load
 Failed to insert image
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib kit/ChildSession.cpp loleaflet/src

2020-07-16 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp  |   54 +--
 android/lib/src/main/cpp/androidapp.hpp  |3 +
 kit/ChildSession.cpp |   10 +
 loleaflet/src/control/Control.Toolbar.js |6 ---
 4 files changed, 51 insertions(+), 22 deletions(-)

New commits:
commit 1b3732b941e90223301fecda66f84b01fc397bad
Author: Jan Holesovsky 
AuthorDate: Tue Jul 14 14:27:03 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Jul 16 11:52:58 2020 +0200

android: Call the SAVE directly from the native code.

Until now, for the "local save has completed, upload it back to the
content: URI" messages we were relying on the "local save" -> JavaScript
-> Java -> "upload to content:/ URI" chain.

It turns out though, that the WebView can be dead by the time we need
the notification that the save has completed.  This was particularly
seen on ChromeOS when the document was closed using the [x] in the
window decoration.

As a solution, we need to pass the info that the "local save" has
completed directly to Java.  So far this uses the same semantics as the
postMobileMessage() and reuse its code; but maybe in the future we'll
need to split this.

Change-Id: If1b93e4f76cee3abc6aebfc3e9072810ab73bb42
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98773
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 6d196434b..59a9be2dd 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -36,6 +36,10 @@ static int closeNotificationPipeForForwardingThread[2] = 
{-1, -1};
 static JavaVM* javaVM = nullptr;
 static bool lokInitialized = false;
 
+// Remember the reference to the LOActivity
+jclass g_loActivityClz = nullptr;
+jobject g_loActivityObj = nullptr;
+
 extern "C" JNIEXPORT jint JNICALL
 JNI_OnLoad(JavaVM* vm, void*) {
 javaVM = vm;
@@ -90,7 +94,7 @@ public:
 JNIEnv *getEnv() const { return _env; }
 };
 
-static void send2JS(const JNIThreadContext , jclass loActivityClz, 
jobject loActivityObj, const std::vector& buffer)
+static void send2JS(const JNIThreadContext , const std::vector& 
buffer)
 {
 LOG_DBG("Send to JS: " << 
LOOLProtocol::getAbbreviatedMessage(buffer.data(), buffer.size()));
 
@@ -150,8 +154,22 @@ static void send2JS(const JNIThreadContext , jclass 
loActivityClz, jobject
 
 JNIEnv *env = jctx.getEnv();
 jstring jstr = env->NewStringUTF(js.c_str());
-jmethodID callFakeWebsocket = env->GetMethodID(loActivityClz, 
"callFakeWebsocketOnMessage", "(Ljava/lang/String;)V");
-env->CallVoidMethod(loActivityObj, callFakeWebsocket, jstr);
+jmethodID callFakeWebsocket = env->GetMethodID(g_loActivityClz, 
"callFakeWebsocketOnMessage", "(Ljava/lang/String;)V");
+env->CallVoidMethod(g_loActivityObj, callFakeWebsocket, jstr);
+env->DeleteLocalRef(jstr);
+
+if (env->ExceptionCheck())
+env->ExceptionDescribe();
+}
+
+void postDirectMessage(std::string message)
+{
+JNIThreadContext ctx;
+JNIEnv *env = ctx.getEnv();
+
+jstring jstr = env->NewStringUTF(message.c_str());
+jmethodID callPostMobileMessage = env->GetMethodID(g_loActivityClz, 
"postMobileMessage", "(Ljava/lang/String;)V");
+env->CallVoidMethod(g_loActivityObj, callPostMobileMessage, jstr);
 env->DeleteLocalRef(jstr);
 
 if (env->ExceptionCheck())
@@ -171,7 +189,7 @@ void closeDocument()
 
 /// Handle a message from JavaScript.
 extern "C" JNIEXPORT void JNICALL
-Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv 
*env, jobject instance, jstring message)
+Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv 
*env, jobject, jstring message)
 {
 const char *string_value = env->GetStringUTFChars(message, nullptr);
 
@@ -198,11 +216,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv *env,
 fakeSocketPipe2(closeNotificationPipeForForwardingThread);
 
 // Start another thread to read responses and forward them to the 
JavaScript
-jclass clz = env->GetObjectClass(instance);
-jclass loActivityClz = (jclass) env->NewGlobalRef(clz);
-jobject loActivityObj = env->NewGlobalRef(instance);
-
-std::thread([loActivityClz, loActivityObj, currentFakeClientFd]
+std::thread([currentFakeClientFd]
 {
 Util::setThreadName("app2js");
 JNIThreadContext ctx;
@@ -239,7 +253,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv *env,
return;
std::vector buf(n);
n = fakeSocketRead(currentFakeClientFd, 
buf.data(), n);
-

[Libreoffice-commits] online.git: android/lib

2020-07-15 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |6 
++
 1 file changed, 6 insertions(+)

New commits:
commit 0306b029ab078a2e83ad4f1eee2d7b44ad85545e
Author: Jan Holesovsky 
AuthorDate: Fri Jul 3 23:07:47 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Jul 15 23:46:17 2020 +0200

android: On ChromeOS, load files from Google Drive read-only.

Apparently it is not possible to save to Google Drive yet.
Unfortunately I don't have a proof in the documentation or anywhere on
the net, but the good indication of this is that the
Intent.ACTION_CREATE_DOCUMENT does not offer Google Drive (while it does
on a "normal" Android).

Change-Id: I521b866fd783b81a2bb9eace84354b5564ebabee
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97914
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 6111fc700..3374ff4ca 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -262,6 +262,12 @@ public class LOActivity extends AppCompatActivity {
 
 if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
 isDocEditable = (getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0;
+
+// turns out that on ChromeOS, it is not possible to save back
+// to Google Drive; detect it already here to avoid 
disappointment
+if 
(getIntent().getData().toString().startsWith("content://org.chromium.arc.chromecontentprovider/externalfile"))
+isDocEditable = false;
+
 if (!isDocEditable)
 Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-15 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   16 
--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit f0a3e28a67cd7f44f10fb792b04dcd40a43f26e2
Author: Jan Holesovsky 
AuthorDate: Fri Jul 3 22:38:23 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Jul 15 23:43:27 2020 +0200

android: Fallback to "w" mode, "wt" is not supported by Google Drive.

Would be cool to consolidate these two places actually to a common
method at some stage...

Change-Id: I5ff3aed134066f26bb058223b972ef11600fa887
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97912
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 3ea256a0a..6111fc700 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -483,7 +483,13 @@ public class LOActivity extends AppCompatActivity {
 inputStream = new FileInputStream(mTempFile);
 
 Uri uri = getIntent().getData();
-outputStream = contentResolver.openOutputStream(uri, "wt");
+try {
+outputStream = contentResolver.openOutputStream(uri, "wt");
+}
+catch (FileNotFoundException e) {
+Log.i(TAG, "failed with the 'wt' mode, trying without: " + 
e.getMessage());
+outputStream = contentResolver.openOutputStream(uri);
+}
 
 byte[] buffer = new byte[1024];
 int length;
@@ -583,7 +589,13 @@ public class LOActivity extends AppCompatActivity {
 LOActivity.this.saveAs(tempFile.toURI().toString(), 
format);
 
 inputStream = new FileInputStream(tempFile);
-outputStream = 
getContentResolver().openOutputStream(intent.getData(), "wt");
+try {
+outputStream = 
getContentResolver().openOutputStream(intent.getData(), "wt");
+}
+catch (FileNotFoundException e) {
+Log.i(TAG, "failed with the 'wt' mode, trying 
without: " + e.getMessage());
+outputStream = 
getContentResolver().openOutputStream(intent.getData());
+}
 
 byte[] buffer = new byte[4096];
 int len;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-15 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   31 
+-
 1 file changed, 18 insertions(+), 13 deletions(-)

New commits:
commit 1a92479087f8050e2654288f6b06bf688141bacb
Author: Jan Holesovsky 
AuthorDate: Mon Jul 13 18:21:28 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Jul 15 23:38:13 2020 +0200

android: Avoid calling methods of a destroyed WebView.

Avoids exceptions like:

2020-07-13 13:19:49.607 2919-2919/? I/LOActivity: Forwarding to the 
WebView: 'statusindicatorsetvalue: 86'
2020-07-13 13:19:49.609 2919-2919/? W/cr_AwContents: Application attempted 
to call on a destroyed WebView
java.lang.Throwable
at 
org.chromium.android_webview.AwContents.t(chromium-SystemWebViewGoogle.apk-stable-410410651:2)
at 
com.android.webview.chromium.WebViewChromium.loadUrl(chromium-SystemWebViewGoogle.apk-stable-410410651:11)
at android.webkit.WebView.loadUrl(WebView.java:970)
at org.libreoffice.androidlib.LOActivity$6.run(LOActivity.java:794)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6971)
at java.lang.reflect.Method.invoke(Native Method)
at 
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:865)

Change-Id: Ic853131bac937deec7e68723b956a4ab7cf61872
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98723
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98755
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 8465ff5e1..430d3265e 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -101,7 +101,7 @@ public class LOActivity extends AppCompatActivity {
 private URI documentUri;
 
 private String urlToLoad;
-private WebView mWebView;
+private WebView mWebView = null;
 private SharedPreferences sPrefs;
 private Handler mMainHandler = null;
 private RateAppController rateAppController;
@@ -532,6 +532,7 @@ public class LOActivity extends AppCompatActivity {
 if (viewGroup != null)
 viewGroup.removeView(mWebView);
 mWebView.destroy();
+mWebView = null;
 
 // Most probably the native part has already got a 'BYE' from
 // finishWithProgress(), but it is actually better to send it twice
@@ -762,20 +763,24 @@ public class LOActivity extends AppCompatActivity {
  */
 void callFakeWebsocketOnMessage(final String message) {
 // call from the UI thread
-mWebView.post(new Runnable() {
-public void run() {
-Log.i(TAG, "Forwarding to the WebView: " + message);
+if (mWebView != null)
+mWebView.post(new Runnable() {
+public void run() {
+if (mWebView != null)
+Log.i(TAG, "Skipped forwarding to the WebView: " + 
message);
 
-/* Debug only: in case the message is too long, truncated in 
the logcat, and you need to see it.
-final int size = 80;
-for (int start = 0; start < message.length(); start += size) {
-Log.i(TAG, "split: " + message.substring(start, 
Math.min(message.length(), start + size)));
-}
-*/
+Log.i(TAG, "Forwarding to the WebView: " + message);
 
-
mWebView.loadUrl("javascript:window.TheFakeWebSocket.onmessage({'data':" + 
message + "});");
-}
-});
+/* Debug only: in case the message is too long, truncated 
in the logcat, and you need to see it.
+final int size = 80;
+for (int start = 0; start < message.length(); start += 
size) {
+Log.i(TAG, "split: " + message.substring(start, 
Math.min(message.length(), start + size)));
+}
+*/
+
+
mWebView.loadUrl("javascript:window.TheFakeWebSocket.onmessage({'data':" + 
message + "});");
+}
+});
 
 // update progress bar when loading
 if (message.startsWith("'statusindicator") || 
message.startsWith("'error:")) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-15 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 
+++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit df6b5492725b1a6ac15cea287d5be2556415304c
Author: Jan Holesovsky 
AuthorDate: Tue Jul 14 17:07:01 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Jul 15 23:38:35 2020 +0200

android: A small follow-up, the intention was an early return.

Change-Id: I3a73cd03c9ec51b7f190092702b4ef860c1f589b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98772
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 430d3265e..3ea256a0a 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -766,8 +766,10 @@ public class LOActivity extends AppCompatActivity {
 if (mWebView != null)
 mWebView.post(new Runnable() {
 public void run() {
-if (mWebView != null)
+if (mWebView == null) {
 Log.i(TAG, "Skipped forwarding to the WebView: " + 
message);
+return;
+}
 
 Log.i(TAG, "Forwarding to the WebView: " + message);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-07-03 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 5d74642537a9ae3b49491c6352f2aa959e422d32
Author: Jan Holesovsky 
AuthorDate: Fri Jul 3 15:25:43 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Fri Jul 3 16:33:38 2020 +0200

android: Always re-do the fonts.conf, to update when the filter changed.

No idea how to add dependency on the build.gradle itself, so at least
this...

Change-Id: I7d43064d3a2299929b36a3ed3d5c13ada808c898
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97804
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 8882d8e5d..6177d0ca5 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -113,6 +113,12 @@ task copyUnpackAssets(type: Copy) {
 into('etc/fonts') {
 from "${liboSrcRoot}/android/source/"
 includes = ['fonts.conf']
+doFirst {
+// we have changed the filter below; so to always re-generate this
+// file, delete it first - no idea how to set a dependency on
+// build.gradle changes :-(
+file('fonts.conf').delete()
+}
 filter {
 String line ->
 line.replaceAll(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib common/Authorization.hpp wsd/ClientSession.hpp

2020-07-02 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |1 -
 common/Authorization.hpp   |2 +-
 wsd/ClientSession.hpp  |1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b39017c08c59766d7d12b06e1e015a00d649e8cb
Author: Jan Holesovsky 
AuthorDate: Thu Jul 2 10:15:20 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Jul 2 11:08:19 2020 +0200

android: Remove unneeded dependency + add some comments.

Change-Id: Idbc271a398f6f0c037d478bda5ee0b149ca4f24f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97730
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 2e1a5fdb8..4c4e1344a 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -5,7 +5,6 @@ add_library(androidapp SHARED
 androidapp.cpp
 ../../../../../common/Authorization.cpp
 ../../../../../common/FileUtil.cpp
-../../../../../common/JailUtil.cpp
 ../../../../../common/Log.cpp
 ../../../../../common/MessageQueue.cpp
 ../../../../../common/Protocol.cpp
diff --git a/common/Authorization.hpp b/common/Authorization.hpp
index 14accb236..b92b0d565 100644
--- a/common/Authorization.hpp
+++ b/common/Authorization.hpp
@@ -16,7 +16,7 @@
 #include 
 #include 
 
-/// Class to keep the authorization data.
+/// Class to keep the authorization data, which can be either access_token or 
access_header.
 class Authorization
 {
 public:
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 8922b924e..cc153bdd8 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -226,6 +226,7 @@ private:
 /// URI with which client made request to us
 const Poco::URI _uriPublic;
 
+/// Authorization data - either access_token or access_header.
 const Authorization _auth;
 
 /// The cookies we should pass on to the storage on saving.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib android/README configure.ac

2020-07-01 Thread Jan Holesovsky (via logerrit)
 android/README |   16 
 android/lib/src/main/cpp/CMakeLists.txt.in |4 ++
 configure.ac   |   53 -
 3 files changed, 64 insertions(+), 9 deletions(-)

New commits:
commit 37b3acbdf12364620e42bf41d0f1f4db2bebf967
Author: Jan Holesovsky 
AuthorDate: Wed Jul 1 11:10:01 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Jul 1 17:10:28 2020 +0200

android: Add support for x86 ABI too.

Turns out that the ChromeOS uses the x86 Android runtime, not x86-64.

Change-Id: Ic3b6f7a65d35d2298daa731f46e57068eaf2583d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97607
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/android/README b/android/README
index 7223e121e..5cffa4b4f 100644
--- a/android/README
+++ b/android/README
@@ -68,6 +68,22 @@ build the native parts on Windows.
   # install
   
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang 
CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install 
INSTALLDIR=/opt/poco-android-64bit
 
+* Poco for x86 (if you want to add the support for that into the APK too):
+
+  # checkout the 1.10.1 in yet another location
+  git clone https://github.com/pocoproject/poco poco-android-x86
+  cd poco-android-x86
+  git checkout -b poco-1.10.1 origin/poco-1.10.1
+
+  # configure
+  ./configure --config=Android --no-samples --no-tests 
--omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT
+
+  # build
+  
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=x86 CC=i686-linux-android21-clang 
CXX=i686-linux-android21-clang++ SYSLIBS=-static-libstdc++
+
+  # install
+  
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=x86 CC=i686-linux-android21-clang 
CXX=i686-linux-android21-clang++ SYSLIBS=-static-libstdc++ install 
INSTALLDIR=/opt/poco-android-x86
+
 * Poco for x86_64 (if you want to add the support for that into the APK too):
 
   # checkout the 1.10.1 in yet another location
diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 53a3fafd7..2e1a5fdb8 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -37,6 +37,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
 set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@)
 set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@)
 set(POCOLIB_ABI @POCOLIB_ARM64_V8A@)
+elseif(${ANDROID_ABI} STREQUAL "x86")
+set(LOBUILDDIR_ABI @LOBUILDDIR_X86@)
+set(POCOINCLUDE_ABI @POCOINCLUDE_X86@)
+set(POCOLIB_ABI @POCOLIB_X86@)
 elseif(${ANDROID_ABI} STREQUAL "x86_64")
 set(LOBUILDDIR_ABI @LOBUILDDIR_X86_64@)
 set(POCOINCLUDE_ABI @POCOINCLUDE_X86_64@)
diff --git a/configure.ac b/configure.ac
index 7a8177e91..ff78941ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,12 +168,14 @@ AC_ARG_WITH(android-package-versioncode,
 
 AC_ARG_WITH(android-abi,
 AS_HELP_STRING([--with-android-abi=x86_64],
-   [Allows specification of a concrete ABI that is to 
be built for.  By default, builds for all the 3
-supported ABIs at the same time: armeabi-v7a, 
arm64-v8a and x86_64.
+   [Allows specification of a concrete ABI that is to 
be built for, defaults to armeabi-v7a
+(when only one build dir is provided in 
--with-lo-builddir) or to all 4 supported ABIs at
+the same time (when there are more builddirs 
provided in --with-lo-builddir, separated
+by colons).  The supported ABIs are: armeabi-v7a, 
arm64-v8a, x86 and x86_64.
 Please note that you need to specify the 
parameters for --with-lo-builddir,
---with-poco-includes and --with-poco-libs in the 
order of armeabi-v7a:arm64-v8a:x86_64.  For
-example, when you use --with-android-abi=x86_64,
-you have to specify 
--with-lo-builddir=::/path/to/x86-64/builddir]),
+--with-poco-includes and --with-poco-libs in the 
order of armeabi-v7a:arm64-v8a:x86:x86_64.
+For example, when you use 
--with-android-abi=x86_64,
+you have to specify 
--with-lo-builddir=:::/path/to/x86-64/builddir]),
 ,)
 
 AC_ARG_WITH([app-name],
@@ -368,12 +370,15 @@ fi
 LOBUILDDIR=
 ANDROID_ABI=
 LOBUILDDIR_ARM64_V8A=
+LOBUILDDIR_X86=
 LOBUILDDIR_X86_64=
 POCOINCLUDE=
 POCOINCLUDE_ARM64_V8A=
+POCOINCLUDE_X86=
 POCOINCLUDE_X86_64=
 POCOLIB=
 POCOLIB_ARM64_V8A=
+POCOLIB_X86=
 POCOLIB_X86_64=
 POCODEBUG=
 CORE_VERSION_HASH=""
@@ -381,7 +386,7 @@ if test \( 

[Libreoffice-commits] online.git: android/lib common/Authorization.cpp common/Authorization.hpp test/Makefile.am test/WhiteBoxTests.cpp wsd/Admin.cpp wsd/ClientSession.cpp wsd/ClientSession.hpp

2020-06-30 Thread Ashod Nakashian (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |5 -
 common/Authorization.cpp   |   22 ++
 common/Authorization.hpp   |   10 ++
 test/Makefile.am   |2 
 test/WhiteBoxTests.cpp |  105 -
 wsd/Admin.cpp  |1 
 wsd/ClientSession.cpp  |   31 
 wsd/ClientSession.hpp  |4 -
 8 files changed, 142 insertions(+), 38 deletions(-)

New commits:
commit fa96934861b075cffd980cdfa98f61dee82fc012
Author: Ashod Nakashian 
AuthorDate: Sat Jun 20 14:09:21 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Wed Jul 1 07:33:57 2020 +0200

wsd: Authorization parsing and creation improvements

Authorization class now handles the parsing and creation
of its instances, which makes it centralized.

We also avoid repeatedly constructing Authorization objects
in ClientSession and instead do it once at construction
and cache it.

A bunch of new unit-tests added.

Change-Id: I9b5939be51a5957214d07ed8f1096efd179686c6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96825
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 56b5a8a52..53a3fafd7 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -3,12 +3,13 @@ cmake_minimum_required(VERSION 3.4.1)
 
 add_library(androidapp SHARED
 androidapp.cpp
+../../../../../common/Authorization.cpp
 ../../../../../common/FileUtil.cpp
 ../../../../../common/JailUtil.cpp
 ../../../../../common/Log.cpp
 ../../../../../common/MessageQueue.cpp
 ../../../../../common/Protocol.cpp
-   ../../../../../common/StringVector.cpp
+../../../../../common/StringVector.cpp
 ../../../../../common/Session.cpp
 ../../../../../common/SigUtil.cpp
 ../../../../../common/SpookyV2.cpp
@@ -21,7 +22,7 @@ add_library(androidapp SHARED
 ../../../../../wsd/ClientSession.cpp
 ../../../../../wsd/DocumentBroker.cpp
 ../../../../../wsd/LOOLWSD.cpp
-   ../../../../../wsd/RequestDetails.cpp
+../../../../../wsd/RequestDetails.cpp
 ../../../../../wsd/Storage.cpp
 ../../../../../wsd/TileCache.cpp)
 
diff --git a/common/Authorization.cpp b/common/Authorization.cpp
index ad4381ef5..93c5704fc 100644
--- a/common/Authorization.cpp
+++ b/common/Authorization.cpp
@@ -88,4 +88,26 @@ void Authorization::authorizeRequest(Poco::Net::HTTPRequest& 
request) const
 }
 }
 
+Authorization Authorization::create(const Poco::URI::QueryParameters& 
queryParams)
+{
+// prefer the access_token
+std::string decoded;
+for (const auto& param : queryParams)
+{
+if (param.first == "access_token")
+{
+Poco::URI::decode(param.second, decoded);
+return Authorization(Authorization::Type::Token, decoded);
+}
+
+if (param.first == "access_header")
+Poco::URI::decode(param.second, decoded);
+}
+
+if (!decoded.empty())
+return Authorization(Authorization::Type::Header, decoded);
+
+return Authorization();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Authorization.hpp b/common/Authorization.hpp
index 4fd2f3671..14accb236 100644
--- a/common/Authorization.hpp
+++ b/common/Authorization.hpp
@@ -28,8 +28,8 @@ public:
 };
 
 private:
-Type _type;
-std::string _data;
+const Type _type;
+const std::string _data;
 
 public:
 Authorization()
@@ -43,6 +43,12 @@ public:
 {
 }
 
+/// Create an Authorization instance from the URI query parameters.
+/// Expects access_token (preferred) or access_header.
+static Authorization create(const Poco::URI::QueryParameters& queryParams);
+static Authorization create(const Poco::URI& uri) { return 
create(uri.getQueryParameters()); }
+static Authorization create(const std::string& uri) { return 
create(Poco::URI(uri)); }
+
 /// Set the access_token parametr to the given uri.
 void authorizeURI(Poco::URI& uri) const;
 
diff --git a/test/Makefile.am b/test/Makefile.am
index ad48899a1..e05dfdf3f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -75,7 +75,7 @@ test_base_source = \
WopiProofTests.cpp \
$(wsd_sources)
 
-unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS -DSTANDALONE_CPPUNIT
+unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS -DSTANDALONE_CPPUNIT -g
 unittest_SOURCES = \
 $(test_base_source) \
 ../common/Log.cpp \
diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
index 47023d2fa..dd32dbdd6 100644
--- 

[Libreoffice-commits] online.git: android/lib common/Common.hpp common/FileUtil.cpp common/FileUtil.hpp common/JailUtil.cpp common/JailUtil.hpp common/Log.hpp common/security.h common/Session.cpp comm

2020-06-30 Thread Ashod Nakashian (via logerrit)
 Makefile.am|4 
 android/lib/src/main/cpp/CMakeLists.txt.in |1 
 common/Common.hpp  |2 
 common/FileUtil.cpp|   52 +++-
 common/FileUtil.hpp|   43 +++
 common/JailUtil.cpp|  364 +
 common/JailUtil.hpp|   70 +
 common/Log.hpp |1 
 common/Session.cpp |1 
 common/SigUtil.cpp |1 
 common/Util.cpp|   26 +-
 common/Util.hpp|   23 +
 common/security.h  |1 
 configure.ac   |2 
 debian/loolwsd.postinst.in |1 
 docker/Ubuntu  |1 
 kit/ForKit.cpp |   21 +
 kit/Kit.cpp|  199 ++-
 loolwsd-systemplate-setup  |5 
 loolwsd.spec.in|2 
 loolwsd.xml.in |1 
 net/Socket.cpp |1 
 net/Socket.hpp |1 
 test/run_unit.sh.in|2 
 tools/mount.cpp|  124 +
 wsd/LOOLWSD.cpp|   89 +++
 wsd/Storage.hpp|4 
 27 files changed, 836 insertions(+), 206 deletions(-)

New commits:
commit 5c9988f2e345ca82e7bb5f5e9bf66a30b82a0446
Author: Ashod Nakashian 
AuthorDate: Thu Apr 9 09:02:58 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Wed Jul 1 05:42:43 2020 +0200

wsd: faster jail setup via bind-mount

loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc..  When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).

A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.

Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.

The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.

This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.

As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.

The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.

The random temp directory is now created and set
correctly, plus many logging and other improvements.

Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/Makefile.am b/Makefile.am
index 171a07e36..d3f18e6a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,7 @@ export ENABLE_DEBUG
 
 bin_PROGRAMS = \
loolforkit \
+   loolmount \
loolconvert loolconfig
 
 if ENABLE_LIBFUZZER
@@ -87,6 +88,7 @@ AM_ETAGSFLAGS = --c++-kinds=+p --fields=+iaS --extra=+q -R 
--totals=yes --exclud
 AM_CTAGSFLAGS = $(AM_ETAGSFLAGS)
 
 shared_sources = common/FileUtil.cpp \
+ common/JailUtil.cpp \
  common/Log.cpp \
  common/Protocol.cpp \
  common/StringVector.cpp \
@@ -131,7 +133,6 @@ noinst_PROGRAMS = clientnb \
   lokitclient \
   loolmap \
   loolstress \
-  loolmount \
  

[Libreoffice-commits] online.git: android/lib ios/Mobile kit/ForKit.cpp kit/Kit.cpp kit/Kit.hpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp

2020-06-30 Thread Szymon Kłos (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |2 +-
 ios/Mobile/AppDelegate.mm   |2 +-
 kit/ForKit.cpp  |   10 +-
 kit/Kit.cpp |9 +++--
 kit/Kit.hpp |3 ++-
 wsd/LOOLWSD.cpp |9 -
 wsd/LOOLWSD.hpp |1 +
 7 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit 11965d083edd7dc0f2a1e8e872de3e79cb26ebf5
Author: Szymon Kłos 
AuthorDate: Fri Jun 26 12:58:09 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jun 30 08:15:25 2020 +0200

notebookbar: early init

- read settings from loolwsd.xml
- in case of notebookbar activated send :notebookbar parameter
- for mobile apps I left empty parameter in setupKitEnvironment calls

Change-Id: I5813589564b37eecc1e77c5d0eb737eca5f92f04
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97233
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 7570f96ca..e6a3f8a3b 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -45,7 +45,7 @@ JNI_OnLoad(JavaVM* vm, void*) {
 return JNI_ERR; // JNI version not supported.
 }
 
-setupKitEnvironment();
+setupKitEnvironment("");
 
 // Uncomment the following to see the logs from the core too
 //setenv("SAL_LOG", "+WARN+INFO", 0);
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index 9e5f19278..d38f04787 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -185,7 +185,7 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 if (!trace)
 trace = strdup("warning");
 
-setupKitEnvironment();
+setupKitEnvironment("");
 
 Log::initialize("Mobile", trace, false, false, {});
 Util::setThreadName("main");
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 3a0a0811d..b69e2593b 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -52,6 +52,8 @@ static bool SingleKit = false;
 #endif
 #endif
 
+static std::string UserInterface;
+
 static bool DisplayVersion = false;
 static std::string UnitTestLibrary;
 static std::string LogLevel;
@@ -539,6 +541,12 @@ int main(int argc, char** argv)
 LOG_ERR("Security: Running without the ability to filter system 
calls is ill advised.");
 NoSeccomp = true;
 }
+
+else if (std::strstr(cmd, "--ui") == cmd)
+{
+eq = std::strchr(cmd, '=');
+UserInterface = std::string(eq+1);
+}
 }
 
 if (loSubPath.empty() || sysTemplate.empty() ||
@@ -555,7 +563,7 @@ int main(int argc, char** argv)
 return EX_USAGE;
 }
 
-setupKitEnvironment();
+setupKitEnvironment(UserInterface);
 
 if (!std::getenv("LD_BIND_NOW")) // must be set by parent.
 LOG_INF("Note: LD_BIND_NOW is not set.");
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 7a5fc1f7a..b50ae65a4 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -2505,7 +2505,7 @@ void wakeCallback(void* pData)
 #endif
 }
 
-void setupKitEnvironment()
+void setupKitEnvironment(const std::string& userInterface)
 {
 // Setup & check environment
 const std::string layers(
@@ -2536,6 +2536,10 @@ void setupKitEnvironment()
 if (Log::logger().trace())
 options += ":profile_events";
 #endif
+
+if (userInterface == "notebookbar")
+options += ":notebookbar";
+
 //options += ":sc_no_grid_bg"; // leave this disabled for now, 
merged-cells needs more work.
 ::setenv("SAL_LOK_OPTIONS", options.c_str(), 0);
 }
@@ -2555,6 +2559,7 @@ void lokit_main(
 bool displayVersion,
 #else
 int docBrokerSocket,
+const std::string& userInterface,
 #endif
 size_t numericIdentifier
 )
@@ -2818,7 +2823,7 @@ void lokit_main(
 #ifndef IOS
 // Was not done by the preload.
 // For iOS we call it in -[AppDelegate application: 
didFinishLaunchingWithOptions:]
-setupKitEnvironment();
+setupKitEnvironment(userInterface);
 #endif
 
 #if defined(__linux) && !defined(__ANDROID__)
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index a5c6332b8..06a03034d 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -38,6 +38,7 @@ void lokit_main(
 bool displayVersion,
 #else
 int docBrokerSocket,
+const std::string& userInterface,
 #endif
 size_t numericIdentifier
 );
@@ -47,7 +48,7 @@ void runKitLoopInAThread();
 #endif
 
 /// We need to get several env. vars right
-void setupKitEnvironment();
+void setupKitEnvironment(const std::string& userInterface);
 
 bool globalPreinit(const std::string& loTemplate);
 /// Wrapper around private Document::ViewCallback().
diff --git a/wsd/LOOLWSD.cpp 

[Libreoffice-commits] online.git: android/lib

2020-06-29 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a12f6a64daac20bef85ae96989bc14ecd11e09e0
Author: Jan Holesovsky 
AuthorDate: Mon Jun 29 16:13:19 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Jun 29 16:17:12 2020 +0200

android: The location of liblo-native-code.so has changed.

By mistake, the commit 526db8b1bdb6007ad3ab7e69c7c193e164e58892 was a wrong
version of the patch; update it slightly.

Change-Id: I1c0148a7195a577a14440453688d506b83aa6ab4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97381
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 8f4e9fe2a..7b1dc9202 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -43,7 +43,7 @@ else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
 
-set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
+set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
 
 target_include_directories(androidapp PRIVATE
. # path to androidapp.h
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-06-29 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 526db8b1bdb6007ad3ab7e69c7c193e164e58892
Author: Jan Holesovsky 
AuthorDate: Mon Jun 29 15:35:07 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Jun 29 16:02:55 2020 +0200

android: The location of liblo-native-code.so has changed.

Don't try to look it up at the old location, that'll only cause
problems.

Change-Id: I6376770ce09c5a19cfe1514e1fd12c508a5fc3d0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97420
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index c1fec9f78..8f4e9fe2a 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -43,11 +43,7 @@ else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
 
-if(EXISTS 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
-set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
-else()
-set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
-endif()
+set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
 
 target_include_directories(androidapp PRIVATE
. # path to androidapp.h
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib android/README configure.ac

2020-06-29 Thread Jan Holesovsky (via logerrit)
 android/README |   37 ++
 android/lib/src/main/cpp/CMakeLists.txt.in |6 -
 configure.ac   |  157 -
 3 files changed, 130 insertions(+), 70 deletions(-)

New commits:
commit 661bb47d07c9b4fdac1d25f4420bbe00de9f6afe
Author: Jan Holesovsky 
AuthorDate: Fri Jun 26 14:25:48 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Jun 29 14:24:36 2020 +0200

android: Add x86-64 build too.

This will make it possible to create AAB's that contain 3 ABIs:
armeabi-v7a, arm64-v8a and x86_64.

If you want to build for just one ABI, use --with-android-abi=... where
the value is one of those three above.

Change-Id: I553b8ca941db67eddc1d712a96b818f9cfedd0fa
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97227
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/README b/android/README
index f4d737c94..7b525e357 100644
--- a/android/README
+++ b/android/README
@@ -65,6 +65,43 @@ build the native parts on Windows.
   # install
   
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang 
CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install 
INSTALLDIR=/opt/poco-android-64bit
 
+* Poco for x86_64 (if you want to add the support for that into the APK too):
+
+  # checkout the 1.10.1 in yet another location
+  git clone https://github.com/pocoproject/poco poco-android-x86-64
+  cd poco-android-x86-64
+  git checkout -b poco-1.10.1 origin/poco-1.10.1
+
+  # and apply the following patch:
+  diff --git a/build/config/Android b/build/config/Android
+  index 9227a3352..1abf6df7c 100644
+  --- a/build/config/Android
+  +++ b/build/config/Android
+  @@ -25,10 +25,14 @@ ifeq ($(ANDROID_ABI),x86)
+   TOOL  = i686-linux-android
+   ARCHFLAGS = -march=i686 -msse3 -mstackrealign -mfpmath=sse
+   else
+  +ifeq ($(ANDROID_ABI),x86_64)
+  +TOOL  = x86_64-linux-android
+  +else
+   $(error Invalid ABI specified in ANDROID_ABI)
+   endif
+   endif
+   endif
+  +endif
+   
+   #
+   # Define Tools
+
+  # configure
+  ./configure --config=Android --no-samples --no-tests 
--omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT
+
+  # build
+  
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang 
CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++
+
+  # install
+  
PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin 
make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang 
CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install 
INSTALLDIR=/opt/poco-android-x86-64
+
 * Configure the online.git (eg. in online-android folder)
 
   Don't forget to change --with-lo-builddir in the following:
diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 36b63132a..c1fec9f78 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -36,9 +36,9 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
 set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@)
 set(POCOLIB_ABI @POCOLIB_ARM64_V8A@)
 elseif(${ANDROID_ABI} STREQUAL "x86_64")
-set(LOBUILDDIR_ABI @LOBUILDDIR@)
-set(POCOINCLUDE_ABI @POCOINCLUDE@)
-set(POCOLIB_ABI @POCOLIB@)
+set(LOBUILDDIR_ABI @LOBUILDDIR_X86_64@)
+set(POCOINCLUDE_ABI @POCOINCLUDE_X86_64@)
+set(POCOLIB_ABI @POCOLIB_X86_64@)
 else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
diff --git a/configure.ac b/configure.ac
index 8d9cf761a..ace92e589 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,6 +166,16 @@ AC_ARG_WITH(android-package-versioncode,
[Set the versionCode for the Android package.]),
 ,)
 
+AC_ARG_WITH(android-abi,
+AS_HELP_STRING([--with-android-abi=x86_64],
+   [Allows specification of a concrete ABI that is to 
be built for.  By default, builds for all the 3
+supported ABIs at the same time: armeabi-v7a, 
arm64-v8a and x86_64.
+Please note that you need to specify the 
parameters for --with-lo-builddir,
+--with-poco-includes and --with-poco-libs in the 
order of armeabi-v7a:arm64-v8a:x86_64.  For
+example, when you use --with-android-abi=x86_64,
+you have to specify 
--with-lo-builddir=::/path/to/x86-64/builddir]),
+,)
+
 AC_ARG_WITH([app-name],
   AS_HELP_STRING([--with-app-name=],
  [Set the user-visible name of the app you 
build.]))
@@ -356,17 +366,28 @@ fi
 # to the Mac.
 # Android: We need these to setup the CMakeLists.txt 

[Libreoffice-commits] online.git: android/lib common/MobileApp.cpp common/MobileApp.hpp common/SigUtil.cpp common/SigUtil.hpp ios/config.h.in ios/ios.h ios/ios.mm ios/Mobile ios/Mobile.xcodeproj kit/C

2020-06-26 Thread Tor Lillqvist (via logerrit)
 Makefile.am |2 
 android/lib/src/main/cpp/androidapp.cpp |4 
 common/MobileApp.cpp|   46 +++
 common/MobileApp.hpp|   57 
 common/SigUtil.cpp  |   14 --
 common/SigUtil.hpp  |   25 ++-
 ios/Mobile.xcodeproj/project.pbxproj|   12 +
 ios/Mobile/AppDelegate.mm   |   32 ++--
 ios/Mobile/CODocument.h |1 
 ios/Mobile/CODocument.mm|   12 +
 ios/Mobile/DocumentViewController.h |1 
 ios/Mobile/DocumentViewController.mm|   48 ++-
 ios/Mobile/Info.plist.in|   19 ++
 ios/Mobile/SceneDelegate.h  |   18 ++
 ios/Mobile/SceneDelegate.m  |   20 +++
 ios/config.h.in |4 
 ios/ios.h   |3 
 ios/ios.mm  |4 
 kit/ChildSession.cpp|   12 -
 kit/ChildSession.hpp|2 
 kit/Kit.cpp |  209 +++-
 kit/Kit.hpp |7 -
 net/FakeSocket.cpp  |5 
 test/WhiteBoxTests.cpp  |5 
 wsd/DocumentBroker.cpp  |   23 +--
 wsd/DocumentBroker.hpp  |7 -
 wsd/LOOLWSD.cpp |   59 ++---
 wsd/LOOLWSD.hpp |4 
 28 files changed, 503 insertions(+), 152 deletions(-)

New commits:
commit 7f25109f72738706359a63c9062764699f00f568
Author: Tor Lillqvist 
AuthorDate: Fri Apr 24 10:46:54 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Jun 26 13:09:51 2020 +0200

tdf#128502: Chunk of work to enable "multi-tasking" in the iOS app

Seems to not cause any serious regressions in the iOS app or in "make
run", but of course I am not able to run a comprehensive check of all
functionality.

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

diff --git a/Makefile.am b/Makefile.am
index ca868c8e7..171a07e36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,6 +93,7 @@ shared_sources = common/FileUtil.cpp \
  common/Session.cpp \
  common/Seccomp.cpp \
  common/MessageQueue.cpp \
+ common/MobileApp.cpp \
  common/SigUtil.cpp \
  common/SpookyV2.cpp \
  common/Unit.cpp \
@@ -250,6 +251,7 @@ shared_headers = common/Common.hpp \
  common/Authorization.hpp \
  common/MessageQueue.hpp \
  common/Message.hpp \
+ common/MobileApp.hpp \
  common/Png.hpp \
  common/Rectangle.hpp \
  common/SigUtil.hpp \
diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index a3f847135..7570f96ca 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -225,10 +225,6 @@ 
Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv *env,
// is saved by closing it.

fakeSocketClose(closeNotificationPipeForForwardingThread[1]);
 
-   // Flag to make the inter-thread 
plumbing in the Online
-   // bits go away quicker.
-   MobileTerminationFlag = true;
-
// Close our end of the fake socket 
connection to the
// ClientSession thread, so that it 
terminates
fakeSocketClose(currentFakeClientFd);
diff --git a/common/MobileApp.cpp b/common/MobileApp.cpp
new file mode 100644
index 0..15706216b
--- /dev/null
+++ b/common/MobileApp.cpp
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ */
+
+#include 
+#include 
+#include 
+
+#include "MobileApp.hpp"
+
+#if MOBILEAPP
+
+static std::map idToDocDataMap;
+static std::mutex idToDocDataMapMutex;
+
+DocumentData (unsigned docId)
+{
+const std::lock_guard lock(idToDocDataMapMutex);
+
+assert(idToDocDataMap.find(docId) == idToDocDataMap.end());
+idToDocDataMap[docId] = DocumentData();
+return idToDocDataMap[docId];
+}
+
+DocumentData (unsigned docId)
+{
+const std::lock_guard lock(idToDocDataMapMutex);
+
+

[Libreoffice-commits] online.git: android/lib configure.ac

2020-06-11 Thread Henry Castro (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |5 +
 configure.ac   |   28 +++-
 2 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit 2eec63af299e2169d87f0563c6eb8637ac4154d4
Author: Henry Castro 
AuthorDate: Fri Jun 5 10:32:20 2020 -0400
Commit: Henry Castro 
CommitDate: Thu Jun 11 20:11:44 2020 +0200

android: add "x86_64" ABI build variant

Change-Id: I19281af5432ae5a02f26f33464ced722759a4c67
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95609
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 7715dbbdc..36b63132a 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -1,3 +1,4 @@
+
 cmake_minimum_required(VERSION 3.4.1)
 
 add_library(androidapp SHARED
@@ -34,6 +35,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
 set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@)
 set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@)
 set(POCOLIB_ABI @POCOLIB_ARM64_V8A@)
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+set(LOBUILDDIR_ABI @LOBUILDDIR@)
+set(POCOINCLUDE_ABI @POCOINCLUDE@)
+set(POCOLIB_ABI @POCOLIB@)
 else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
diff --git a/configure.ac b/configure.ac
index 3b2edb7c1..8d9cf761a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -356,7 +356,9 @@ fi
 # to the Mac.
 # Android: We need these to setup the CMakeLists.txt properly.
 LOBUILDDIR=
-ANDROID_ABI="armeabi-v7a"
+if test -z "$ANDROID_ABI"; then
+  ANDROID_ABI="armeabi-v7a"
+fi
 LOBUILDDIR_ARM64_V8A=
 POCOINCLUDE=
 POCOINCLUDE_ARM64_V8A=
@@ -379,6 +381,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check, just a random object file in the LibreOffice build tree 
- 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f 
"$LOBUILDDIR/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then
+   AC_MSG_RESULT([$LOBUILDDIR])
+   else
+   AC_MSG_ERROR([This is not a LibreOffice 64bit core build 
directory: $LOBUILDDIR])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f 
"$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then
AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A])
@@ -386,6 +395,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a LibreOffice 64bit core build 
directory: $LOBUILDDIR_ARM64_V8A])
fi
fi
+   fi
fi
 
# Get the git hash of the core build
@@ -411,6 +421,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check - 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f "$POCOINCLUDE/Poco/Poco.h"; then
+   AC_MSG_RESULT([$POCOINCLUDE])
+   else
+   AC_MSG_ERROR([This is not a Poco 64bit include directory: 
$POCOINCLUDE])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then
AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A])
@@ -418,6 +435,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a Poco 64bit include directory: 
$POCOINCLUDE_ARM64_V8A])
fi
fi
+   fi
fi
 
# Sanity check
@@ -440,6 +458,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check - 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f "$POCOLIB/libPocoFoundation.a"; then
+   AC_MSG_RESULT([$POCOLIB])
+   else
+   AC_MSG_ERROR([This is not a Poco 64bit lib directory: $POCOLIB])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then
AC_MSG_RESULT([$POCOLIB_ARM64_V8A])
@@ -447,6 +472,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a Poco 64bit lib directory: 
$POCOLIB_ARM64_V8A])
fi
fi
+   fi
fi
 
# Sanity check
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-06-11 Thread Henry Castro (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 56fb5793320254e8d46618be789e143e014fb83c
Author: Henry Castro 
AuthorDate: Fri Jun 5 10:26:48 2020 -0400
Commit: Henry Castro 
CommitDate: Thu Jun 11 18:27:58 2020 +0200

android: fix build when builddir != srcdir

Unfortunately the "liblo-native-code.so" file is located
in the LO source directory

Change-Id: I43ad3313ad2dba62d987cbdbaed5de490c52b9cc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95608
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index ad43e806c..7715dbbdc 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -38,6 +38,12 @@ else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
 
+if(EXISTS 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
+set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
+else()
+set(LIBLO_NATIVE_CODE 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so)
+endif()
+
 target_include_directories(androidapp PRIVATE
. # path to androidapp.h
../../../../..# path to config.h
@@ -88,8 +94,8 @@ add_custom_command(OUTPUT 
"${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}/liblo-
COMMAND ${CMAKE_COMMAND} -E copy 
${LOBUILDDIR_ABI}/instdir/program/libssl3.so 
"${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}"
DEPENDS ${LOBUILDDIR_ABI}/instdir/program/libssl3.so
 
-   COMMAND ${CMAKE_COMMAND} -E copy 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so 
"${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}"
-   DEPENDS 
${LOBUILDDIR_ABI}/android/source/jniLibs/${ANDROID_ABI}/liblo-native-code.so
+   COMMAND ${CMAKE_COMMAND} -E copy ${LIBLO_NATIVE_CODE} 
"${CMAKE_CURRENT_SOURCE_DIR}/lib/${ANDROID_ABI}"
+   DEPENDS ${LIBLO_NATIVE_CODE}
 
COMMENT "Copied liblo-native-code.so and its dependencies 
to the tree."
 )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib Makefile.am wsd/FileServer.cpp wsd/FileServer.hpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp wsd/RequestDetails.cpp wsd/RequestDetails.hpp wsd/ServerURL.hpp

2020-05-12 Thread Michael Meeks (via logerrit)
 Makefile.am|2 
 android/lib/src/main/cpp/CMakeLists.txt.in |1 
 wsd/FileServer.cpp |   22 ++--
 wsd/FileServer.hpp |   14 ++
 wsd/LOOLWSD.cpp|  159 -
 wsd/LOOLWSD.hpp|1 
 wsd/RequestDetails.cpp |   81 ++
 wsd/RequestDetails.hpp |   96 +
 wsd/ServerURL.hpp  |   15 --
 9 files changed, 237 insertions(+), 154 deletions(-)

New commits:
commit dec683218a0c26ecb5f13fd66c653024c2212cb7
Author: Michael Meeks 
AuthorDate: Tue May 12 16:19:41 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue May 12 20:30:17 2020 +0200

Proxy: move RequestDetails to its own header.

Share it with various other places requiring similar data.

Change-Id: I873f56798f5a34dcf7440456bd649b68f6d3df98
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94069
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/Makefile.am b/Makefile.am
index 1b5beb47c..d3c79a36b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -115,6 +115,7 @@ loolwsd_sources = common/Crypto.cpp \
   wsd/LOOLWSD.cpp \
   wsd/ClientSession.cpp \
   wsd/FileServer.cpp \
+  wsd/RequestDetails.cpp \
   wsd/Storage.cpp \
   wsd/TileCache.cpp \
   wsd/ProofKey.cpp
@@ -224,6 +225,7 @@ wsd_headers = wsd/Admin.hpp \
   wsd/LOOLWSD.hpp \
   wsd/ProofKey.hpp \
   wsd/QueueHandler.hpp \
+  wsd/RequestDetails.hpp \
   wsd/SenderQueue.hpp \
   wsd/ServerURL.hpp \
   wsd/Storage.hpp \
diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 7b5b5323f..ad43e806c 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -19,6 +19,7 @@ add_library(androidapp SHARED
 ../../../../../wsd/ClientSession.cpp
 ../../../../../wsd/DocumentBroker.cpp
 ../../../../../wsd/LOOLWSD.cpp
+   ../../../../../wsd/RequestDetails.cpp
 ../../../../../wsd/Storage.cpp
 ../../../../../wsd/TileCache.cpp)
 
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 8809a582a..3533a389f 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -265,7 +265,9 @@ bool FileServerRequestHandler::isAdminLoggedIn(const 
HTTPRequest& request,
 return true;
 }
 
-void FileServerRequestHandler::handleRequest(const HTTPRequest& request, 
Poco::MemoryInputStream& message,
+void FileServerRequestHandler::handleRequest(const HTTPRequest& request,
+ const RequestDetails 
,
+ Poco::MemoryInputStream& message,
  const 
std::shared_ptr& socket)
 {
 try
@@ -347,7 +349,7 @@ void FileServerRequestHandler::handleRequest(const 
HTTPRequest& request, Poco::M
 const std::string loleafletHtml = config.getString("loleaflet_html", 
"loleaflet.html");
 if (endPoint == loleafletHtml)
 {
-preprocessFile(request, message, socket);
+preprocessFile(request, requestDetails, message, socket);
 return;
 }
 
@@ -358,7 +360,7 @@ void FileServerRequestHandler::handleRequest(const 
HTTPRequest& request, Poco::M
 endPoint == "adminHistory.html" ||
 endPoint == "adminAnalytics.html")
 {
-preprocessAdminFile(request, socket);
+preprocessAdminFile(request, requestDetails, socket);
 return;
 }
 
@@ -644,10 +646,12 @@ constexpr char BRANDING_UNSUPPORTED[] = 
"branding-unsupported";
 namespace {
 }
 
-void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, 
Poco::MemoryInputStream& message,
+void FileServerRequestHandler::preprocessFile(const HTTPRequest& request,
+  const RequestDetails 
,
+  Poco::MemoryInputStream& message,
   const 
std::shared_ptr& socket)
 {
-ServerURL cnxDetails(request);
+ServerURL cnxDetails(requestDetails);
 
 const Poco::URI::QueryParameters params = 
Poco::URI(request.getURI()).getQueryParameters();
 
@@ -691,7 +695,7 @@ void FileServerRequestHandler::preprocessFile(const 
HTTPRequest& request, Poco::
 }
 
 std::string socketProxy = "false";
-if (request.has("ProxyPrefix"))
+if (requestDetails.isProxy())
 socketProxy = "true";
 Poco::replaceInPlace(preprocess, std::string("%SOCKET_PROXY%"), 
socketProxy);
 
@@ -905,7 +909,9 @@ void 

[Libreoffice-commits] online.git: android/lib kit/ChildSession.cpp loleaflet/src wsd/ClientSession.cpp

2020-05-08 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |8 
++
 kit/ChildSession.cpp |7 
+++--
 loleaflet/src/control/Control.JSDialogBuilder.js |7 
-
 loleaflet/src/layer/tile/TileLayer.js|2 +
 wsd/ClientSession.cpp|   12 
--
 5 files changed, 20 insertions(+), 16 deletions(-)

New commits:
commit 3cd1e0d4395cbdf98a4eb922eb02cbb912c2f2ef
Author: Jan Holesovsky 
AuthorDate: Thu May 7 16:16:03 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 8 12:03:11 2020 +0200

function bar: Index the function by name, not by index.

Depends on a core change that changes the ABI of the completeFunction().

Change-Id: I27daf31d49347c4a308518e14a9b8b97f3b48991
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93667
Reviewed-by: Andras Timar 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 870a7ec5620eb742bd8fb2a9680ff67101a37dd7)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93541
Reviewed-by: Szymon Kłos 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index ca60f9b5c..5074d637a 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -813,6 +813,14 @@ public class LOActivity extends AppCompatActivity {
 mWebView.post(new Runnable() {
 public void run() {
 Log.i(TAG, "Forwarding to the WebView: " + message);
+
+/* Debug only: in case the message is too long, truncated in 
the logcat, and you need to see it.
+final int size = 80;
+for (int start = 0; start < message.length(); start += size) {
+Log.i(TAG, "split: " + message.substring(start, 
Math.min(message.length(), start + size)));
+}
+*/
+
 
mWebView.loadUrl("javascript:window.TheFakeWebSocket.onmessage({'data':" + 
message + "});");
 }
 });
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index f576f2785..b02e7a17a 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1428,10 +1428,11 @@ bool ChildSession::dialogEvent(const char* /*buffer*/, 
int /*length*/, const Str
 
 bool ChildSession::completeFunction(const char* /*buffer*/, int /*length*/, 
const StringVector& tokens)
 {
-int index;
+std::string functionName;
 
 if (tokens.size() != 2 ||
-!getTokenInteger(tokens[1], "index", index))
+!getTokenString(tokens[1], "name", functionName) ||
+functionName.empty())
 {
 sendTextFrameAndLogError("error: cmd=completefunction kind=syntax");
 return false;
@@ -1439,7 +1440,7 @@ bool ChildSession::completeFunction(const char* 
/*buffer*/, int /*length*/, cons
 
 getLOKitDocument()->setView(_viewId);
 
-getLOKitDocument()->completeFunction(index);
+getLOKitDocument()->completeFunction(functionName.c_str());
 return true;
 }
 
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ef0b4646e..9c99e31f5 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -488,14 +488,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
$(contentDiv).hide();
if (builder.wizard) {
var that = this;
+   var functionName = data.functionName;
$(rightDiv).click(function() {
builder.wizard.goLevelDown(contentDiv);
if (contentNode.onshow)
contentNode.onshow();
});
$(leftDiv).click(function() {
-   that.map._socket.sendMessage('completefunction 
index=' + data.index);
-   that.map.fire('closemobilewizard');
+   if (functionName !== '') {
+   
that.map._socket.sendMessage('completefunction name=' + functionName);
+   that.map.fire('closemobilewizard');
+   }
});
} else {
console.debug('Builder used outside of mobile wizard: 
please implement the click handler');
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 1947bc894..1b413f9d7 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -824,6 +824,7 @@ L.TileLayer = L.GridLayer.extend({
   

[Libreoffice-commits] online.git: android/lib android/Makefile.am configure.ac Makefile.am

2020-04-23 Thread Henry Castro (via logerrit)
 Makefile.am  |4 
 android/Makefile.am  |   16 
 android/lib/build.gradle |   19 +++
 configure.ac |3 +--
 4 files changed, 20 insertions(+), 22 deletions(-)

New commits:
commit a2410c599cf4855fa1ed04194e76c291a134964b
Author: Henry Castro 
AuthorDate: Wed Apr 22 12:33:33 2020 -0400
Commit: Andras Timar 
CommitDate: Thu Apr 23 09:09:11 2020 +0200

android: convert remaining rules to gradle tasks

It will give an Independence (at least) to the
gradle build system to package the product

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

diff --git a/Makefile.am b/Makefile.am
index ff7ad0b5f..dcbfbdcbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,8 @@ if ENABLE_MOBILEAPP
 if ENABLE_GTKAPP
 SUBDIRS = gtk loleaflet
 else
-if ENABLE_ANDROIDAPP
-SUBDIRS = loleaflet android
-else
 SUBDIRS = loleaflet
 endif
-endif
 
 else
 
diff --git a/android/Makefile.am b/android/Makefile.am
deleted file mode 100644
index d717a8b6a..0
--- a/android/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-clean-local:
-   rm -rf $(abs_top_srcdir)/android/lib/src/main/assets/*
-   rm -rf app/build
-
-all-local: lib/src/main/assets/templates/untitled.odp \
-  lib/src/main/assets/templates/untitled.ods \
-  lib/src/main/assets/templates/untitled.odt \
-  lib/src/main/assets/etc/loolwsd/loolkitconfig.xcu
-
-lib/src/main/assets/templates/untitled.%: templates/untitled.%
-   @mkdir -p $(dir $@)
-   @cp -a $< $@
-
-lib/src/main/assets/etc/loolwsd/loolkitconfig.xcu: 
$(top_srcdir)/loolkitconfig-mobile.xcu
-   @mkdir -p $(dir $@)
-   @cp -a $< $@
diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 94c505d42..50cb2fc43 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -186,6 +186,19 @@ task copyBrandTheme(type: Copy) {
into "src/main/assets/share/theme_definitions/online"
 }
 
+task copyDocTemplates(type: Copy) {
+from "${rootProject.getRootDir()}/templates/untitled.odp",
+ "${rootProject.getRootDir()}/templates/untitled.ods",
+ "${rootProject.getRootDir()}/templates/untitled.odt"
+into "src/main/assets/templates"
+}
+
+task copyKitConfig(type: Copy) {
+from 
"${file(rootProject.getRootDir()).getParent()}/loolkitconfig-mobile.xcu"
+into "src/main/assets/etc/loolwsd"
+rename { "loolkitconfig.xcu" }
+}
+
 task createStrippedConfig {
 def preserveDir = file("src/main/assets/share/config/soffice.cfg/empty")
 outputs.dir "src/main/assets/share/registry/res"
@@ -276,6 +289,10 @@ ReferenceOOoMajorMinor=4.1
 }
 }
 
+clean.doFirst {
+   delete "src/main/assets"
+}
+
 // creating the UI stuff is cheap, don't bother only applying it for the 
flavor..
 preBuild.dependsOn 'createRCfiles',
 'createFullConfig',
@@ -285,4 +302,6 @@ afterEvaluate {
if (!file("${liboBrandingDir}").exists()) {
copyBrandTheme.enabled = false
}
+   generateDebugAssets.dependsOn copyDocTemplates, copyKitConfig
+   generateReleaseAssets.dependsOn copyDocTemplates, copyKitConfig
 }
diff --git a/configure.ac b/configure.ac
index 013a2c492..8973269d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1080,8 +1080,7 @@ if test "$enable_iosapp" = "yes"; then
 fi
 
 if test "$enable_androidapp" = "yes"; then
-AC_CONFIG_FILES([android/Makefile
- $srcdir/android/build.gradle:android/build.gradle.in
+AC_CONFIG_FILES([$srcdir/android/build.gradle:android/build.gradle.in
  
$srcdir/android/app/appSettings.gradle:android/app/appSettings.gradle.in
  
$srcdir/android/lib/libSettings.gradle:android/lib/libSettings.gradle.in
  
$srcdir/android/lib/src/main/cpp/CMakeLists.txt:android/lib/src/main/cpp/CMakeLists.txt.in])
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib kit/Kit.cpp kit/Kit.hpp

2020-04-21 Thread Tor Lillqvist (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |   20 ++--
 kit/Kit.cpp |   26 --
 kit/Kit.hpp |6 --
 3 files changed, 34 insertions(+), 18 deletions(-)

New commits:
commit b94fb53d4d52bf3f847025aebbebe0383c41ffc8
Author: Tor Lillqvist 
AuthorDate: Tue Apr 21 13:42:24 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Apr 21 13:43:43 2020 +0200

tdf#128502: Make _loKitDocument in class Document non-static again

It was made static in ea2b77ce07d615e72c29b7016b464a9147373805 for
Android's sake, so returning it to be per-instance is not a big thing.

Keep a separate static just for the Android app's use for now, while
the Android app supports just one open document at a time anyway. (It
is for the iOS app that I am moving towards supporting multiple open
documents at a time.)

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

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index defe7b628..a3f847135 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -340,7 +340,7 @@ Java_org_libreoffice_androidlib_LOActivity_saveAs(JNIEnv 
*env, jobject instance,
 const char *fileUri = env->GetStringUTFChars(fileUri_, 0);
 const char *format = env->GetStringUTFChars(format_, 0);
 
-getLOKDocument()->saveAs(fileUri, format, nullptr);
+getLOKDocumentForAndroidOnly()->saveAs(fileUri, format, nullptr);
 
 env->ReleaseStringUTFChars(fileUri_, fileUri);
 env->ReleaseStringUTFChars(format_, format);
@@ -356,7 +356,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_postUnoCommand(JNIEnv* pEnv, jobject
 if (arguments != nullptr)
 pArguments = pEnv->GetStringUTFChars(arguments, nullptr);
 
-getLOKDocument()->postUnoCommand(pCommand, pArguments, 
bNotifyWhenFinished);
+getLOKDocumentForAndroidOnly()->postUnoCommand(pCommand, pArguments, 
bNotifyWhenFinished);
 
 pEnv->ReleaseStringUTFChars(command, pCommand);
 if (arguments != nullptr)
@@ -402,9 +402,9 @@ 
Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, jobj
 jclass class_LokClipboardData = env->GetObjectClass(lokClipboardData);
 jfieldID fieldId_LokClipboardData_clipboardEntries = 
env->GetFieldID(class_LokClipboardData , "clipboardEntries", 
"Ljava/util/ArrayList;");
 
-if (getLOKDocument()->getClipboard(mimeTypes,
-   , ,
-   , ))
+if (getLOKDocumentForAndroidOnly()->getClipboard(mimeTypes,
+ , ,
+ , ))
 {
 // return early
 if (outCount == 0)
@@ -440,9 +440,9 @@ 
Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, jobj
 
 const char* mimeTypesHTML[] = { "text/plain;charset=utf-8", "text/html", 
nullptr };
 
-if (getLOKDocument()->getClipboard(mimeTypesHTML,
-   , ,
-   , ))
+if (getLOKDocumentForAndroidOnly()->getClipboard(mimeTypesHTML,
+ , ,
+ , ))
 {
 // return early
 if (outCount == 0)
@@ -522,7 +522,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_setClipboardContent(JNIEnv *env, jobj
 pStreams[nEntryIndex] = dataArray;
 }
 
-getLOKDocument()->setClipboard(nEntrySize, pMimeTypes, pSizes, pStreams);
+getLOKDocumentForAndroidOnly()->setClipboard(nEntrySize, pMimeTypes, 
pSizes, pStreams);
 }
 
 extern "C"
@@ -533,7 +533,7 @@ Java_org_libreoffice_androidlib_LOActivity_paste(JNIEnv 
*env, jobject instance,
 size_t dataArrayLength = env->GetArrayLength(inData);
 char* dataArray = new char[dataArrayLength];
 env->GetByteArrayRegion(inData, 0, dataArrayLength, 
reinterpret_cast(dataArray));
-getLOKDocument()->paste(mimeType, dataArray, dataArrayLength);
+getLOKDocumentForAndroidOnly()->paste(mimeType, dataArray, 
dataArrayLength);
 env->ReleaseStringUTFChars(inMimeType, mimeType);
 }
 
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 142392f6e..a34b91334 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1427,6 +1427,9 @@ private:
 _sessions.size() << " sessions still. Destroying the 
document.");
 #ifdef IOS
 lok_document = nullptr;
+#endif
+#ifdef __ANDROID__
+_loKitDocumentForAndroidOnly.reset();
 #endif
 _loKitDocument.reset();
 LOG_INF("Document [" << anonymizeUrl(_url) << "] session [" << 
sessionId << "] unloaded Document.");
@@ -1661,6 +1664,9 @@ private:
 

[Libreoffice-commits] online.git: android/lib

2020-03-18 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java 
|   28 ++
 1 file changed, 19 insertions(+), 9 deletions(-)

New commits:
commit 1b4e40198ccab88bf09a05bb130b8f646faa8077
Author: Jan Holesovsky 
AuthorDate: Wed Mar 18 12:08:41 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 18:29:31 2020 +0100

android: Tabs to spaces.

Change-Id: I5ab52ef34126f2c3e90ff9199d2e42dd24bc6ebe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90693
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
 
b/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
index 85fc62710..4ae654f6d 100644
--- 
a/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
+++ 
b/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
@@ -1,3 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ */
+
 package org.libreoffice.androidlib.lok;
 
 import android.util.Base64;
@@ -42,10 +51,10 @@ public class LokClipboardData implements Serializable {
 public boolean writeToFile(File file) {
 try {
 FileOutputStream fileStream = new 
FileOutputStream(file.getAbsoluteFile());
-   ObjectOutputStream oos = new ObjectOutputStream(fileStream);
-   oos.writeObject(this);
-   oos.close();
-   fileStream.close();
+ObjectOutputStream oos = new ObjectOutputStream(fileStream);
+oos.writeObject(this);
+oos.close();
+fileStream.close();
 } catch (IOException e) {
 e.printStackTrace();
 return false;
@@ -56,11 +65,11 @@ public class LokClipboardData implements Serializable {
 public static LokClipboardData createFromFile(File file) {
 try {
 FileInputStream fileStream = new 
FileInputStream(file.getAbsoluteFile());
-   ObjectInputStream ois = new ObjectInputStream(fileStream);
-   LokClipboardData data = (LokClipboardData)ois.readObject();
-   ois.close();
-   fileStream.close();
-   return data;
+ObjectInputStream ois = new ObjectInputStream(fileStream);
+LokClipboardData data = (LokClipboardData)ois.readObject();
+ois.close();
+fileStream.close();
+return data;
 } catch (IOException e) {
 e.printStackTrace();
 return null;
@@ -78,3 +87,4 @@ public class LokClipboardData implements Serializable {
 }
 }
 
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-18 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/res/layout/lolib_dialog_loading.xml |   35 ---
 1 file changed, 20 insertions(+), 15 deletions(-)

New commits:
commit bd3d5faef834c6bd3e5b15c2596bd39c6294d326
Author: Jan Holesovsky 
AuthorDate: Wed Mar 18 11:51:11 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 18:29:13 2020 +0100

android: Always use the horizontal progress bar.

It is hard have a determinate circular progress bar, so let's use
horizontal progress bar for both determinate & indeterminate.

They both look a bit different (the indeterminate is vertically
narrower), but there was no simple trick to make them look the same, so
I gave up for the moment.

Change-Id: Ife3690204a8abd8bf17afe5c7d749a3ac2730c20
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90691
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/res/layout/lolib_dialog_loading.xml 
b/android/lib/src/main/res/layout/lolib_dialog_loading.xml
index b0fef6554..6b07467f5 100644
--- a/android/lib/src/main/res/layout/lolib_dialog_loading.xml
+++ b/android/lib/src/main/res/layout/lolib_dialog_loading.xml
@@ -2,33 +2,38 @@
 http://schemas.android.com/apk/res/android;
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
-android:orientation="horizontal"
-android:padding="20dp">
+android:orientation="vertical"
+android:padding="24dp">
+
+
 
 
 
 
+style="?android:attr/progressBarStyleHorizontal"
+android:layout_width="match_parent"
+android:layout_height="wrap_content"
+android:indeterminateOnly="true"
+android:visibility="invisible"/>
 
 
+android:min="0"
+android:visibility="visible" />
 
 
-
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-18 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 
++--
 android/lib/src/main/res/values/strings.xml  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9f44d03471954686294ff6f91125c5ec7861c297
Author: Jan Holesovsky 
AuthorDate: Wed Mar 18 10:46:50 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 18:28:57 2020 +0100

android: When quitting the app, use a neutral "Exiting" instead of "Saving".

Change-Id: I2fce16b74843a4ea8a3dea4471f6c9fff834f439
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90690
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 54e6363ce..ca60f9b5c 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -421,7 +421,7 @@ public class LOActivity extends AppCompatActivity {
 }
 
 final Intent finalIntent = intent;
-mProgressDialog.indeterminate(R.string.saving);
+mProgressDialog.indeterminate(R.string.exiting);
 getMainHandler().post(new Runnable() {
 @Override
 public void run() {
@@ -676,7 +676,7 @@ public class LOActivity extends AppCompatActivity {
 
 /** Show the Saving progress and finish the app. */
 private void finishWithProgress() {
-mProgressDialog.indeterminate(R.string.saving);
+mProgressDialog.indeterminate(R.string.exiting);
 
 // The 'BYE' takes a considerable amount of time, we need to post it
 // so that it starts after the saving progress is actually shown
diff --git a/android/lib/src/main/res/values/strings.xml 
b/android/lib/src/main/res/values/strings.xml
index 176a41790..dff5fb931 100644
--- a/android/lib/src/main/res/values/strings.xml
+++ b/android/lib/src/main/res/values/strings.xml
@@ -4,7 +4,6 @@
 Failed to determine the file to 
load
 Failed to insert image
 Cannot open file chooser
-Saving...
 Preparing for 
the first start after an update.
 Rate now
 Later
@@ -13,4 +12,5 @@
 
 
 Loading...
+Exiting...
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-18 Thread Michael Meeks (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java   
 |8 -
 android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java 
 |   49 --
 
android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardEntry.java 
|4 
 3 files changed, 29 insertions(+), 32 deletions(-)

New commits:
commit 10c293d014f3d95f5238a01d4071c0774f5a7a0d
Author: Michael Meeks 
AuthorDate: Tue Mar 17 21:06:50 2020 +
Commit: Andras Timar 
CommitDate: Wed Mar 18 11:27:42 2020 +0100

android: use Java object serialization instead of JSON.

This is incredibly quicker, JSON serialization was the bulk of the
performance issue, and took handful of seconds for a chart.

Change-Id: I51bebae6324c3d466f843ee737b051b911cd5fff
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90673
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 4070f955f..54e6363ce 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -56,6 +56,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.BufferedWriter;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.ByteBuffer;
@@ -1105,10 +1106,9 @@ public class LOActivity extends AppCompatActivity {
 
 File clipboardFile = new 
File(getApplicationContext().getCacheDir(), CLIPBOARD_FILE_PATH);
 LokClipboardData clipboardData = null;
-if (clipboardFile.exists()) {
-clipboardData = new LokClipboardData();
-clipboardData.loadFromFile(clipboardFile);
-}
+if (clipboardFile.exists())
+clipboardData = 
LokClipboardData.createFromFile(clipboardFile);
+
 if (clipboardData != null) {
 LOActivity.this.setClipboardContent(clipboardData);
 LOActivity.this.postUnoCommand(".uno:Paste", null, 
false);
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
 
b/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
index 3d98b5dfe..85fc62710 100644
--- 
a/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
+++ 
b/android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java
@@ -4,17 +4,21 @@ import android.util.Base64;
 import android.util.JsonReader;
 import android.util.JsonWriter;
 
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-public class LokClipboardData {
+public class LokClipboardData implements Serializable {
 public ArrayList clipboardEntries = new 
ArrayList();
 
 public String getText() {
@@ -37,16 +41,11 @@ public class LokClipboardData {
 
 public boolean writeToFile(File file) {
 try {
-FileWriter fileWriter = new FileWriter(file.getAbsoluteFile());
-JsonWriter writer = new JsonWriter(fileWriter);
-writer.setIndent(" ");
-writer.beginObject();
-for (LokClipboardEntry entry : clipboardEntries) {
-writer.name(entry.mime);
-writer.value(Base64.encodeToString(entry.data, 
Base64.DEFAULT));
-}
-writer.endObject();
-writer.close();
+FileOutputStream fileStream = new 
FileOutputStream(file.getAbsoluteFile());
+   ObjectOutputStream oos = new ObjectOutputStream(fileStream);
+   oos.writeObject(this);
+   oos.close();
+   fileStream.close();
 } catch (IOException e) {
 e.printStackTrace();
 return false;
@@ -54,25 +53,21 @@ public class LokClipboardData {
 return true;
 }
 
-public boolean loadFromFile(File file) {
+public static LokClipboardData createFromFile(File file) {
 try {
-clipboardEntries.clear();
-
-FileReader fileReader= new FileReader(file.getAbsoluteFile());
-JsonReader reader = new JsonReader(fileReader);
-reader.beginObject();
-while (reader.hasNext()) {
-LokClipboardEntry entry = new LokClipboardEntry();
-entry.mime = 

[Libreoffice-commits] online.git: android/lib

2020-03-17 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java|  
 46 ---
 android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java |  
134 ++
 2 files changed, 87 insertions(+), 93 deletions(-)

New commits:
commit eab62f8ab7ecf455cec286bf52f049a3951448ab
Author: Jan Holesovsky 
AuthorDate: Tue Mar 17 23:05:39 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 00:36:38 2020 +0100

android: Move the code to RateAppController & simplify a bit.

Change-Id: I03eb0dbce22b83bac2c3cfc06db1bff2faaac076
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90677
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index de3f5da3b..4070f955f 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -410,25 +410,6 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
-/** opens up the app page on Google Play */
-private void openInGooglePlay() {
-String marketUri = String.format("market://details?id=%1$s", 
getPackageName());
-String webUri = 
String.format("https://play.google.com/store/apps/details?id=%1$s;, 
getPackageName());
-
-Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
-if (getPackageManager().queryIntentActivities(intent, 0).size() <= 0) {
-intent = new Intent(Intent.ACTION_VIEW, Uri.parse(webUri));
-if (getPackageManager().queryIntentActivities(intent, 0).size() <= 
0) {
-intent = null;
-}
-}
-
-if (intent != null) {
-rateAppController.updateStatus();
-startActivity(intent);
-}
-}
-
 @Override
 protected void onNewIntent(Intent intent) {
 
@@ -855,31 +836,8 @@ public class LOActivity extends AppCompatActivity {
 }
 else if (message.startsWith("'statusindicatorfinish:") || 
message.startsWith("'error:")) {
 mProgressDialog.dismiss();
-if (BuildConfig.GOOGLE_PLAY_ENABLED && 
rateAppController != null && rateAppController.shouldAsk()) {
-android.app.AlertDialog.Builder builder = new 
android.app.AlertDialog.Builder(LOActivity.this);
-final View rateAppLayout = 
getLayoutInflater().inflate(R.layout.rate_app_layout, null);
-builder.setView(rateAppLayout);
-RatingBar ratingBar = 
rateAppLayout.findViewById(R.id.ratingBar);
-
-
builder.setPositiveButton(getString(R.string.rate_now), new 
DialogInterface.OnClickListener() {
-@Override
-public void onClick(DialogInterface dialog, 
int which) {
-// start google play activity for rating
-openInGooglePlay();
-}
-});
-
builder.setNegativeButton(getString(R.string.later), null);
-final AlertDialog alertDialog = builder.create();
-ratingBar.setOnRatingBarChangeListener(new 
RatingBar.OnRatingBarChangeListener() {
-@Override
-public void onRatingChanged(RatingBar 
ratingBar1, float v, boolean b) {
-// start google play activity for rating
-openInGooglePlay();
-alertDialog.dismiss();
-}
-});
-alertDialog.show();
-}
+if (BuildConfig.GOOGLE_PLAY_ENABLED && 
rateAppController != null)
+rateAppController.askUserForRating();
 }
 }
 });
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
index 5b819ff33..57a7717f0 100644
--- 
a/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
+++ 
b/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
@@ -9,78 +9,114 @@
 
 package org.libreoffice.androidlib;
 
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.Uri;
+import android.view.View;
+import android.widget.RatingBar;
+
+import androidx.appcompat.app.AlertDialog;
+
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 
+/** Class to take care of 

[Libreoffice-commits] online.git: android/lib

2020-03-17 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle|  
  2 
 android/lib/libSettings.gradle.in   |  
  1 
 android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java |  
 36 +-
 android/lib/src/main/res/layout/rate_app_layout.xml |  
 22 +++---
 android/lib/src/main/res/values/strings.xml |  
  3 
 5 files changed, 38 insertions(+), 26 deletions(-)

New commits:
commit b5e599f3c92c45b19e706c987d6b72b8263559b8
Author: Jan Holesovsky 
AuthorDate: Wed Mar 18 00:31:43 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 00:37:03 2020 +0100

android: Beautify the rating dialog.

Change-Id: I2114b42cf0f21526ab4035c1ad69ba25dee4aa7b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90678
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index ceac6b811..812a8a7aa 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -24,6 +24,7 @@ android {
 
 buildTypes {
 debug {
+resValue "string", "app_name", "${liboAppName} Debug"
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
 buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
@@ -33,6 +34,7 @@ android {
 debuggable true
 }
 release {
+resValue "string", "app_name", "${liboAppName}"
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
 buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
diff --git a/android/lib/libSettings.gradle.in 
b/android/lib/libSettings.gradle.in
index 3b6208fb7..9bcd1b58b 100644
--- a/android/lib/libSettings.gradle.in
+++ b/android/lib/libSettings.gradle.in
@@ -1,4 +1,5 @@
 ext {
+liboAppName = '@APP_NAME@'
 liboSrcRoot = '@LOBUILDDIR@'
 liboInstdir = '@LOBUILDDIR@/instdir'
 liboEtcFolder   = 'program'
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
index 57a7717f0..1f652d12b 100644
--- 
a/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
+++ 
b/android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java
@@ -9,9 +9,11 @@
 
 package org.libreoffice.androidlib;
 
+import android.annotation.SuppressLint;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
+import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RatingBar;
 
@@ -57,28 +59,32 @@ public class RateAppController {
 if (!shouldAsk())
 return;
 
-AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
 final View rateAppLayout = 
mActivity.getLayoutInflater().inflate(R.layout.rate_app_layout, null);
-builder.setView(rateAppLayout);
 
-builder.setPositiveButton(R.string.rate_now, new 
DialogInterface.OnClickListener() {
-@Override
-public void onClick(DialogInterface dialog, int which) {
-// start google play activity for rating
-openInGooglePlay();
-}
-});
-builder.setNegativeButton(R.string.later, null);
+AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
+builder.setView(rateAppLayout)
+
.setTitle(String.format(mActivity.getString(R.string.rate_our_app_title), 
mActivity.getString(R.string.app_name)))
+.setPositiveButton(R.string.rate_now, new 
DialogInterface.OnClickListener() {
+@Override
+public void onClick(DialogInterface dialog, int which) {
+// start google play activity for rating
+openInGooglePlay();
+}
+})
+.setNegativeButton(R.string.later, null);
 
 final AlertDialog alertDialog = builder.create();
 
 RatingBar ratingBar = rateAppLayout.findViewById(R.id.ratingBar);
-ratingBar.setOnRatingBarChangeListener(new 
RatingBar.OnRatingBarChangeListener() {
+ratingBar.setOnTouchListener(new View.OnTouchListener() {
 @Override
-public void onRatingChanged(RatingBar ratingBar1, float v, boolean 
b) {
-// start google play activity for rating
-openInGooglePlay();
-alertDialog.dismiss();
+public boolean onTouch(View v, MotionEvent event) {
+if (event.getAction() == MotionEvent.ACTION_UP) {
+// start google play activity for rating
+openInGooglePlay();
+alertDialog.dismiss();
+

[Libreoffice-commits] online.git: android/lib configure.ac

2020-03-17 Thread mert (via logerrit)
 android/lib/build.gradle|  
  2 
 android/lib/libSettings.gradle.in   |  
  1 
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java|  
 57 ++
 android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java |  
 86 ++
 android/lib/src/main/res/layout/rate_app_layout.xml |  
 28 +++
 android/lib/src/main/res/values/strings.xml |  
  3 
 configure.ac|  
 10 +
 7 files changed, 186 insertions(+), 1 deletion(-)

New commits:
commit 76f4c6de3be7c8e70c29afcadd9a1b10ab6a34bd
Author: mert 
AuthorDate: Fri Mar 13 21:21:14 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 00:36:05 2020 +0100

android: added a rating dialog

Change-Id: If1fed5bff1f7b607027d01a69d09de997fae8473
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90479
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 8af6e8a2a..ceac6b811 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -25,6 +25,7 @@ android {
 buildTypes {
 debug {
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
 abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as 
String})
@@ -33,6 +34,7 @@ android {
 }
 release {
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
 abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as 
String})
diff --git a/android/lib/libSettings.gradle.in 
b/android/lib/libSettings.gradle.in
index d492e0389..3b6208fb7 100644
--- a/android/lib/libSettings.gradle.in
+++ b/android/lib/libSettings.gradle.in
@@ -10,4 +10,5 @@ ext {
 liboGitFullCommit   = '@LOOLWSD_VERSION_HASH@'
 liboApplicationId   = '@ANDROID_PACKAGE_NAME@'
 liboAndroidAbi  = '@ANDROID_ABI@'
+liboGooglePlay  = '@APP_GOOGLE_PLAY@'
 }
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 0459b8db2..de3f5da3b 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -10,11 +10,13 @@
 package org.libreoffice.androidlib;
 
 import android.Manifest;
+import android.app.AlertDialog;
 import android.content.ClipData;
 import android.content.ClipDescription;
 import android.content.ClipboardManager;
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.pm.ApplicationInfo;
@@ -43,6 +45,7 @@ import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.RatingBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -65,7 +68,6 @@ import java.util.Map;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.core.app.ActivityCompat;
 import androidx.core.content.ContextCompat;
@@ -101,6 +103,7 @@ public class LOActivity extends AppCompatActivity {
 private WebView mWebView;
 private SharedPreferences sPrefs;
 private Handler mMainHandler = null;
+private RateAppController rateAppController;
 
 private boolean isDocEditable = false;
 private boolean isDocDebuggable = BuildConfig.DEBUG;
@@ -263,6 +266,10 @@ public class LOActivity extends AppCompatActivity {
 
 setContentView(R.layout.lolib_activity_main);
 mProgressDialog = new ProgressDialog(this);
+if (BuildConfig.GOOGLE_PLAY_ENABLED)
+this.rateAppController = new RateAppController(this);
+else
+this.rateAppController = null;
 
 init();
 }
@@ -403,6 +410,25 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
+/** opens up the app page on Google Play */
+private void openInGooglePlay() {
+String marketUri = String.format("market://details?id=%1$s", 
getPackageName());
+String webUri = 
String.format("https://play.google.com/store/apps/details?id=%1$s;, 
getPackageName());
+
+Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
+if 

[Libreoffice-commits] online.git: android/lib loleaflet/src

2020-03-17 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |5 
+
 loleaflet/src/control/Control.Menubar.js |2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 876854d3ebb859d9bce870c9a80dd2c83b20e57d
Author: Jan Holesovsky 
AuthorDate: Tue Mar 17 12:41:41 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 00:35:00 2020 +0100

android: Add support for EPUB, but disable it for the moment.

It needs support in the core that is currently missing...

Change-Id: I417172bca0c7d32dfda0a11bd8a9894ec33d72fa
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90653
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 299dd57eb..0459b8db2 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -132,6 +132,7 @@ public class LOActivity extends AppCompatActivity {
 public static final int REQUEST_SAVEAS_DOC = 509;
 public static final int REQUEST_SAVEAS_PPT = 510;
 public static final int REQUEST_SAVEAS_XLS = 511;
+public static final int REQUEST_SAVEAS_EPUB = 512;
 
 /** Broadcasting event for passing info back to the shell. */
 public static final String LO_ACTIVITY_BROADCAST = "LOActivityBroadcast";
@@ -608,6 +609,7 @@ public class LOActivity extends AppCompatActivity {
 case REQUEST_SAVEAS_DOC:
 case REQUEST_SAVEAS_PPT:
 case REQUEST_SAVEAS_XLS:
+case REQUEST_SAVEAS_EPUB:
 if (intent == null) {
 return;
 }
@@ -659,6 +661,7 @@ public class LOActivity extends AppCompatActivity {
 case REQUEST_SAVEAS_DOC: return "doc";
 case REQUEST_SAVEAS_PPT: return "ppt";
 case REQUEST_SAVEAS_XLS: return "xls";
+case REQUEST_SAVEAS_EPUB: return "epub";
 }
 return null;
 }
@@ -941,6 +944,7 @@ public class LOActivity extends AppCompatActivity {
 case "doc": return REQUEST_SAVEAS_DOC;
 case "ppt": return REQUEST_SAVEAS_PPT;
 case "xls": return REQUEST_SAVEAS_XLS;
+case "epub": return REQUEST_SAVEAS_EPUB;
 }
 return 0;
 }
@@ -958,6 +962,7 @@ public class LOActivity extends AppCompatActivity {
 case "doc": return "application/msword";
 case "ppt": return "application/vnd.ms-powerpoint";
 case "xls": return "application/vnd.ms-excel";
+case "epub": return "application/epub+zip";
 }
 return null;
 }
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 7bd57d538..5759d2e99 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -477,7 +477,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Word 2003 Document (.doc)'), id: 
'downloadas-doc', type: 'action'},
{name: _('Word Document (.docx)'), id: 
'downloadas-docx', type: 'action'},
{name: _('Rich Text (.rtf)'), id: 
'downloadas-rtf', type: 'action'},
-   {name: _('EPUB (.epub)'), id: 
'downloadas-epub', type: 'action'}
+   {name: _('EPUB (.epub)'), id: 
'downloadas-epub', type: 'action', mobileapp: false}
]},
{name: _UNO('.uno:EditMenu', 'text'), id: 'editmenu', 
type: 'menu', menu: [
{uno: '.uno:Undo'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-17 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 
++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 805806826b713dbfe72b6f1bbe0f14be9d5969b5
Author: Jan Holesovsky 
AuthorDate: Mon Mar 16 17:40:09 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Mar 17 09:29:18 2020 +0100

android: Dismiss the progress directly in finishWithProgress().

Otherwise sometimes we get a warning that a view remained open.

Change-Id: If24d2b8895e79fb2991f9948944b409309783059
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90586
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index c1edd099a..299dd57eb 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -676,12 +676,12 @@ public class LOActivity extends AppCompatActivity {
 postMobileMessageNative("BYE");
 copyTempBackToIntent();
 
-/*runOnUiThread(new Runnable() {
+runOnUiThread(new Runnable() {
 @Override
 public void run() {
 mProgressDialog.dismiss();
 }
-});*/
+});
 
 finishAndRemoveTask();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-16 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   24 
+++---
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit da9897f72575a502711cbb7b84fc7817cb31c2bd
Author: Jan Holesovsky 
AuthorDate: Mon Mar 16 18:35:43 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Mar 16 19:42:06 2020 +0100

android: Use "wt" mode even for Export As.

And use a real tempfile for that when I'm touching this code.

Change-Id: Iad6ea41b9e9c6459f66f1dee0258092ead1b8de5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90587
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 434b467ce..c1edd099a 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -613,20 +613,32 @@ public class LOActivity extends AppCompatActivity {
 }
 String format = getFormatForRequestCode(requestCode);
 if (format != null) {
-final File tempFile = new 
File(LOActivity.this.getCacheDir(), "temp.file");
-LOActivity.this.saveAs(tempFile.toURI().toString(), 
format);
-try (InputStream inputStream = new 
FileInputStream(tempFile)) {
-OutputStream outputStream = 
getContentResolver().openOutputStream(intent.getData());
+InputStream inputStream = null;
+OutputStream outputStream = null;
+try {
+final File tempFile = 
File.createTempFile("LibreOffice", "." + format, this.getCacheDir());
+LOActivity.this.saveAs(tempFile.toURI().toString(), 
format);
+
+inputStream = new FileInputStream(tempFile);
+outputStream = 
getContentResolver().openOutputStream(intent.getData(), "wt");
+
 byte[] buffer = new byte[4096];
 int len;
-while ((len = inputStream.read(buffer)) > 0) {
+while ((len = inputStream.read(buffer)) != -1) {
 outputStream.write(buffer, 0, len);
 }
 outputStream.flush();
-outputStream.close();
 } catch (Exception e) {
 Toast.makeText(this, "Something went wrong while 
Saving as: " + e.getMessage(), Toast.LENGTH_SHORT).show();
 e.printStackTrace();
+} finally {
+try {
+if (inputStream != null)
+inputStream.close();
+if (outputStream != null)
+outputStream.close();
+} catch (Exception e) {
+}
 }
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-16 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 67757fac7e88edc528d10f9071c66ba22644dc67
Author: Jan Holesovsky 
AuthorDate: Mon Mar 16 17:38:23 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Mar 16 19:40:31 2020 +0100

android: Fix file corruption.

The problem was that when we were uploading back to the content Uri and
the length was shorter than the original content, the file remained as
long as before the save - which then was detected as corrupted file upon
further load.

Change-Id: Ica09a64739dbf7933d5722149134e461ae79bd80
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90585
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 8e5c3c7fe..434b467ce 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -522,7 +522,7 @@ public class LOActivity extends AppCompatActivity {
 inputStream = new FileInputStream(mTempFile);
 
 Uri uri = getIntent().getData();
-outputStream = contentResolver.openOutputStream(uri);
+outputStream = contentResolver.openOutputStream(uri, "wt");
 
 byte[] buffer = new byte[1024];
 int length;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-16 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   22 
+++---
 1 file changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 56632cc1c9bce65787608f60d454cd016b9e1eee
Author: Jan Holesovsky 
AuthorDate: Mon Mar 16 17:35:37 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Mar 16 19:40:09 2020 +0100

android: Cosmetic improvements to the content Uri download / upload.

Change-Id: I290211e0024dfc86c1f57314bbef00f7117928bd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90584
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index e02ce5382..8e5c3c7fe 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -484,11 +484,13 @@ public class LOActivity extends AppCompatActivity {
 
 byte[] buffer = new byte[1024];
 int length;
-while ((length = inputStream.read(buffer)) > 0) {
+long bytes = 0;
+while ((length = inputStream.read(buffer)) != -1) {
 outputStream.write(buffer, 0, length);
+bytes += length;
 }
-Log.e(TAG, "Success copying from " + uri + " to " + mTempFile);
-return true;
+
+Log.i(TAG, "Success copying " + bytes + " bytes from " + uri + 
" to " + mTempFile);
 } finally {
 if (inputStream != null)
 inputStream.close();
@@ -496,10 +498,14 @@ public class LOActivity extends AppCompatActivity {
 outputStream.close();
 }
 } catch (FileNotFoundException e) {
+Log.e(TAG, "file not found: " + e.getMessage());
 return false;
 } catch (IOException e) {
+Log.e(TAG, "exception: " + e.getMessage());
 return false;
 }
+
+return true;
 }
 
 /** Check that we have created a temp file, and if yes, copy it back to 
the content: URI. */
@@ -513,16 +519,20 @@ public class LOActivity extends AppCompatActivity {
 
 try {
 try {
+inputStream = new FileInputStream(mTempFile);
+
 Uri uri = getIntent().getData();
 outputStream = contentResolver.openOutputStream(uri);
-inputStream = new FileInputStream(mTempFile);
 
 byte[] buffer = new byte[1024];
 int length;
-while ((length = inputStream.read(buffer)) > 0) {
+long bytes = 0;
+while ((length = inputStream.read(buffer)) != -1) {
 outputStream.write(buffer, 0, length);
+bytes += length;
 }
-Log.e(TAG, "Success copying from " + mTempFile + " to " + uri);
+
+Log.i(TAG, "Success copying " + bytes + " bytes from " + 
mTempFile + " to " + uri);
 } finally {
 if (inputStream != null)
 inputStream.close();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-16 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 
++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b10113158efc2f646cc4ef14e6cb94521746e749
Author: Jan Holesovsky 
AuthorDate: Mon Mar 16 11:20:51 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Mar 16 19:38:16 2020 +0100

android: Dismiss the progress dialog on error too.

Change-Id: Ib88e98769bb59134ca90268a6a177459023aa842
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90583
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 470431e5b..e02ce5382 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -781,7 +781,7 @@ public class LOActivity extends AppCompatActivity {
 });
 
 // update progress bar when loading
-if (message.startsWith("'statusindicator")) {
+if (message.startsWith("'statusindicator") || 
message.startsWith("'error:")) {
 runOnUiThread(new Runnable() {
 public void run() {
 // update progress bar if it exists
@@ -798,7 +798,7 @@ public class LOActivity extends AppCompatActivity {
 
 mProgressDialog.determinateProgress(progress);
 }
-else if (message.startsWith("'statusindicatorfinish:")) {
+else if (message.startsWith("'statusindicatorfinish:") || 
message.startsWith("'error:")) {
 mProgressDialog.dismiss();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-03-04 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   21 
++
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 0897397834608ff8f87382cac896f8912260616c
Author: Tomaž Vajngerl 
AuthorDate: Wed Mar 4 11:33:17 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Mar 4 13:28:07 2020 +0100

android: create mainHandler on demand to prevent NPE

A crash happens when "back" is hit with a NPE exception because
mainHandler is null (not yet initilized). This changes the code
so mainHandler is initialized on demand and if not before, then
at least when initUI is called.

Change-Id: Id20b2093315ba41dac205fc4e94f31d00a4fe1f1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89953
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index c7796d05c..d54ab18ce 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -100,7 +100,7 @@ public class LOActivity extends AppCompatActivity {
 private String urlToLoad;
 private WebView mWebView;
 private SharedPreferences sPrefs;
-private Handler mainHandler;
+private Handler mMainHandler = null;
 
 private boolean isDocEditable = false;
 private boolean isDocDebuggable = BuildConfig.DEBUG;
@@ -246,6 +246,13 @@ public class LOActivity extends AppCompatActivity {
 return true;
 }
 
+private Handler getMainHandler() {
+if (mMainHandler == null) {
+mMainHandler = new Handler(getMainLooper());
+}
+return mMainHandler;
+}
+
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
@@ -350,7 +357,7 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
-mainHandler = new Handler(getMainLooper());
+getMainHandler();
 
 clipboardManager = (ClipboardManager) 
getSystemService(CLIPBOARD_SERVICE);
 nativeMsgThread = new Thread(new Runnable() {
@@ -408,7 +415,7 @@ public class LOActivity extends AppCompatActivity {
 
 final Intent finalIntent = intent;
 mProgressDialog.indeterminate(R.string.saving);
-mainHandler.post(new Runnable() {
+getMainHandler().post(new Runnable() {
 @Override
 public void run() {
 documentLoaded = false;
@@ -642,7 +649,7 @@ public class LOActivity extends AppCompatActivity {
 
 // The 'BYE' takes a considerable amount of time, we need to post it
 // so that it starts after the saving progress is actually shown
-mainHandler.post(new Runnable() {
+getMainHandler().post(new Runnable() {
 @Override
 public void run() {
 documentLoaded = false;
@@ -810,7 +817,7 @@ public class LOActivity extends AppCompatActivity {
 finishWithProgress();
 return false;
 case "PRINT":
-mainHandler.post(new Runnable() {
+getMainHandler().post(new Runnable() {
 @Override
 public void run() {
 LOActivity.this.initiatePrint();
@@ -836,7 +843,7 @@ public class LOActivity extends AppCompatActivity {
 }
 break;
 case "DIM_SCREEN": {
-mainHandler.post(new Runnable() {
+getMainHandler().post(new Runnable() {
 @Override
 public void run() {
 
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@@ -845,7 +852,7 @@ public class LOActivity extends AppCompatActivity {
 return false;
 }
 case "LIGHT_SCREEN": {
-mainHandler.post(new Runnable() {
+getMainHandler().post(new Runnable() {
 @Override
 public void run() {
 
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/src

2020-02-29 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   
78 ---
 android/lib/src/main/java/org/libreoffice/androidlib/ProgressDialog.java |  
105 ++
 android/lib/src/main/res/layout/lolib_dialog_loading.xml |   
31 ++
 loleaflet/src/map/Map.js |
6 
 4 files changed, 181 insertions(+), 39 deletions(-)

New commits:
commit 0acb00fc24bbdc15f63bc36d619cd7cb2cbb9b04
Author: Jan Holesovsky 
AuthorDate: Fri Feb 28 18:30:52 2020 +0100
Commit: Michael Meeks 
CommitDate: Sat Feb 29 11:03:42 2020 +0100

android: Handle the loading progress directly in the app.

This way we can easily extend the "preparing for the 1st start" to the
follow-up "loading..."

It should also look better while the webview is being initialized etc.

Change-Id: I8de2dd96a726fa8302df558f691b1db82c9c8e71
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89733
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 4a7c23151..ef8aa9bf3 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -43,7 +43,6 @@ import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
-import android.widget.ProgressBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -114,6 +113,8 @@ public class LOActivity extends AppCompatActivity {
 private Looper nativeLooper;
 private Bundle savedInstanceState;
 
+private ProgressDialog mProgressDialog = null;
+
 /** In case the mobile-wizard is visible, we have to intercept the 
Android's Back button. */
 private boolean mMobileWizardVisible = false;
 
@@ -251,7 +252,10 @@ public class LOActivity extends AppCompatActivity {
 this.savedInstanceState = savedInstanceState;
 getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
 sPrefs = 
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+
 setContentView(R.layout.lolib_activity_main);
+mProgressDialog = new ProgressDialog(this);
+
 init();
 }
 
@@ -263,8 +267,7 @@ public class LOActivity extends AppCompatActivity {
 return;
 }
 
-final AlertDialog assetsProgress = 
createProgressDialog(R.string.preparing_for_the_first_start_after_an_update);
-assetsProgress.show();
+
mProgressDialog.indeterminate(R.string.preparing_for_the_first_start_after_an_update);
 
 new AsyncTask() {
 @Override
@@ -278,7 +281,6 @@ public class LOActivity extends AppCompatActivity {
 
 @Override
 protected void onPostExecute(Void aVoid) {
-assetsProgress.dismiss();
 initUI();
 }
 }.execute();
@@ -507,18 +509,16 @@ public class LOActivity extends AppCompatActivity {
 
 @Override
 protected void onPause() {
-super.onPause();
-Log.d(TAG, "onPause() - hinting to save, we might need to return to 
the doc");
-
 // A Save similar to an autosave
 if (documentLoaded)
 postMobileMessageNative("save dontTerminateEdit=true 
dontSaveIfUnmodified=true");
+
+super.onPause();
+Log.d(TAG, "onPause() - hinting to save, we might need to return to 
the doc");
 }
 
 @Override
 protected void onDestroy() {
-super.onDestroy();
-Log.i(TAG, "onDestroy() - we know we are leaving the document");
 nativeLooper.quit();
 
 // Remove the webview from the hierarchy & destroy
@@ -532,6 +532,11 @@ public class LOActivity extends AppCompatActivity {
 // than never, so let's call it from here too anyway
 documentLoaded = false;
 postMobileMessageNative("BYE");
+
+mProgressDialog.dismiss();
+
+super.onDestroy();
+Log.i(TAG, "onDestroy() - we know we are leaving the document");
 }
 
 @Override
@@ -601,24 +606,9 @@ public class LOActivity extends AppCompatActivity {
 return null;
 }
 
-/** Create the progress dialog. */
-private AlertDialog createProgressDialog(int id) {
-LayoutInflater inflater = this.getLayoutInflater();
-
-View loadingView = inflater.inflate(R.layout.lolib_dialog_loading, 
null);
-TextView loadingText = 
loadingView.findViewById(R.id.lolib_loading_dialog_text);
-loadingText.setText(getText(id));
-
-return new AlertDialog.Builder(LOActivity.this)
-.setView(loadingView)
-.setCancelable(true)
-.create();
-}
-
 /** Show the Saving progress and finish the app. */
 private void 

[Libreoffice-commits] online.git: android/lib common/Message.hpp common/MessageQueue.cpp common/Protocol.cpp common/Protocol.hpp common/Seccomp.cpp common/Seccomp.hpp common/Session.cpp common/Session

2020-02-28 Thread Miklos Vajna (via logerrit)
 Makefile.am|7 ++
 android/lib/src/main/cpp/CMakeLists.txt.in |1 
 common/Message.hpp |8 +-
 common/MessageQueue.cpp|   14 ++---
 common/Protocol.cpp|8 +-
 common/Protocol.hpp|   14 ++---
 common/Seccomp.cpp |2 
 common/Seccomp.hpp |5 -
 common/Session.cpp |2 
 common/Session.hpp |2 
 common/StringVector.cpp|   45 
 common/StringVector.hpp|   51 ++
 common/Util.cpp|2 
 common/Util.hpp|4 +
 kit/ChildSession.cpp   |   80 ++---
 kit/ChildSession.hpp   |   72 +-
 kit/ForKit.cpp |6 +-
 kit/Kit.cpp|   14 ++---
 test/Makefile.am   |1 
 test/TileCacheTests.cpp|8 +-
 test/UnitAdmin.cpp |   16 ++---
 test/UnitBadDocLoad.cpp|2 
 test/UnitClose.cpp |2 
 test/UnitCursor.cpp|2 
 test/UnitInsertDelete.cpp  |6 +-
 test/UnitLoad.cpp  |2 
 test/UnitPasswordProtected.cpp |4 -
 test/UnitRenderingOptions.cpp  |2 
 test/UnitSession.cpp   |2 
 test/UnitWOPIWatermark.cpp |2 
 test/WhiteBoxTests.cpp |4 -
 test/helpers.hpp   |4 -
 tools/Connect.cpp  |2 
 tools/KitClient.cpp|2 
 tools/WebSocketDump.cpp|2 
 wsd/Admin.cpp  |6 +-
 wsd/Auth.cpp   |2 
 wsd/ClientSession.cpp  |   18 +++---
 wsd/ClientSession.hpp  |   10 +--
 wsd/DocumentBroker.cpp |4 -
 wsd/FileServer.cpp |2 
 wsd/LOOLWSD.cpp|4 -
 wsd/Storage.cpp|6 +-
 wsd/TileCache.cpp  |2 
 wsd/TileDesc.hpp   |   16 ++---
 wsd/TraceFile.hpp  |2 
 46 files changed, 289 insertions(+), 183 deletions(-)

New commits:
commit b8bd1990aaa1b063ca21b78ffec629b5d5ae7697
Author: Miklos Vajna 
AuthorDate: Fri Feb 28 10:50:58 2020 +0100
Commit: Miklos Vajna 
CommitDate: Fri Feb 28 16:07:56 2020 +0100

Rework LOOLProtocol::tokenize() to return a StringVector object

The bulk of this commit just changes std::vector to
StringVector when we deal with tokens from a websocket message.

The less boring part of it is the new StringVector class, which is a
wrapper around std::vector, and provides the same API,
except that operator[] returns a string, not a string&, and this allows
returning an empty string in case that prevents reading past the end of
the underlying array.

This means in case client code forgets to check size() before invoking
operator[], we don't crash. (See the ~3 previous commits which fixed
such crashes.)

Later the ctor could be changed to take a single underlying string to
avoid lots of tiny allocations, that's not yet done in this commit.

Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/Makefile.am b/Makefile.am
index 1ee125b1f..bf5725b92 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,6 +92,7 @@ shared_sources = common/FileUtil.cpp \
  common/IoUtil.cpp \
  common/Log.cpp \
  common/Protocol.cpp \
+ common/StringVector.cpp \
  common/Session.cpp \
  common/Seccomp.cpp \
  common/MessageQueue.cpp \
@@ -138,12 +139,14 @@ endif
 connect_SOURCES = tools/Connect.cpp \
   common/Log.cpp \
   common/Protocol.cpp \
+  common/StringVector.cpp \
   common/Util.cpp
 
 lokitclient_SOURCES = common/IoUtil.cpp \
   common/Log.cpp \
   tools/KitClient.cpp \
   common/Protocol.cpp \
+  common/StringVector.cpp \
   common/Util.cpp
 
 loolforkit_sources = kit/ChildSession.cpp \
@@ -170,6 +173,7 @@ clientsession_fuzzer_LDFLAGS = -fsanitize=fuzzer 
$(AM_LDFLAGS)
 
 clientnb_SOURCES = net/clientnb.cpp \
common/Log.cpp \
+  

[Libreoffice-commits] online.git: android/lib

2020-02-26 Thread Andras Timar (via logerrit)
 android/lib/build.gradle |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 86ac72e6f3bd74daa375989d3207d8890268c366
Author: Andras Timar 
AuthorDate: Wed Feb 26 11:36:52 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Feb 26 17:21:13 2020 +0100

android: include French spellchecking dictionary

Change-Id: Iea4845b557d32ec3f97b9dd2803807fee27cc745
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89529
Reviewed-by: Michael Meeks 
Tested-by: Andras Timar 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 3f8a61d79..8af6e8a2a 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -134,7 +134,7 @@ task copyUnpackAssets(type: Copy) {
 into('share') {
 from "${liboInstdir}/share"
 // extensions - for the dictionaries for hunspell
-includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 
'extensions/dict-es/**', 'extensions/dict-pt-BR/**']
+includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 
'extensions/dict-es/**', 'extensions/dict-fr/**', 'extensions/dict-pt-BR/**']
 exclude { FileTreeElement details ->
 !(details.file.isDirectory() ||
 details.file.name.endsWith('.xcu') ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-24 Thread mert (via logerrit)
 android/lib/build.gradle |   16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 04dc25bfe09c52424d4a58073886353ecea14f08
Author: mert 
AuthorDate: Tue Feb 25 00:14:13 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Tue Feb 25 00:16:51 2020 +0100

android: reduce the dictionary files

we copy dictionary files more than necessary
only the required ones are included

Change-Id: I200a95b2593109ff10e7214476fe6ddd2e792ae5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89384
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 46771f320..3f8a61d79 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -127,9 +127,21 @@ task copyUnpackAssets(type: Copy) {
 }
 into('share') {
 from "${liboInstdir}/share"
-// extensions - for the dictionaries for hunspell
 // liblangtag data is needed for locales like en-CH
-includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 
'extensions/dict-es/**', 'extensions/dict-pt-BR/**', 'liblangtag/**']
+include 'liblangtag/**'
+}
+
+into('share') {
+from "${liboInstdir}/share"
+// extensions - for the dictionaries for hunspell
+includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 
'extensions/dict-es/**', 'extensions/dict-pt-BR/**']
+exclude { FileTreeElement details ->
+!(details.file.isDirectory() ||
+details.file.name.endsWith('.xcu') ||
+details.file.name.endsWith('.dic') ||
+details.file.name.endsWith('.aff') ||
+details.file.name.endsWith('.xml'))
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loolkitconfig-mobile.xcu

2020-02-24 Thread Michael Meeks (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |2 +-
 loolkitconfig-mobile.xcu   |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7d4580733f27314a2ddf1290f6e92b0b07c96a52
Author: Michael Meeks 
AuthorDate: Mon Feb 24 22:10:36 2020 +
Commit: Michael Meeks 
CommitDate: Tue Feb 25 00:11:43 2020 +0100

Un-break the XML by adding missing closing tag.

Also get the path right in the CMake .in file.

Change-Id: Ib0f02c5e4a71d04e40b7c353caea872a5ea9cfd6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89386
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index b76d8fe97..29abef905 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -21,7 +21,7 @@ add_library(androidapp SHARED
 ../../../../../wsd/Storage.cpp
 ../../../../../wsd/TileCache.cpp)
 
-target_compile_definitions(androidapp PRIVATE 
LOOLWSD_CONFIGDIR="/etc/loolwsd") # TODO somewhere in assets maybe?
+target_compile_definitions(androidapp PRIVATE 
LOOLWSD_CONFIGDIR="/assets/etc/loolwsd")
 
 # According to the ABI, we need to use different source trees
 if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
diff --git a/loolkitconfig-mobile.xcu b/loolkitconfig-mobile.xcu
index 5f46a712e..15d510fca 100644
--- a/loolkitconfig-mobile.xcu
+++ b/loolkitconfig-mobile.xcu
@@ -25,3 +25,5 @@
 false
 false
 
+
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-24 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |6 
+-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 97aef783550e3e1e299bc5f23e203eac44a98763
Author: Tomaž Vajngerl 
AuthorDate: Mon Feb 24 08:27:15 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Feb 24 23:10:01 2020 +0100

android: log the used language when loading a document

Change-Id: If9255b2c6c63e46ee64823d8c49f6704c2300ef3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89322
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 8fe8636c7..4a7c23151 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -670,7 +670,11 @@ public class LOActivity extends AppCompatActivity {
 urlToLoad + "=1";
 
 // set the language
-finalUrlToLoad += "=" + 
getResources().getConfiguration().locale.toLanguageTag();
+String language = 
getResources().getConfiguration().locale.toLanguageTag();
+
+Log.i(TAG, "Loading with language:  " + language);
+
+finalUrlToLoad += "=" + language;
 
 if (isDocEditable) {
 finalUrlToLoad += "=edit";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/po

2020-02-21 Thread Weblate (via logerrit)
 android/lib/src/main/res/values-fr/strings.xml |2 
 android/lib/src/main/res/values-pt/strings.xml |2 
 android/lib/src/main/res/values-uk/strings.xml |   11 ++
 loleaflet/po/help-fr.po|   10 +-
 loleaflet/po/help-gl.po|  122 -
 loleaflet/po/ui-fr.po  |   18 +--
 loleaflet/po/ui-pt.po  |   16 +--
 loleaflet/po/ui-uk.po  |   10 +-
 8 files changed, 100 insertions(+), 91 deletions(-)

New commits:
commit 24a9d126e3d68ca7375ada93d3256f275fffac8e
Author: Weblate 
AuthorDate: Thu Feb 20 00:15:52 2020 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 21 14:57:04 2020 +0100

update translations

LibreOffice Online/android-lib (French)
Currently translated at 100.0% (8 of 8 strings)

Change-Id: I944044742e6d882422112bf4954488845e1c2df4

update translations

LibreOffice Online/android-lib (Portuguese)
Currently translated at 100.0% (8 of 8 strings)

Change-Id: I8a76b5b2d22dac54805ce12efcd0f716b3745d01

update translations

LibreOffice Online/android-lib (Ukrainian)
Currently translated at 100.0% (8 of 8 strings)

Change-Id: Ib113c3f6f5237c1a13d0ac3a85d1b455bb80469c

update translations

LibreOffice Online/loleaflet-help (Galician)
Currently translated at 100.0% (416 of 416 strings)

Change-Id: I690dd05dde32ba6ed460a2ac0f3c1c265a31357f

update translations

LibreOffice Online/loleaflet-help (French)
Currently translated at 100.0% (416 of 416 strings)

Change-Id: I60b36b3187abb224d45a0c72075bfbbeeafb35ad

update translations

LibreOffice Online/loleaflet-ui (Ukrainian)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I82d185fed1d964ad08b969ec450bd21f40912fdb

update translations

LibreOffice Online/loleaflet-ui (Portuguese)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I28f82bfac6cbe432b344ef51e4be7ee2f127a9bc

update translations

LibreOffice Online/loleaflet-ui (French)
Currently translated at 100.0% (287 of 287 strings)

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

diff --git a/android/lib/src/main/res/values-fr/strings.xml 
b/android/lib/src/main/res/values-fr/strings.xml
index dd5241135..6cd97d491 100644
--- a/android/lib/src/main/res/values-fr/strings.xml
+++ b/android/lib/src/main/res/values-fr/strings.xml
@@ -6,4 +6,6 @@
 Échec à déterminer le ficher à 
charger
 Une permission de stockage est 
requise.
 Ce fichier est en lecture seule, 
l\'enregistrement est désactivé.
+En cours de 
préparation pour le premier démarrage après une mise à jour.
+Enregistrement...
 
\ No newline at end of file
diff --git a/android/lib/src/main/res/values-pt/strings.xml 
b/android/lib/src/main/res/values-pt/strings.xml
index f767d2477..c13cf8aee 100644
--- a/android/lib/src/main/res/values-pt/strings.xml
+++ b/android/lib/src/main/res/values-pt/strings.xml
@@ -6,4 +6,6 @@
 Falha ao determinar o ficheiro a 
carregar
 Requer permissão de acesso ao 
armazenamento
 Este ficheiro é apenas de leitura 
e não pode ser guardado.
+Estamos a 
preparar o arranque após a atualização.
+A guardar...
 
\ No newline at end of file
diff --git a/android/lib/src/main/res/values-uk/strings.xml 
b/android/lib/src/main/res/values-uk/strings.xml
index a6b3daec9..6d8e030ba 100644
--- a/android/lib/src/main/res/values-uk/strings.xml
+++ b/android/lib/src/main/res/values-uk/strings.xml
@@ -1,2 +1,11 @@
 
-
\ No newline at end of file
+
+Підготовка...
+Підготовка до 
першого старту після оновлення.
+Збереження...
+Не можу відкрити оглядач 
файлів
+Помилка вставки зображення
+Помилка визначення файлу для 
завантаження
+Необхідний дозвіл на 
збереження
+Цей файл тільки для читання, 
збереження неможливе.
+
\ No newline at end of file
diff --git a/loleaflet/po/help-fr.po b/loleaflet/po/help-fr.po
index 920c2fcd2..ded900a83 100644
--- a/loleaflet/po/help-fr.po
+++ b/loleaflet/po/help-fr.po
@@ -3,15 +3,15 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-02-12 11:04+0200\n"
-"PO-Revision-Date: 2020-01-24 17:39+\n"
-"Last-Translator: sophie \n"
+"PO-Revision-Date: 2020-02-19 23:15+\n"
+"Last-Translator: Jean-Baptiste Faure \n"
 "Language-Team: French 
\n"
 "Language: fr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 3.9.1\n"
+"X-Generator: Weblate 3.10.3\n"
 "X-Pootle-Path: 

[Libreoffice-commits] online.git: android/lib

2020-02-21 Thread Andras Timar (via logerrit)
 android/lib/build.gradle |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ac4cb440211c0ceec1cfbba21df4b5a05fb59c74
Author: Andras Timar 
AuthorDate: Fri Feb 21 12:07:31 2020 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 21 14:41:48 2020 +0100

android: add share/palette/* (arrowheads, color palettes, etc.)

Change-Id: I535a6e4dfc6dd5f0e47387b3f283abb30e927221
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89195
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 9618f5710..46771f320 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -151,7 +151,7 @@ task copyAssets(type: Copy) {
 into('share') {
 from "${liboInstdir}/share"
 // Filter data is needed by e.g. the drawingML preset shape import.
-includes = ['registry/**', 'filter/**', 'gallery/**']
+includes = ['registry/**', 'filter/**', 'gallery/**', 'palette/**']
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-21 Thread Andras Timar (via logerrit)
 android/lib/build.gradle |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 82e182b04faea8ff963fa727237dc7087bd02b52
Author: Andras Timar 
AuthorDate: Fri Feb 21 12:05:34 2020 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 21 14:01:14 2020 +0100

android: add EmojiOneColor font in the hope of some emoji support

Change-Id: Iab2caa1200ee2d1904eeca15e309b490e6050dc2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89194
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 857d4add6..9618f5710 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -96,6 +96,7 @@ task copyUnpackAssets(type: Copy) {
 // Note: restrict list of fonts due to size considerations - no 
technical reason anymore
 // ToDo: fonts would be good candidate for using Expansion Files 
instead
 includes = [
+"EmojiOne*.ttf",
 "Liberation*.ttf",
 "Caladea-*.ttf",
 "Carlito-*.ttf",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-20 Thread Andras Timar (via logerrit)
 android/lib/build.gradle |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 28633057887770ee16a24d150f9ba8bc6dc82e0c
Author: Andras Timar 
AuthorDate: Thu Feb 20 09:04:16 2020 +0100
Commit: Andras Timar 
CommitDate: Thu Feb 20 09:05:10 2020 +0100

We need also share/gallery for the Android app for inserting some shapes 
defined there

Change-Id: I8fcbc78c17753607351580b97f931f3a2c59a091
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89072
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index e2758100d..857d4add6 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -150,7 +150,7 @@ task copyAssets(type: Copy) {
 into('share') {
 from "${liboInstdir}/share"
 // Filter data is needed by e.g. the drawingML preset shape import.
-includes = ['registry/**', 'filter/**']
+includes = ['registry/**', 'filter/**', 'gallery/**']
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib android/Makefile.am loolkitconfig-mobile.xcu

2020-02-18 Thread Michael Meeks (via logerrit)
 android/Makefile.am  |7 ++-
 android/lib/build.gradle |5 -
 loolkitconfig-mobile.xcu |   27 +++
 3 files changed, 37 insertions(+), 2 deletions(-)

New commits:
commit 373128a5b393ef0d22606ce2e70d6d230e350ab3
Author: Michael Meeks 
AuthorDate: Sat Feb 15 20:27:26 2020 +
Commit: Michael Meeks 
CommitDate: Tue Feb 18 12:08:19 2020 +0100

Install a Kit config that disables complex text options.

These should be re-enabled if your locale looks like it needs them.

Change-Id: I94759349538a7d024797f2b98c35861ccfb71c56
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88767
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/android/Makefile.am b/android/Makefile.am
index ffa317c8a..d717a8b6a 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -4,8 +4,13 @@ clean-local:
 
 all-local: lib/src/main/assets/templates/untitled.odp \
   lib/src/main/assets/templates/untitled.ods \
-  lib/src/main/assets/templates/untitled.odt
+  lib/src/main/assets/templates/untitled.odt \
+  lib/src/main/assets/etc/loolwsd/loolkitconfig.xcu
 
 lib/src/main/assets/templates/untitled.%: templates/untitled.%
@mkdir -p $(dir $@)
@cp -a $< $@
+
+lib/src/main/assets/etc/loolwsd/loolkitconfig.xcu: 
$(top_srcdir)/loolkitconfig-mobile.xcu
+   @mkdir -p $(dir $@)
+   @cp -a $< $@
diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 480c4dcd7..e2758100d 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -87,6 +87,10 @@ task copyUnpackAssets(type: Copy) {
 includes = ['**']
 }
 }
+into('etc/loolwsd') {
+from('/android/loolkitconfig.xcu')
+includes = [ 'loolkitconfig.xcu' ]
+}
 into('user/fonts') {
 from "${liboInstdir}/share/fonts/truetype"
 // Note: restrict list of fonts due to size considerations - no 
technical reason anymore
@@ -198,7 +202,6 @@ OSL_SOCKET_PATH=$APP_DATA_DIR/cache
 LO_LIB_DIR=file://$APP_DATA_DIR/lib/
 BRAND_BASE_DIR=file:///assets
 BRAND_SHARE_SUBDIR=share
-CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry 
res:${BRAND_BASE_DIR}/share/registry 
bundledext:${${BRAND_BASE_DIR}/program/lounorc:BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 
sharedext:${${BRAND_BASE_DIR}/program/lounorc:SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 
userext:${${BRAND_BASE_DIR}/program/lounorc:UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
 BAK_EXTENSIONS=${$ORIGIN/lounorc:TMP_EXTENSIONS}
 BUNDLED_EXTENSIONS=${$ORIGIN/lounorc:BUNDLED_EXTENSIONS}
diff --git a/loolkitconfig-mobile.xcu b/loolkitconfig-mobile.xcu
new file mode 100644
index 0..5f46a712e
--- /dev/null
+++ b/loolkitconfig-mobile.xcu
@@ -0,0 +1,27 @@
+
+http://openoffice.org/2001/registry; 
xmlns:xs="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
+
+
+false
+
+
+false
+
+
+true
+
+
+false
+
+
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-17 Thread Ashod Nakashian (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 972691021f0b356b46bef656af92cac70d507b89
Author: Ashod Nakashian 
AuthorDate: Mon Feb 17 11:47:46 2020 -0500
Commit: Michael Meeks 
CommitDate: Mon Feb 17 19:41:29 2020 +0100

android: DeleteLocalRef on NewStringUTF

Change-Id: I23a4278cc7e0b069a9a53efad404c88527a782f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88871
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 9c084c77b..defe7b628 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -151,6 +151,7 @@ static void send2JS(const JNIThreadContext , jclass 
loActivityClz, jobject
 jstring jstr = env->NewStringUTF(js.c_str());
 jmethodID callFakeWebsocket = env->GetMethodID(loActivityClz, 
"callFakeWebsocketOnMessage", "(Ljava/lang/String;)V");
 env->CallVoidMethod(loActivityObj, callFakeWebsocket, jstr);
+env->DeleteLocalRef(jstr);
 
 if (env->ExceptionCheck())
 env->ExceptionDescribe();
@@ -417,6 +418,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, jobj
 jstring mimeType = tojstringAndFree(env, outMimeTypes[i]);
 // clipboardEntry.mime= mimeType
 env->SetObjectField(clipboardEntry, 
fieldId_LokClipboardEntry_Mime, mimeType);
+env->DeleteLocalRef(mimeType);
 
 size_t aByteArraySize = outSizes[i];
 jbyteArray aByteArray = env->NewByteArray(aByteArraySize);
@@ -454,6 +456,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, jobj
 jstring mimeType = tojstringAndFree(env, outMimeTypes[i]);
 // clipboardEntry.mime= mimeType
 env->SetObjectField(clipboardEntry, 
fieldId_LokClipboardEntry_Mime, mimeType);
+env->DeleteLocalRef(mimeType);
 
 size_t aByteArraySize = outSizes[i];
 jbyteArray aByteArray = env->NewByteArray(aByteArraySize);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib ios/Mobile ios/Mobile.xcodeproj kit/ForKit.cpp kit/Kit.cpp kit/Kit.hpp test/Makefile.am

2020-02-17 Thread Michael Meeks (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |2 
 ios/Mobile.xcodeproj/project.pbxproj|  158 +++-
 ios/Mobile/AppDelegate.mm   |3 
 kit/ForKit.cpp  |   27 -
 kit/Kit.cpp |   40 
 kit/Kit.hpp |3 
 test/Makefile.am|6 +
 7 files changed, 206 insertions(+), 33 deletions(-)

New commits:
commit 6bdf561049cf4b25326c74128e5be29d9cf10e13
Author: Michael Meeks 
AuthorDate: Sat Feb 15 19:32:57 2020 +
Commit: Michael Meeks 
CommitDate: Mon Feb 17 14:49:06 2020 +0100

Share the Kit environment setup code.

Particularly configuration layers so we can tweak mobile config
easily.

Add core source files from configmgr for breakpointing convenience in
the iOS project. Add loolkitconfig.xcu to the iOS app bundle. Use
${BRAND_BASE_DIR} instead of a compile-time LOOLWSD_CONFIGDIR literal
on iOS (because there is no compile-time constant path to the app
bundle). No "registry" directory directly in the app bundle any longer
on iOS, a corresponding change in core.git moved that stuff to be
under "share", like on other platforms.

Change-Id: I6672efc0505abf27297c4758118a20992b10ceb3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88765
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 10f4876ad..9c084c77b 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -45,7 +45,7 @@ JNI_OnLoad(JavaVM* vm, void*) {
 return JNI_ERR; // JNI version not supported.
 }
 
-setenv("SAL_LOK_OPTIONS", "unipoll", 0);
+setupKitEnvironment();
 
 // Uncomment the following to see the logs from the core too
 //setenv("SAL_LOG", "+WARN+INFO", 0);
diff --git a/ios/Mobile.xcodeproj/project.pbxproj 
b/ios/Mobile.xcodeproj/project.pbxproj
index 243ef142c..9fab320d2 100644
--- a/ios/Mobile.xcodeproj/project.pbxproj
+++ b/ios/Mobile.xcodeproj/project.pbxproj
@@ -31,6 +31,7 @@
BE5EB5DA2140363100E0826C /* ios.mm in Sources */ = {isa = 
PBXBuildFile; fileRef = BE5EB5D92140363100E0826C /* ios.mm */; };
BE5EB5DC2140480B00E0826C /* ICU.dat in Resources */ = {isa = 
PBXBuildFile; fileRef = BE5EB5DB2140480B00E0826C /* ICU.dat */; };
BE6362C22153B5B500F4237E /* MobileCoreServices.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = BE6362C12153B5B500F4237E /* 
MobileCoreServices.framework */; };
+   BE7D6A6B23FAA8B500C2E605 /* loolkitconfig.xcu in Resources */ = 
{isa = PBXBuildFile; fileRef = BE7D6A6A23FAA8B500C2E605 /* loolkitconfig.xcu 
*/; };
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 */; };
@@ -46,7 +47,6 @@
BE8D85CA214055F3009F1860 /* offapi.rdb in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85BC214055F2009F1860 /* offapi.rdb */; };
BE8D85CB214055F3009F1860 /* share in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85BD214055F2009F1860 /* share */; };
BE8D85CC214055F3009F1860 /* config in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85BE214055F2009F1860 /* config */; };
-   BE8D85CD214055F3009F1860 /* registry in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85BF214055F2009F1860 /* registry */; };
BE8D85CE214055F3009F1860 /* oovbaapi.rdb in Resources */ = {isa 
= PBXBuildFile; fileRef = BE8D85C0214055F2009F1860 /* oovbaapi.rdb */; };
BE8D85CF214055F3009F1860 /* udkapi.rdb in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85C1214055F2009F1860 /* udkapi.rdb */; };
BE8D85D0214055F3009F1860 /* services in Resources */ = {isa = 
PBXBuildFile; fileRef = BE8D85C2214055F2009F1860 /* services */; };
@@ -527,6 +527,78 @@
BE5EB5DB2140480B00E0826C /* ICU.dat */ = {isa = 
PBXFileReference; lastKnownFileType = file; name = ICU.dat; path = 
../../../ICU.dat; sourceTree = ""; };
BE636210215101D000F4237E /* WebSocketHandler.hpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path 
= WebSocketHandler.hpp; sourceTree = ""; };
BE6362C12153B5B500F4237E /* MobileCoreServices.framework */ = 
{isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = 
MobileCoreServices.framework; path = 

[Libreoffice-commits] online.git: android/lib

2020-02-14 Thread mert (via logerrit)
 android/lib/build.gradle |2 
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   32 
--
 android/lib/src/main/res/layout/lolib_activity_main.xml  |   19 
+
 android/lib/src/main/res/values/strings.xml  |1 
 4 files changed, 50 insertions(+), 4 deletions(-)

New commits:
commit 1f04f155324989429eed3478825dbebd67fc3f75
Author: mert 
AuthorDate: Wed Feb 12 19:39:50 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Fri Feb 14 18:19:14 2020 +0100

android: show progressbar at first start of the document

Copying the assets takes some time at first install
so showing progressbar is a good idea for user to wait

Edit: ConstraintLayout implementation added in build.gradle

Change-Id: Ia38259cb3ae1b25983a4067fce500f2700c2c79f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88548
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index ea92be07f..480c4dcd7 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -63,6 +63,8 @@ dependencies {
 
 implementation 'androidx.appcompat:appcompat:1.0.2'
 implementation 'com.google.android.material:material:1.1.0-alpha04'
+implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
+
 }
 
 task copyUnpackAssets(type: Copy) {
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 7033707e5..9af5eb267 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager;
 import android.content.res.AssetFileDescriptor;
 import android.content.res.AssetManager;
 import android.net.Uri;
+import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Environment;
@@ -42,6 +43,7 @@ import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.ProgressBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -110,6 +112,7 @@ public class LOActivity extends AppCompatActivity {
 private Thread nativeMsgThread;
 private Handler nativeHandler;
 private Looper nativeLooper;
+private Bundle savedInstanceState;
 
 /** In case the mobile-wizard is visible, we have to intercept the 
Android's Back button. */
 private boolean mMobileWizardVisible = false;
@@ -142,7 +145,6 @@ public class LOActivity extends AppCompatActivity {
   String fromAssetPath, String 
targetDir) {
 try {
 String[] files = assetManager.list(fromAssetPath);
-
 boolean res = true;
 for (String file : files) {
 String[] dirOrFile = assetManager.list(fromAssetPath + "/" + 
file);
@@ -255,12 +257,33 @@ public class LOActivity extends AppCompatActivity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
+this.savedInstanceState = savedInstanceState;
 getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
 sPrefs = 
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-updatePreferences();
-
 setContentView(R.layout.lolib_activity_main);
+init();
+}
+
+private void init() {
+new AsyncTask() {
+@Override
+protected Void doInBackground(Void... voids) {
+updatePreferences();
+return null;
+}
 
+@Override
+protected void onPostExecute(Void aVoid) {
+initUI();
+}
+}.execute();
+}
+
+private void initUI() {
+TextView assetsTextView = findViewById(R.id.assetsTextView);
+ProgressBar assetsProgressbar = findViewById(R.id.assetsProgressbar);
+assetsProgressbar.setVisibility(View.GONE);
+assetsTextView.setVisibility(View.GONE);
 isDocDebuggable = sPrefs.getBoolean(KEY_ENABLE_SHOW_DEBUG_INFO, false) 
&& BuildConfig.DEBUG;
 
 if (getIntent().getData() != null) {
@@ -482,7 +505,8 @@ public class LOActivity extends AppCompatActivity {
 Log.i(TAG, "onResume..");
 
 // check for config change
-updatePreferences();
+if (documentLoaded)
+updatePreferences();
 }
 
 @Override
diff --git a/android/lib/src/main/res/layout/lolib_activity_main.xml 
b/android/lib/src/main/res/layout/lolib_activity_main.xml
index 2810a9af9..9d9524dc5 100644
--- a/android/lib/src/main/res/layout/lolib_activity_main.xml
+++ 

[Libreoffice-commits] online.git: android/lib loleaflet/src

2020-02-14 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |6 
++
 loleaflet/src/control/Control.AlertDialog.js |6 
+-
 loleaflet/src/control/Control.Infobar.js |6 
+-
 loleaflet/src/control/Control.Menubar.js |7 
++-
 loleaflet/src/control/Toolbar.js |2 +-
 loleaflet/src/core/Socket.js |4 
++--
 6 files changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 2174206de1a8f5a87efef934b208c8b95db03447
Author: Jan Holesovsky 
AuthorDate: Fri Feb 14 15:22:46 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Fri Feb 14 15:43:58 2020 +0100

android: Don't hang after returning from a hyperlink.

It seems that it is actually the webview that gets into a weird state
after returning from the url.  Unfortunately intercepting the calls via
shouldOverrideUrlLoading() in a WebViewClient does not help, so the only
way seems to be to make sure we actually don't have any clickable URL
anywhere, and for the rest, we issue a 'HYPERLINK' postMobileMessage...

Change-Id: I62dc2cfbe867e97aec7fac5f83c4399814ef2ce4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88720
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 424e0cd09..7033707e5 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -785,6 +785,12 @@ public class LOActivity extends AppCompatActivity {
 }
 return false;
 }
+case "HYPERLINK": {
+Intent intent = new Intent(Intent.ACTION_VIEW);
+intent.setData(Uri.parse(messageAndParam[1]));
+startActivity(intent);
+return false;
+}
 }
 return true;
 }
diff --git a/loleaflet/src/control/Control.AlertDialog.js 
b/loleaflet/src/control/Control.AlertDialog.js
index c73d87d92..20404dcb5 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -62,7 +62,11 @@ L.Control.AlertDialog = L.Control.extend({
type: 'button',
className: 'vex-dialog-button-primary',
click: function openClick () {
-   window.open(url, '_blank');
+   if (window.ThisIsAMobileApp) {
+   
window.postMobileMessage('HYPERLINK ' + url);
+   } else {
+   window.open(url, 
'_blank');
+   }
vex.closeAll();
}
});
diff --git a/loleaflet/src/control/Control.Infobar.js 
b/loleaflet/src/control/Control.Infobar.js
index b00d0cdb2..48b92c8a1 100644
--- a/loleaflet/src/control/Control.Infobar.js
+++ b/loleaflet/src/control/Control.Infobar.js
@@ -22,7 +22,11 @@ L.Control.Infobar = L.Control.extend({
return;
 
if (e.action.startsWith('http')) { // We have a 
link
-   var win = window.open(e.action, 
'_blank');
+   if (window.ThisIsAMobileApp) {
+   
window.postMobileMessage('HYPERLINK ' + e.action);
+   } else {
+   var win = window.open(e.action, 
'_blank');
+   }
win.focus();
}
};
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 1a5cdc19d..6ea82050f 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1155,7 +1155,12 @@ L.Control.Menubar = L.Control.extend({
} else if (id === 'about') {
this._map.showLOAboutDialog();
} else if (id === 'report-an-issue') {
-   
window.open('https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice%20Online',
 '_blank');
+   var bugLink = 
'https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice%20Online';
+   if (window.ThisIsAMobileApp) {
+

[Libreoffice-commits] online.git: android/lib

2020-02-14 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   45 
+-
 1 file changed, 43 insertions(+), 2 deletions(-)

New commits:
commit 7c90a32b51c070e79488d5c5e4536a936a35b420
Author: Jan Holesovsky 
AuthorDate: Thu Feb 13 21:21:23 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Fri Feb 14 11:03:28 2020 +0100

android: Copy data back if the content: URI allows that.

So that saving back to the apps that called us works (if the app gave us
the permission to do so, that is).

Change-Id: Idaf47f1d1cf9ea3fef57ac885fc6b91bc4f84be4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88632
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 90021f1c6..424e0cd09 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -266,8 +266,10 @@ public class LOActivity extends AppCompatActivity {
 if (getIntent().getData() != null) {
 
 if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
-isDocEditable = false;
-Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
+isDocEditable = (getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0;
+if (!isDocEditable)
+Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
+
 if (copyFileToTemp() && mTempFile != null) {
 documentUri = mTempFile.toURI();
 urlToLoad = documentUri.toString();
@@ -397,6 +399,7 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
+/** When we get the file via a content: URI, we need to put it to a temp 
file. */
 private boolean copyFileToTemp() {
 ContentResolver contentResolver = getContentResolver();
 FileChannel inputChannel = null;
@@ -437,6 +440,42 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
+/** Check that we have created a temp file, and if yes, copy it back to 
the content: URI. */
+private void copyTempBackToIntent() {
+if (!isDocEditable || mTempFile == null || getIntent().getData() == 
null || 
!getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT))
+return;
+
+ContentResolver contentResolver = getContentResolver();
+FileChannel inputChannel = null;
+FileChannel outputChannel = null;
+
+try {
+try {
+AssetFileDescriptor assetFD = 
contentResolver.openAssetFileDescriptor(getIntent().getData(), "w");
+if (assetFD == null) {
+Log.e(TAG, "couldn't create assetfiledescriptor from " + 
getIntent().getDataString());
+return;
+}
+outputChannel = assetFD.createOutputStream().getChannel();
+inputChannel = new FileInputStream(mTempFile).getChannel();
+
+long bytesTransferred = 0;
+// might not  copy all at once, so make sure everything gets 
copied
+while (bytesTransferred < inputChannel.size()) {
+bytesTransferred += 
outputChannel.transferFrom(inputChannel, bytesTransferred, inputChannel.size());
+}
+Log.e(TAG, "Success copying " + bytesTransferred + " bytes");
+} finally {
+if (inputChannel != null) inputChannel.close();
+if (outputChannel != null) outputChannel.close();
+}
+} catch (FileNotFoundException e) {
+Log.e(TAG, "file not found: " + e.getMessage());
+} catch (Exception e) {
+Log.e(TAG, "exception: " + e.getMessage());
+}
+}
+
 @Override
 protected void onResume() {
 super.onResume();
@@ -560,6 +599,7 @@ public class LOActivity extends AppCompatActivity {
 @Override
 public void run() {
 postMobileMessageNative("BYE");
+copyTempBackToIntent();
 
 runOnUiThread(new Runnable() {
 @Override
@@ -702,6 +742,7 @@ public class LOActivity extends AppCompatActivity {
 initiateSlideShow();
 return false;
 case "SAVE":
+copyTempBackToIntent();
 sendBroadcast(messageAndParam[0], messageAndParam[1]);
 return false;
 case "downloadas":
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] online.git: android/lib

2020-02-12 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |6 
++
 1 file changed, 6 insertions(+)

New commits:
commit 9497681bd98d5cfc70a914e8e79e00a527813cdd
Author: Jan Holesovsky 
AuthorDate: Wed Feb 12 21:49:17 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Feb 12 21:52:55 2020 +0100

android: Avoid a WebView-related error in the log.

Namely "WebView.destroy() called while WebView is still attached to window".

Change-Id: I6963a553ac05af6426ffe3c054bdcff28a725e3b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88571
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index a964ad392..90021f1c6 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -35,6 +35,7 @@ import android.provider.DocumentsContract;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.webkit.JavascriptInterface;
 import android.webkit.ValueCallback;
@@ -460,6 +461,11 @@ public class LOActivity extends AppCompatActivity {
 super.onDestroy();
 Log.i(TAG, "onDestroy() - we know we are leaving the document");
 nativeLooper.quit();
+
+// Remove the webview from the hierarchy & destroy
+final ViewGroup viewGroup = (ViewGroup) mWebView.getParent();
+if (viewGroup != null)
+viewGroup.removeView(mWebView);
 mWebView.destroy();
 
 // Most probably the native part has already got a 'BYE' from
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/po

2020-02-12 Thread Weblate (via logerrit)
 android/lib/src/main/res/values-cy/strings.xml |1 
 android/lib/src/main/res/values-eo/strings.xml |1 
 android/lib/src/main/res/values-es/strings.xml |1 
 android/lib/src/main/res/values-pt-rBR/strings.xml |5 +-
 loleaflet/po/ui-ast.po |4 -
 loleaflet/po/ui-bg.po  |   14 ++
 loleaflet/po/ui-ca.po  |   14 ++
 loleaflet/po/ui-cy.po  |   14 ++
 loleaflet/po/ui-de.po  |   43 +
 loleaflet/po/ui-dsb.po |   16 +++
 loleaflet/po/ui-en_GB.po   |   14 ++
 loleaflet/po/ui-es.po  |   18 +++-
 loleaflet/po/ui-eu.po  |   14 ++
 loleaflet/po/ui-hsb.po |   14 ++
 loleaflet/po/ui-hu.po  |   14 ++
 loleaflet/po/ui-pt_BR.po   |   20 -
 16 files changed, 94 insertions(+), 113 deletions(-)

New commits:
commit 32d55a6ca83801bea29b7de9b28adf54f3957a73
Author: Weblate 
AuthorDate: Wed Feb 12 15:09:46 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Feb 12 15:15:22 2020 +0100

update translations

LibreOffice Online/loleaflet-ui (English (United Kingdom))
Currently translated at 100.0% (287 of 287 strings)

Change-Id: If872e0bae5b538c042a6246e139ff92b51771cfb

update translations

LibreOffice Online/loleaflet-ui (Upper Sorbian)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I1ad3b4226f4cb9ce113a4a11e496d8b1a70c6363

update translations

LibreOffice Online/loleaflet-ui (Lower Sorbian)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: Ia519636dd33ff504fec3b78145c6b42b8e673e00

update translations

LibreOffice Online/android-lib (Welsh)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: Ie9e72c41ffa386255ba35edfa5ecfed9b6cc6c3a

update translations

LibreOffice Online/android-lib (Esperanto)
Currently translated at 28.6% (2 of 7 strings)

Change-Id: I65360f5fc7f6425aab93dcdf7628b5317eea3f4a

update translations

LibreOffice Online/android-lib (Portuguese (Brazil))
Currently translated at 100.0% (7 of 7 strings)

Change-Id: If87ad3131762c217cc0a51988305d22029c3a2fd

update translations

LibreOffice Online/android-lib (Spanish)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: I16079ade29da13c8194f47c0bde7e7620cf9b133

update translations

LibreOffice Online/loleaflet-ui (Portuguese (Brazil))
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I3afb970ab5e682b9a5cedf90170506ece4f3ef1d

update translations

LibreOffice Online/loleaflet-ui (Basque)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I899178b428f813f64660a03d3767afec4930598d

update translations

LibreOffice Online/loleaflet-ui (Spanish)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: Iba756ea0887e0ae01ef38049e41bfa12ddff08be

update translations

LibreOffice Online/loleaflet-ui (Spanish)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I21686dc43e08dfdb9a0b45dfe30577ad749c37c4

update translations

LibreOffice Online/loleaflet-ui (German)
Currently translated at 91.6% (263 of 287 strings)

Change-Id: Ibd68c1320bb9a746800a50f4744eea79c89891d1

update translations

LibreOffice Online/loleaflet-ui (Welsh)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: I14dfa3a452d0c4d3e8f9406f02841fe1a505c921

update translations

LibreOffice Online/loleaflet-ui (Catalan)
Currently translated at 98.3% (282 of 287 strings)

Change-Id: Ib4de84246aa0fe8c9ceb6e2386910c58e4364eba

update translations

LibreOffice Online/loleaflet-ui (Bulgarian)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: Ib7ad2706e29d04ed0a8d50e4ba43d3dc78b86585

update translations

LibreOffice Online/loleaflet-ui (Asturian)
Currently translated at 34.8% (100 of 287 strings)

Change-Id: I8d2ebfc31d2ac706ff64602d984bd438b3cec39d

update translations

LibreOffice Online/loleaflet-ui (Hungarian)
Currently translated at 100.0% (287 of 287 strings)

Change-Id: Ieb0d3d4adf1abb2e2bd20b9ddc6f203657d7d3cb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88518
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/android/lib/src/main/res/values-cy/strings.xml 
b/android/lib/src/main/res/values-cy/strings.xml
index aea767027..883766563 100644
--- 

[Libreoffice-commits] online.git: android/lib loleaflet/po

2020-02-12 Thread Weblate (via logerrit)
 android/lib/src/main/res/values-bg/strings.xml  |1 
 android/lib/src/main/res/values-dsb/strings.xml |1 
 android/lib/src/main/res/values-eu/strings.xml  |1 
 android/lib/src/main/res/values-hsb/strings.xml |1 
 loleaflet/po/help-ca.po |   14 ++--
 loleaflet/po/help-gl.po |   84 
 6 files changed, 53 insertions(+), 49 deletions(-)

New commits:
commit fefc477f3b0c9fe9b5c614d590236ae9db6dbe78
Author: Weblate 
AuthorDate: Wed Feb 12 11:19:00 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Feb 12 11:21:00 2020 +0100

update translations

LibreOffice Online/android-lib (Bulgarian)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: I00530286bf66db4b7907b6f6bf08693622a6d7fd

update translations

LibreOffice Online/android-lib (Lower Sorbian)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: I57645233bd8763b1fb53b4d038a1d9cd433b52d5

update translations

LibreOffice Online/android-lib (Basque)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: Idbb54d4b1759c459a69ef84a9a264e366e697520

update translations

LibreOffice Online/android-lib (Upper Sorbian)
Currently translated at 100.0% (7 of 7 strings)

Change-Id: Ie9b822558edbec57ef62f8886910f129e1fe0f65

update translations

LibreOffice Online/loleaflet-help (Galician)
Currently translated at 71.9% (299 of 416 strings)

Change-Id: I2a807adbc4dcff0aead5014e7e4aec0f98ba3a49

update translations

LibreOffice Online/loleaflet-help (Galician)
Currently translated at 68.5% (285 of 416 strings)

Change-Id: I79ac0f5567550ec4d249ccaa4a28e679d64e

update translations

LibreOffice Online/loleaflet-help (Galician)
Currently translated at 66.6% (277 of 416 strings)

Change-Id: Ia9515c1195813b68f834fa72f3c02c9849ba3f1e

update translations

LibreOffice Online/loleaflet-help (Catalan)
Currently translated at 69.7% (290 of 416 strings)

Change-Id: I3ca0aeeb7bf3c55133df1f8836cce51038289a10
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88436
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/android/lib/src/main/res/values-bg/strings.xml 
b/android/lib/src/main/res/values-bg/strings.xml
index 42a2cd1b0..d081bf624 100644
--- a/android/lib/src/main/res/values-bg/strings.xml
+++ b/android/lib/src/main/res/values-bg/strings.xml
@@ -6,4 +6,5 @@
 Неуспешно определяне на файла за 
зареждане
 Изисква се разрешение за 
съхранение
 Този файл е само за четене, 
записването е изключено.
+Записване...
 
\ No newline at end of file
diff --git a/android/lib/src/main/res/values-dsb/strings.xml 
b/android/lib/src/main/res/values-dsb/strings.xml
index a5d8e1b60..675222b26 100644
--- a/android/lib/src/main/res/values-dsb/strings.xml
+++ b/android/lib/src/main/res/values-dsb/strings.xml
@@ -6,4 +6,5 @@
 Njejo se raźiło, dataju zwěsćiś, 
kótaraž ma se zacytaś.
 Pšawo za składowanje jo 
trěbne.
 Toś ta dataja dajo se janož 
cytaś, składowanje jo znjemóžnjone.
+Składujo se...
 
\ No newline at end of file
diff --git a/android/lib/src/main/res/values-eu/strings.xml 
b/android/lib/src/main/res/values-eu/strings.xml
index f489aadeb..af6925c6d 100644
--- a/android/lib/src/main/res/values-eu/strings.xml
+++ b/android/lib/src/main/res/values-eu/strings.xml
@@ -6,4 +6,5 @@
 Huts egin du kargatu behar den 
fitxategia zehazteak
 Biltegiratze-baimena behar 
da
 Fitxategia irakurtzeko soilik da, 
gordetzea desgaituta dago.
+Gordetzen...
 
\ No newline at end of file
diff --git a/android/lib/src/main/res/values-hsb/strings.xml 
b/android/lib/src/main/res/values-hsb/strings.xml
index 865ff1e77..fae5dccb1 100644
--- a/android/lib/src/main/res/values-hsb/strings.xml
+++ b/android/lib/src/main/res/values-hsb/strings.xml
@@ -6,4 +6,5 @@
 Njeje so poradźiło, dataju zwěsćić, 
kotraž ma so začitać.
 Prawo za składowanje je 
trěbne.
 Tuta dataja da so jenož čitać, 
składowanje je znjemóžnjene.
+Składuje so...
 
\ No newline at end of file
diff --git a/loleaflet/po/help-ca.po b/loleaflet/po/help-ca.po
index 8b628fd6f..03321a92c 100644
--- a/loleaflet/po/help-ca.po
+++ b/loleaflet/po/help-ca.po
@@ -3,7 +3,7 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2019-12-15 17:50+0200\n"
-"PO-Revision-Date: 2020-02-10 11:01+\n"
+"PO-Revision-Date: 2020-02-11 10:13+\n"
 "Last-Translator: Adolfo Jayme Barrientos \n"
 "Language-Team: Catalan 
\n"
 "Language: ca\n"
@@ -1752,7 +1752,7 @@ msgstr ""
 
 #: html/loleaflet-help.html%2Bdiv.div.h4:548-5
 msgid "How can I copy the formatting of existing cells to new ones?"
-msgstr ""
+msgstr "Com pot copiar la 

[Libreoffice-commits] online.git: android/lib

2020-02-11 Thread mert (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   49 
--
 android/lib/src/main/res/layout/lolib_dialog_loading.xml |3 
 android/lib/src/main/res/values/strings.xml  |1 
 3 files changed, 46 insertions(+), 7 deletions(-)

New commits:
commit 475c7cd42e37efab6c8e48e03efc32a3cf315171
Author: mert 
AuthorDate: Thu Feb 6 16:27:01 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Tue Feb 11 23:29:27 2020 +0100

android: Notify the user about saving the document on close

Change-Id: Ie96bd1918d2d166df096bec5e2c6489f819b6f13
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88102
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index e3e479a4c..a964ad392 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -33,12 +33,15 @@ import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
 import android.provider.DocumentsContract;
 import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
 import android.view.WindowManager;
 import android.webkit.JavascriptInterface;
 import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.TextView;
 import android.widget.Toast;
 
 import java.io.File;
@@ -458,6 +461,10 @@ public class LOActivity extends AppCompatActivity {
 Log.i(TAG, "onDestroy() - we know we are leaving the document");
 nativeLooper.quit();
 mWebView.destroy();
+
+// Most probably the native part has already got a 'BYE' from
+// finishWithProgress(), but it is actually better to send it twice
+// than never, so let's call it from here too anyway
 postMobileMessageNative("BYE");
 }
 
@@ -528,6 +535,38 @@ public class LOActivity extends AppCompatActivity {
 return null;
 }
 
+/** Show the Saving progress and finish the app. */
+private void finishWithProgress() {
+LayoutInflater inflater = this.getLayoutInflater();
+View loadingView = inflater.inflate(R.layout.lolib_dialog_loading, 
null);
+TextView loadingText = 
loadingView.findViewById(R.id.lolib_loading_dialog_text);
+loadingText.setText(getText(R.string.saving));
+final AlertDialog savingProgress = new 
AlertDialog.Builder(LOActivity.this)
+.setView(loadingView)
+.setCancelable(true)
+.create();
+
+savingProgress.show();
+
+// The 'BYE' takes a considerable amount of time, we need to post it
+// so that it starts after the saving progress is actually shown
+mainHandler.post(new Runnable() {
+@Override
+public void run() {
+postMobileMessageNative("BYE");
+
+runOnUiThread(new Runnable() {
+@Override
+public void run() {
+savingProgress.dismiss();
+}
+});
+
+finish();
+}
+});
+}
+
 @Override
 public void onBackPressed() {
 if (mMobileWizardVisible)
@@ -537,8 +576,7 @@ public class LOActivity extends AppCompatActivity {
 return;
 }
 
-postMobileMessageNative("BYE");
-super.onBackPressed();
+finishWithProgress();
 }
 
 private void loadDocument() {
@@ -600,10 +638,6 @@ public class LOActivity extends AppCompatActivity {
 postMobileMessageNative(message);
 afterMessageFromWebView(messageAndParameterArray);
 }
-
-// Going back to document browser on BYE (called when pressing the top 
left exit button)
-if (message.equals("BYE"))
-finish();
 }
 
 /**
@@ -647,6 +681,9 @@ public class LOActivity extends AppCompatActivity {
  */
 private boolean beforeMessageFromWebView(String[] messageAndParam) {
 switch (messageAndParam[0]) {
+case "BYE":
+finishWithProgress();
+return false;
 case "PRINT":
 mainHandler.post(new Runnable() {
 @Override
diff --git a/android/lib/src/main/res/layout/lolib_dialog_loading.xml 
b/android/lib/src/main/res/layout/lolib_dialog_loading.xml
index f4dc98443..db4825bb7 100644
--- a/android/lib/src/main/res/layout/lolib_dialog_loading.xml
+++ b/android/lib/src/main/res/layout/lolib_dialog_loading.xml
@@ -10,9 +10,10 @@
 android:layout_weight="1" />
 
 
-
\ No newline at end of file
+
diff --git a/android/lib/src/main/res/values/strings.xml 
b/android/lib/src/main/res/values/strings.xml
index 

[Libreoffice-commits] online.git: android/lib

2020-02-11 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7a83e165e369337485cf3fcc21c49ae7bf2e6a8f
Author: Jan Holesovsky 
AuthorDate: Tue Feb 11 22:07:14 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Feb 11 23:25:11 2020 +0100

android: Cleanup properly before returning from the activity.

Without this, it was possible to return to the previous activity without
a proper cleanup which lead to a crash later when restarting the
activity too quickly.

Change-Id: I1003a8eb0ef271d3499b07ff9f111839f48fefac
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88478
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 068fae605..e3e479a4c 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -537,6 +537,7 @@ public class LOActivity extends AppCompatActivity {
 return;
 }
 
+postMobileMessageNative("BYE");
 super.onBackPressed();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-11 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |7 
+++
 1 file changed, 7 insertions(+)

New commits:
commit 78d8906153be45bbe901138ffd1447688029483f
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 11 17:53:35 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Tue Feb 11 18:55:23 2020 +0100

android: process activity result only when result is OK

This happens when the used hits the back button when asked for
the "save as" file location. Request is still sent but the result
code is not OK, and the intent is null.

Change-Id: Id3c483dc0e1e0114ff8a933072892b1f8b7c29f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88469
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 84276db97..068fae605 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -463,6 +463,10 @@ public class LOActivity extends AppCompatActivity {
 
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent 
intent) {
+if (resultCode != RESULT_OK) {
+return;
+}
+
 switch (requestCode) {
 case REQUEST_SELECT_IMAGE_FILE:
 if (valueCallback == null)
@@ -481,6 +485,9 @@ public class LOActivity extends AppCompatActivity {
 case REQUEST_SAVEAS_DOC:
 case REQUEST_SAVEAS_PPT:
 case REQUEST_SAVEAS_XLS:
+if (intent == null) {
+return;
+}
 String format = getFormatForRequestCode(requestCode);
 if (format != null) {
 final File tempFile = new 
File(LOActivity.this.getCacheDir(), "temp.file");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-11 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |  144 
+-
 1 file changed, 136 insertions(+), 8 deletions(-)

New commits:
commit 65de5cc7287cc684abe5dea844371d0897cd7bd2
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 11 15:39:03 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Feb 11 17:48:29 2020 +0100

android: Implement export document on Android

Uses ACTION_CREATE_DOCUMENT activity for the file selection
dialog. Then calls saveAs to a temp file and copies the content
to the outpuStream for the result URI (necessary because URI may
not be a file).

Change-Id: I6df7db5583e546a53c7cfb8c7ea16281ab861926
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88454
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index acbd9cdf5..84276db97 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -24,12 +24,14 @@ import android.content.res.AssetManager;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Environment;
 import android.os.Handler;
 import android.os.Looper;
 import android.preference.PreferenceManager;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
+import android.provider.DocumentsContract;
 import android.util.Log;
 import android.view.WindowManager;
 import android.webkit.JavascriptInterface;
@@ -53,6 +55,8 @@ import java.nio.channels.Channels;
 import java.nio.channels.FileChannel;
 import java.nio.channels.ReadableByteChannel;
 import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
@@ -107,7 +111,19 @@ public class LOActivity extends AppCompatActivity {
 private boolean mMobileWizardVisible = false;
 
 private ValueCallback valueCallback;
-public static final int REQUEST_SELECT_FILE = 555;
+
+public static final int REQUEST_SELECT_IMAGE_FILE = 500;
+public static final int REQUEST_SAVEAS_PDF = 501;
+public static final int REQUEST_SAVEAS_RTF = 502;
+public static final int REQUEST_SAVEAS_ODT = 503;
+public static final int REQUEST_SAVEAS_ODP = 504;
+public static final int REQUEST_SAVEAS_ODS = 505;
+public static final int REQUEST_SAVEAS_DOCX = 506;
+public static final int REQUEST_SAVEAS_PPTX = 507;
+public static final int REQUEST_SAVEAS_XLSX = 508;
+public static final int REQUEST_SAVEAS_DOC = 509;
+public static final int REQUEST_SAVEAS_PPT = 510;
+public static final int REQUEST_SAVEAS_XLS = 511;
 
 /** Broadcasting event for passing info back to the shell. */
 public static final String LO_ACTIVITY_BROADCAST = "LOActivityBroadcast";
@@ -328,7 +344,7 @@ public class LOActivity extends AppCompatActivity {
 
 try {
 intent.setType("image/*");
-startActivityForResult(intent, REQUEST_SELECT_FILE);
+startActivityForResult(intent, REQUEST_SELECT_IMAGE_FILE);
 } catch (ActivityNotFoundException e) {
 valueCallback = null;
 Toast.makeText(LOActivity.this, 
getString(R.string.cannot_open_file_chooser), Toast.LENGTH_LONG).show();
@@ -447,14 +463,62 @@ public class LOActivity extends AppCompatActivity {
 
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent 
intent) {
-if (requestCode == REQUEST_SELECT_FILE) {
-if (valueCallback == null)
+switch (requestCode) {
+case REQUEST_SELECT_IMAGE_FILE:
+if (valueCallback == null)
+return;
+
valueCallback.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode,
 intent));
+valueCallback = null;
 return;
-
valueCallback.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode,
 intent));
-valueCallback = null;
-} else {
-Toast.makeText(this, getString(R.string.failed_to_insert_image), 
Toast.LENGTH_LONG).show();
+case REQUEST_SAVEAS_PDF:
+case REQUEST_SAVEAS_RTF:
+case REQUEST_SAVEAS_ODT:
+case REQUEST_SAVEAS_ODP:
+case REQUEST_SAVEAS_ODS:
+case REQUEST_SAVEAS_DOCX:
+case REQUEST_SAVEAS_PPTX:
+case REQUEST_SAVEAS_XLSX:
+case REQUEST_SAVEAS_DOC:
+case REQUEST_SAVEAS_PPT:
+case REQUEST_SAVEAS_XLS:
+String format = getFormatForRequestCode(requestCode);
+if (format != null) {
+final File 

[Libreoffice-commits] online.git: android/lib

2020-02-07 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit c4b068072adaec354a99c51153f583d7747d38ee
Author: Jan Holesovsky 
AuthorDate: Fri Feb 7 16:06:26 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Feb 7 22:45:21 2020 +0100

android hunspell: Actually we need the dicts in unpack/.

Otherwise hunspell cannot read them - it needs real files.

Change-Id: Ic90e4e3155dc2eee895527c6a04bb694312f99e4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88226
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 776d8af38..ea92be07f 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -120,8 +120,9 @@ task copyUnpackAssets(type: Copy) {
 }
 into('share') {
 from "${liboInstdir}/share"
+// extensions - for the dictionaries for hunspell
 // liblangtag data is needed for locales like en-CH
-includes = ['liblangtag/**']
+includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 
'extensions/dict-es/**', 'extensions/dict-pt-BR/**', 'liblangtag/**']
 }
 }
 
@@ -195,7 +196,7 @@ OSL_SOCKET_PATH=$APP_DATA_DIR/cache
 LO_LIB_DIR=file://$APP_DATA_DIR/lib/
 BRAND_BASE_DIR=file:///assets
 BRAND_SHARE_SUBDIR=share
-CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry 
res:${BRAND_BASE_DIR}/share/registry
+CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry 
res:${BRAND_BASE_DIR}/share/registry 
bundledext:${${BRAND_BASE_DIR}/program/lounorc:BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 
sharedext:${${BRAND_BASE_DIR}/program/lounorc:SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 
userext:${${BRAND_BASE_DIR}/program/lounorc:UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini
 URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
 BAK_EXTENSIONS=${$ORIGIN/lounorc:TMP_EXTENSIONS}
 BUNDLED_EXTENSIONS=${$ORIGIN/lounorc:BUNDLED_EXTENSIONS}
@@ -226,11 +227,11 @@ 
PKG_BundledUnoFile=$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deploymen
 
PKG_SharedUnoFile=$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
 
PKG_UserUnoFile=$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
 
BAK_EXTENSIONS=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/bak
-BUNDLED_EXTENSIONS=$BRAND_BASE_DIR/share/extensions
+BUNDLED_EXTENSIONS=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/share/extensions
 
BUNDLED_EXTENSIONS_USER=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/bundled
 
TMP_EXTENSIONS=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/tmp
 
SHARED_EXTENSIONS_USER=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/shared
-UNO_SHARED_PACKAGES=$BRAND_BASE_DIR/share/uno_packages
+UNO_SHARED_PACKAGES=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/share/uno_packages
 UNO_SHARED_PACKAGES_CACHE=$UNO_SHARED_PACKAGES/cache
 
UNO_USER_PACKAGES=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/uno_packages
 UNO_USER_PACKAGES_CACHE=$UNO_USER_PACKAGES/cache
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-07 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |   24 
 1 file changed, 24 insertions(+)

New commits:
commit e322ed191b798fe4c8b7d1432ca68f66d2502937
Author: Jan Holesovsky 
AuthorDate: Fri Feb 7 12:12:21 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Feb 7 22:44:42 2020 +0100

android hunspell: Generate lounorc so that we can register bundled 
extensions.

The dictionaries have to be registered as bundled extensions...

Change-Id: I0ebe04bfa2253d2ed9112055e397797df050eec6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88225
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 3352febb6..776d8af38 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -175,6 +175,7 @@ task createRCfiles {
 def fundamentalrc = file('src/main/assets/program/fundamentalrc')
 def bootstraprc = file('src/main/assets/program/bootstraprc')
 def unorc = file('src/main/assets/program/unorc')
+def lounorc = file('src/main/assets/program/lounorc')
 def versionrc = file('src/main/assets/program/versionrc')
 
 outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc
@@ -196,6 +197,13 @@ BRAND_BASE_DIR=file:///assets
 BRAND_SHARE_SUBDIR=share
 CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry 
res:${BRAND_BASE_DIR}/share/registry
 URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
+BAK_EXTENSIONS=${$ORIGIN/lounorc:TMP_EXTENSIONS}
+BUNDLED_EXTENSIONS=${$ORIGIN/lounorc:BUNDLED_EXTENSIONS}
+BUNDLED_EXTENSIONS_USER=${$ORIGIN/lounorc:BUNDLED_EXTENSIONS_USER}
+SHARED_EXTENSIONS_USER=${$ORIGIN/lounorc:SHARED_EXTENSIONS_USER}
+UNO_SHARED_PACKAGES_CACHE=${$ORIGIN/lounorc:UNO_SHARED_PACKAGES_CACHE}
+TMP_EXTENSIONS=${$ORIGIN/lounorc:TMP_EXTENSIONS}
+UNO_USER_PACKAGES_CACHE=${$ORIGIN/lounorc:UNO_USER_PACKAGES_CACHE}
 '''.stripIndent()
 
 bootstraprc.text = '''\
@@ -210,6 +218,22 @@ UserInstallation=file://$APP_DATA_DIR
 URE_INTERNAL_LIB_DIR=file://$APP_DATA_DIR/lib/
 UNO_TYPES=file://$APP_DATA_DIR/program/udkapi.rdb 
file://$APP_DATA_DIR/program/offapi.rdb 
file://$APP_DATA_DIR/program/oovbaapi.rdb
 UNO_SERVICES=file:///assets/program/services.rdb 
file:///assets/program/services/services.rdb
+'''.stripIndent()
+
+lounorc.text = '''\
+[Bootstrap]
+PKG_BundledUnoFile=$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
+PKG_SharedUnoFile=$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
+PKG_UserUnoFile=$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
+BAK_EXTENSIONS=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/bak
+BUNDLED_EXTENSIONS=$BRAND_BASE_DIR/share/extensions
+BUNDLED_EXTENSIONS_USER=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/bundled
+TMP_EXTENSIONS=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/tmp
+SHARED_EXTENSIONS_USER=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/extensions/shared
+UNO_SHARED_PACKAGES=$BRAND_BASE_DIR/share/uno_packages
+UNO_SHARED_PACKAGES_CACHE=$UNO_SHARED_PACKAGES/cache
+UNO_USER_PACKAGES=${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/uno_packages
+UNO_USER_PACKAGES_CACHE=$UNO_USER_PACKAGES/cache
 '''.stripIndent()
 
 versionrc.text = '''\
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-02-06 Thread mert (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 176be0101210721204826aff1da6b58e2124
Author: mert 
AuthorDate: Thu Feb 6 11:58:46 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Thu Feb 6 10:06:37 2020 +0100

Destroy webview when LOActivity is destroyed

Chrome://inspect shows that webviews are not destroyed
even after closing the activity.

Change-Id: Ib0fb2f0b75b06ae349a37a11fb0c9cb35faf3ff5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88074
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 34fd8b1b2..acbd9cdf5 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -441,6 +441,7 @@ public class LOActivity extends AppCompatActivity {
 super.onDestroy();
 Log.i(TAG, "onDestroy() - we know we are leaving the document");
 nativeLooper.quit();
+mWebView.destroy();
 postMobileMessageNative("BYE");
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib ios/ios.h ios/ios.mm ios/Mobile wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp

2020-02-06 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |   13 +
 ios/Mobile/DocumentViewController.mm|3 ++-
 ios/ios.h   |2 --
 ios/ios.mm  |1 -
 wsd/LOOLWSD.cpp |8 +---
 wsd/LOOLWSD.hpp |4 
 6 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit ad32888d7c2ec960255d826c245f7df2e93c3f1b
Author: Jan Holesovsky 
AuthorDate: Thu Dec 5 22:27:16 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Feb 6 09:44:26 2020 +0100

mobile: Unify the mutex usage that protects the main lokit thread.

Effectively both approaches were doing the same thing, let's unify to
the iOS way to minimize the platform-specific code.

Change-Id: I11290410a536c26db054ffcb87e3b64cc2a11c07
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/84589
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 59079d935..10f4876ad 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -34,7 +34,6 @@ static int fakeClientFd;
 static int closeNotificationPipeForForwardingThread[2] = {-1, -1};
 static JavaVM* javaVM = nullptr;
 static bool lokInitialized = false;
-static std::mutex loolwsdRunningMutex;
 
 extern "C" JNIEXPORT jint JNICALL
 JNI_OnLoad(JavaVM* vm, void*) {
@@ -161,12 +160,11 @@ static void send2JS(const JNIThreadContext , jclass 
loActivityClz, jobject
 void closeDocument()
 {
 // Close one end of the socket pair, that will wake up the forwarding 
thread that was constructed in HULLO
-if (fakeSocketClose(closeNotificationPipeForForwardingThread[0]) == 0)
-{
-LOG_DBG("Waiting for LOOLWSD to finish...");
-std::unique_lock lock(loolwsdRunningMutex);
-LOG_DBG("LOOLWSD has finished.");
-}
+fakeSocketClose(closeNotificationPipeForForwardingThread[0]);
+
+LOG_DBG("Waiting for LOOLWSD to finish...");
+std::unique_lock lock(LOOLWSD::lokit_main_mutex);
+LOG_DBG("LOOLWSD has finished.");
 }
 
 /// Handle a message from JavaScript.
@@ -323,7 +321,6 @@ 
Java_org_libreoffice_androidlib_LOActivity_createLOOLWSD(JNIEnv *env, jobject, j
 {
 LOG_DBG("Creating LOOLWSD");
 {
-std::unique_lock 
lock(loolwsdRunningMutex);
 fakeClientFd = fakeSocketSocket();
 LOG_DBG("createLOOLWSD created fakeClientFd: " << 
fakeClientFd);
 std::unique_ptr loolwsd(new LOOLWSD());
diff --git a/ios/Mobile/DocumentViewController.mm 
b/ios/Mobile/DocumentViewController.mm
index a7731ced8..8c97826e9 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -19,6 +19,7 @@
 
 #import "ios.h"
 #import "FakeSocket.hpp"
+#import "LOOLWSD.hpp"
 #import "Log.hpp"
 #import "SigUtil.hpp"
 #import "Util.hpp"
@@ -434,7 +435,7 @@ static IMP standardImpOfInputAccessoryView = nil;
}];
 
 // Wait for lokit_main thread to exit
-std::lock_guard lock(lokit_main_mutex);
+std::lock_guard lock(LOOLWSD::lokit_main_mutex);
 
 theSingleton = nil;
 
diff --git a/ios/ios.h b/ios/ios.h
index 7eb1e8357..a4283cefb 100644
--- a/ios/ios.h
+++ b/ios/ios.h
@@ -16,6 +16,4 @@ extern lok::Document *lok_document;
 
 extern LibreOfficeKit *lo_kit;
 
-extern std::mutex lokit_main_mutex;
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/ios.mm b/ios/ios.mm
index 8f3ccc3ca..97c49c3e9 100644
--- a/ios/ios.mm
+++ b/ios/ios.mm
@@ -20,6 +20,5 @@ extern "C" {
 int loolwsd_server_socket_fd = -1;
 lok::Document *lok_document = nullptr;
 LibreOfficeKit *lo_kit;
-std::mutex lokit_main_mutex;
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index c8f4d0053..7fa1898ec 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -486,6 +486,10 @@ static size_t addNewChild(const 
std::shared_ptr& child)
 return count;
 }
 
+#if MOBILEAPP
+std::mutex LOOLWSD::lokit_main_mutex;
+#endif
+
 std::shared_ptr getNewChild_Blocks(
 #if MOBILEAPP
  const std::string& uri
@@ -519,9 +523,7 @@ std::shared_ptr getNewChild_Blocks(
 
 std::thread([&]
 {
-#ifdef IOS
-std::lock_guard 
lokit_main_lock(lokit_main_mutex);
-#endif
+std::lock_guard 
lokit_main_lock(LOOLWSD::lokit_main_mutex);
 Util::setThreadName("lokit_main");
 
 // Ugly to have that static global, otoh we know there is 
just one LOOLWSD
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index 35c283288..288ed6bb9 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -79,6 +79,10 @@ public:
 static std::string 

[Libreoffice-commits] online.git: android/lib

2020-02-01 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 02815066c8864cb8a167af104594925a59aa3a88
Author: Jan Holesovsky 
AuthorDate: Fri Jan 31 21:36:12 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Sat Feb 1 09:31:26 2020 +0100

android: Add the liblangtag data to the APK.

Without this, the app crashes with exotic locales.

Change-Id: Ia0e4ffe6e8ed512c2a0402819b84d9563d17b0f6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87786
Reviewed-by: Michael Meeks 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 6523ca683..3352febb6 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -118,6 +118,11 @@ task copyUnpackAssets(type: Copy) {
 )
 }
 }
+into('share') {
+from "${liboInstdir}/share"
+// liblangtag data is needed for locales like en-CH
+includes = ['liblangtag/**']
+}
 }
 
 task copyAssets(type: Copy) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2020-01-15 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp
 |  179 --
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java   
 |  103 -
 android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardData.java 
 |   85 
 
android/lib/src/main/java/org/libreoffice/androidlib/lok/LokClipboardEntry.java 
|6 
 4 files changed, 321 insertions(+), 52 deletions(-)

New commits:
commit d6ed93a6451796f5fa558dc363b921aa2c10af93
Author: Tomaž Vajngerl 
AuthorDate: Wed Jan 15 10:32:42 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Jan 16 00:58:57 2020 +0100

android: improve clipboard, inter-document copy/paste possible

In andorid app, we just supported html or text to be copied between
applications (inside the document the copy/paste is handeled by
the core). The biggest problem with this is that copying between
documents doesn't work or works just as good as our HTML support
is. With this change, we get all the clipboard content after copy
and serialize it to a file into the cache and if we then paste in
another document, we read the content of the file and paste
without any loss of fidelity.

Change-Id: I3501045ff2e815a7e2f8c6ecce5255511c256ca6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86833
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 1e5a80686..59079d935 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -338,7 +338,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_createLOOLWSD(JNIEnv *env, jobject, j
 extern "C"
 JNIEXPORT void JNICALL
 Java_org_libreoffice_androidlib_LOActivity_saveAs(JNIEnv *env, jobject 
instance,
-jstring fileUri_, jstring 
format_) {
+  jstring fileUri_, jstring 
format_) {
 const char *fileUri = env->GetStringUTFChars(fileUri_, 0);
 const char *format = env->GetStringUTFChars(format_, 0);
 
@@ -348,6 +348,23 @@ Java_org_libreoffice_androidlib_LOActivity_saveAs(JNIEnv 
*env, jobject instance,
 env->ReleaseStringUTFChars(format_, format);
 }
 
+extern "C"
+JNIEXPORT void JNICALL
+Java_org_libreoffice_androidlib_LOActivity_postUnoCommand(JNIEnv* pEnv, 
jobject instance,
+  jstring command, 
jstring arguments, jboolean bNotifyWhenFinished)
+{
+const char* pCommand = pEnv->GetStringUTFChars(command, nullptr);
+const char* pArguments = nullptr;
+if (arguments != nullptr)
+pArguments = pEnv->GetStringUTFChars(arguments, nullptr);
+
+getLOKDocument()->postUnoCommand(pCommand, pArguments, 
bNotifyWhenFinished);
+
+pEnv->ReleaseStringUTFChars(command, pCommand);
+if (arguments != nullptr)
+pEnv->ReleaseStringUTFChars(arguments, pArguments);
+}
+
 static jstring tojstringAndFree(JNIEnv *env, char *str)
 {
 if (!str)
@@ -357,51 +374,167 @@ static jstring tojstringAndFree(JNIEnv *env, char *str)
 return ret;
 }
 
+const char* copyJavaString(JNIEnv* pEnv, jstring aJavaString)
+{
+const char* pTemp = pEnv->GetStringUTFChars(aJavaString, nullptr);
+const char* pClone = strdup(pTemp);
+pEnv->ReleaseStringUTFChars(aJavaString, pTemp);
+return pClone;
+}
+
 extern "C"
-JNIEXPORT jobjectArray JNICALL
-Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, 
jobject instance)
+JNIEXPORT jboolean JNICALL
+Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, 
jobject instance, jobject lokClipboardData)
 {
-const char *mimeTypes[] = { "text/plain;charset=utf-8", "text/html", 
nullptr };
+const char** mimeTypes = nullptr;
 size_t outCount = 0;
 char  **outMimeTypes = nullptr;
 size_t *outSizes = nullptr;
 char  **outStreams = nullptr;
+bool bResult = false;
 
-jobjectArray values = 
(jobjectArray)env->NewObjectArray(2,env->FindClass("java/lang/String"),env->NewStringUTF(""));
+jclass jclazz = env->FindClass("java/util/ArrayList");
+jmethodID methodId_ArrayList_Add = env->GetMethodID(jclazz, "add", 
"(Ljava/lang/Object;)Z");
+
+jclass class_LokClipboardEntry = 
env->FindClass("org/libreoffice/androidlib/lok/LokClipboardEntry");
+jmethodID methodId_LokClipboardEntry_Constructor = 
env->GetMethodID(class_LokClipboardEntry, "", "()V");
+jfieldID fieldId_LokClipboardEntry_Mime = 
env->GetFieldID(class_LokClipboardEntry , "mime", "Ljava/lang/String;");
+jfieldID fieldId_LokClipboardEntry_Data = 
env->GetFieldID(class_LokClipboardEntry, "data", "[B");
+
+jclass class_LokClipboardData = env->GetObjectClass(lokClipboardData);
+jfieldID fieldId_LokClipboardData_clipboardEntries = 
env->GetFieldID(class_LokClipboardData , 

[Libreoffice-commits] online.git: android/lib

2020-01-15 Thread Tomaž Vajngerl (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |  153 
--
 1 file changed, 74 insertions(+), 79 deletions(-)

New commits:
commit 89a75eee710208f4997d052c272c12c22405496b
Author: Tomaž Vajngerl 
AuthorDate: Wed Jan 15 21:08:26 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Jan 16 00:59:15 2020 +0100

android: clipboard is sync. so exec. in the thread is not needed

As we changed the clipboard to be synchronous now, it's not needed
to execute copy/cut/paste actions in a separate thread anymore.

Also change WebView message interception, so we can execute
actions after a we send WebView a message. This is needed when
we copy/cut something and need to push the content to the android
clipboard and clipboard file.

Change-Id: I08b6ee55ca8bd7b958d348e257c19395ea39ac80
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86882
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 7698c9368..9c7729ef9 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -520,8 +520,11 @@ public class LOActivity extends AppCompatActivity {
 public void postMobileMessage(String message) {
 Log.d(TAG, "postMobileMessage: " + message);
 
-if (interceptMsgFromWebView(message)) {
+String[] messageAndParameterArray= message.split(" ", 2); // the 
command and the rest (that can potentially contain spaces too)
+
+if (beforeMessageFromWebView(messageAndParameterArray)) {
 postMobileMessageNative(message);
+afterMessageFromWebView(messageAndParameterArray);
 }
 
 // Going back to document browser on BYE (called when pressing the top 
left exit button)
@@ -568,8 +571,7 @@ public class LOActivity extends AppCompatActivity {
 /**
  * return true to pass the message to the native part or false to block 
the message
  */
-boolean interceptMsgFromWebView(String message) {
-String[] messageAndParam = message.split(" ", 2); // the command and 
the rest (that can potentially contain spaces too)
+private boolean beforeMessageFromWebView(String[] messageAndParam) {
 switch (messageAndParam[0]) {
 case "PRINT":
 mainHandler.post(new Runnable() {
@@ -589,10 +591,6 @@ public class LOActivity extends AppCompatActivity {
 switch (messageAndParam[1]) {
 case ".uno:Paste":
 return performPaste();
-case ".uno:Copy":
-case ".uno:Cut":
-populateClipboard();
-break;
 default:
 break;
 }
@@ -630,6 +628,23 @@ public class LOActivity extends AppCompatActivity {
 return true;
 }
 
+private void afterMessageFromWebView(String[] messageAndParameterArray) {
+switch (messageAndParameterArray[0]) {
+case "uno":
+switch (messageAndParameterArray[1]) {
+case ".uno:Copy":
+case ".uno:Cut":
+populateClipboard();
+break;
+default:
+break;
+}
+break;
+default:
+break;
+}
+}
+
 private void initiatePrint() {
 PrintManager printManager = (PrintManager) 
getSystemService(PRINT_SERVICE);
 PrintDocumentAdapter printAdapter = new PrintAdapter(LOActivity.this);
@@ -689,45 +704,39 @@ public class LOActivity extends AppCompatActivity {
 /// Needs to be executed after the .uno:Copy / Paste has executed
 public final void populateClipboard()
 {
-/// FIXME: in theory we can do better with URIs to temporary files and 
so on...
-nativeHandler.post(new Runnable() {
-@Override
-public void run() {
-File clipboardFile = new 
File(getApplicationContext().getCacheDir(), CLIPBOARD_FILE_PATH);
-if (clipboardFile.exists())
-clipboardFile.delete();
-
-LokClipboardData clipboardData = new LokClipboardData();
-if (!LOActivity.this.getClipboardContent(clipboardData))
-Log.e(TAG, "no clipboard to copy");
-else
-{
-clipboardData.writeToFile(clipboardFile);
-
-String text = clipboardData.getText();
-String html = clipboardData.getHtml();
-
-if (html != null) {
-  

[Libreoffice-commits] online.git: android/lib loleaflet/src wsd/protocol.txt

2020-01-14 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   26 
++
 loleaflet/src/control/Control.MobileWizard.js|5 +
 loleaflet/src/core/Socket.js |5 +
 wsd/protocol.txt |6 ++
 4 files changed, 42 insertions(+)

New commits:
commit 0a35e432ff17b1a80065c36d56069393bfba6bea
Author: Jan Holesovsky 
AuthorDate: Tue Jan 14 16:49:36 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jan 14 17:44:28 2020 +0100

android: When the mobile-wizard is open, the Back button should go a level 
up.

Without this, we were closing the document, which was very annoying.

Change-Id: I1e841da28c92c0e01284c2d7e2d4dbc6762bfffd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86779
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 713032122..030f35357 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -99,6 +99,9 @@ public class LOActivity extends AppCompatActivity {
 private Handler nativeHandler;
 private Looper nativeLooper;
 
+/** In case the mobile-wizard is visible, we have to intercept the 
Android's Back button. */
+private boolean mMobileWizardVisible = false;
+
 private ValueCallback valueCallback;
 public static final int REQUEST_SELECT_FILE = 555;
 
@@ -448,6 +451,18 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
+@Override
+public void onBackPressed() {
+if (mMobileWizardVisible)
+{
+// just return one level up in the mobile-wizard (or close it)
+callFakeWebsocketOnMessage("'mobile: mobilewizardback'");
+return;
+}
+
+super.onBackPressed();
+}
+
 private void loadDocument() {
 // setup the LOOLWSD
 ApplicationInfo applicationInfo = getApplicationInfo();
@@ -596,6 +611,17 @@ public class LOActivity extends AppCompatActivity {
 });
 return false;
 }
+case "MOBILEWIZARD": {
+switch (messageAndParam[1]) {
+case "show":
+mMobileWizardVisible = true;
+break;
+case "hide":
+mMobileWizardVisible = false;
+break;
+}
+return false;
+}
 }
 return true;
 }
diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index f186a2412..7b91d1a94 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -27,6 +27,7 @@ L.Control.MobileWizard = L.Control.extend({
map.on('mobilewizard', this._onMobileWizard, this);
map.on('closemobilewizard', this._hideWizard, this);
map.on('showwizardsidebar', this._showWizardSidebar, this);
+   map.on('mobilewizardback', this.goLevelUp, this);
 
this._setupBackButton();
},
@@ -58,6 +59,8 @@ L.Control.MobileWizard = L.Control.extend({
_showWizard: function() {
$('#mobile-wizard').show();
$('#toolbar-down').hide();
+   if (window.ThisIsTheAndroidApp)
+   window.postMobileMessage('MOBILEWIZARD show');
},
 
_showWizardSidebar: function() {
@@ -72,6 +75,8 @@ L.Control.MobileWizard = L.Control.extend({
if (this.map._permission === 'edit') {
$('#toolbar-down').show();
}
+   if (window.ThisIsTheAndroidApp)
+   window.postMobileMessage('MOBILEWIZARD hide');
 
this.map.showSidebar = false;
this._isActive = false;
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 653b71366..a65133d4c 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -755,6 +755,11 @@ L.Socket = L.Class.extend({
vex.closeAll();
}
}
+   else if (window.ThisIsAMobileApp && 
textMsg.startsWith('mobile:')) {
+   // allow passing some events easily from the mobile app
+   var mobileEvent = textMsg.substring('mobile: '.length);
+   this._map.fire(mobileEvent);
+   }
else if (!textMsg.startsWith('tile:') && 
!textMsg.startsWith('renderfont:') && !textMsg.startsWith('windowpaint:')) {
// log the tile msg separately as we need 

[Libreoffice-commits] online.git: android/lib

2020-01-03 Thread Michael Meeks (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp |   61 +++-
 1 file changed, 38 insertions(+), 23 deletions(-)

New commits:
commit 3328b9e317509fce9461571b764758c824720c82
Author: Michael Meeks 
AuthorDate: Fri Jan 3 10:21:10 2020 +
Commit: Michael Meeks 
CommitDate: Fri Jan 3 13:23:08 2020 +0100

android: don't continually attach & detach the TLS JNIEnv.

Change-Id: I76424e3af7b9d7fe4de486e7fa0903bb4f7dc17e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86166
Reviewed-by: Jan Holesovsky 
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index 577df5a90..1e5a80686 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -56,7 +56,41 @@ JNI_OnLoad(JavaVM* vm, void*) {
 return JNI_VERSION_1_6;
 }
 
-static void send2JS(jclass loActivityClz, jobject loActivityObj, const 
std::vector& buffer)
+// Exception safe JVM detach, JNIEnv is TLS for Java - so per-thread.
+class JNIThreadContext
+{
+JNIEnv *_env;
+public:
+JNIThreadContext()
+{
+assert(javaVM != nullptr);
+jint res = javaVM->GetEnv((void**)&_env, JNI_VERSION_1_6);
+if (res == JNI_EDETACHED) {
+LOG_DBG("Attach worker thread");
+res = javaVM->AttachCurrentThread(&_env, nullptr);
+if (JNI_OK != res) {
+LOG_DBG("Failed to AttachCurrentThread");
+}
+}
+else if (res == JNI_EVERSION) {
+LOG_DBG("GetEnv version not supported");
+return;
+}
+else if (res != JNI_OK) {
+LOG_DBG("GetEnv another error " << res);
+return;
+}
+}
+
+~JNIThreadContext()
+{
+javaVM->DetachCurrentThread();
+}
+
+JNIEnv *getEnv() const { return _env; }
+};
+
+static void send2JS(const JNIThreadContext , jclass loActivityClz, 
jobject loActivityObj, const std::vector& buffer)
 {
 LOG_DBG("Send to JS: " << 
LOOLProtocol::getAbbreviatedMessage(buffer.data(), buffer.size()));
 
@@ -114,33 +148,13 @@ static void send2JS(jclass loActivityClz, jobject 
loActivityObj, const std::vect
 
 LOG_DBG("Sending to JavaScript: " << subjs);
 
-JNIEnv *env;
-jint res = javaVM->GetEnv((void**), JNI_VERSION_1_6);
-if (res == JNI_EDETACHED) {
-LOG_DBG("GetEnv need to attach thread");
-res = javaVM->AttachCurrentThread(, nullptr);
-if (JNI_OK != res) {
-LOG_DBG("Failed to AttachCurrentThread");
-return;
-}
-}
-else if (res == JNI_EVERSION) {
-LOG_DBG("GetEnv version not supported");
-return;
-}
-else if (res != JNI_OK) {
-LOG_DBG("GetEnv another error");
-return;
-}
-
+JNIEnv *env = jctx.getEnv();
 jstring jstr = env->NewStringUTF(js.c_str());
 jmethodID callFakeWebsocket = env->GetMethodID(loActivityClz, 
"callFakeWebsocketOnMessage", "(Ljava/lang/String;)V");
 env->CallVoidMethod(loActivityObj, callFakeWebsocket, jstr);
 
 if (env->ExceptionCheck())
 env->ExceptionDescribe();
-
-javaVM->DetachCurrentThread();
 }
 
 /// Close the document.
@@ -191,6 +205,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv *env,
 std::thread([loActivityClz, loActivityObj, currentFakeClientFd]
 {
 Util::setThreadName("app2js");
+JNIThreadContext ctx;
 while (true)
 {
struct pollfd pollfd[2];
@@ -228,7 +243,7 @@ 
Java_org_libreoffice_androidlib_LOActivity_postMobileMessageNative(JNIEnv *env,
return;
std::vector buf(n);
n = fakeSocketRead(currentFakeClientFd, 
buf.data(), n);
-   send2JS(loActivityClz, loActivityObj, 
buf);
+   send2JS(ctx, loActivityClz, 
loActivityObj, buf);
}
}
else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2019-12-30 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2ea84e11cb9284c6e5ab8b650fc4e2c95492c3af
Author: Jan Holesovsky 
AuthorDate: Mon Dec 30 16:43:52 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Mon Dec 30 16:46:32 2019 +0100

android: Fix a typo in the 32bit build.

Change-Id: I8a1d68327c48da47d970eccdd586c26467bb495c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86014
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 2d5dc09e1..b76d8fe97 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -26,7 +26,7 @@ target_compile_definitions(androidapp PRIVATE 
LOOLWSD_CONFIGDIR="/etc/loolwsd")
 # According to the ABI, we need to use different source trees
 if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
 set(LOBUILDDIR_ABI @LOBUILDDIR@)
-set(POCOINCLUDE_ABI ${POCOINCLUDE_ABI})
+set(POCOINCLUDE_ABI @POCOINCLUDE@)
 set(POCOLIB_ABI @POCOLIB@)
 elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
 set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/src

2019-12-18 Thread Michael Meeks (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp  |   42 +++
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |  124 
++
 loleaflet/src/control/Control.JSDialogBuilder.js |2 
 loleaflet/src/map/Map.js |2 
 4 files changed, 126 insertions(+), 44 deletions(-)

New commits:
commit 76114dd957e8f121969dd206213b3a31a4de7afc
Author: Michael Meeks 
AuthorDate: Wed Dec 18 17:10:04 2019 +
Commit: Jan Holesovsky 
CommitDate: Thu Dec 19 01:19:08 2019 +0100

android: improved native copy/paste.

don't do copy/paste in the JS if we can avoid it.
support text & html for cut / copy and share code.
inject our own origin cookie to allow local short-circuiting.

Change-Id: I3187104e9602e86b50cf52d45a9277db44ca8b3b
Reviewed-on: https://gerrit.libreoffice.org/85455
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index d964d3579..577df5a90 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -333,11 +333,47 @@ Java_org_libreoffice_androidlib_LOActivity_saveAs(JNIEnv 
*env, jobject instance,
 env->ReleaseStringUTFChars(format_, format);
 }
 
+static jstring tojstringAndFree(JNIEnv *env, char *str)
+{
+if (!str)
+return env->NewStringUTF("");
+jstring ret = env->NewStringUTF(str);
+free(str);
+return ret;
+}
+
 extern "C"
-JNIEXPORT jstring JNICALL
-Java_org_libreoffice_androidlib_LOActivity_getTextSelection(JNIEnv *env, 
jobject instance) {
+JNIEXPORT jobjectArray JNICALL
+Java_org_libreoffice_androidlib_LOActivity_getClipboardContent(JNIEnv *env, 
jobject instance)
+{
+const char *mimeTypes[] = { "text/plain;charset=utf-8", "text/html", 
nullptr };
+size_t outCount = 0;
+char  **outMimeTypes = nullptr;
+size_t *outSizes = nullptr;
+char  **outStreams = nullptr;
+
+jobjectArray values = 
(jobjectArray)env->NewObjectArray(2,env->FindClass("java/lang/String"),env->NewStringUTF(""));
+
+if (getLOKDocument()->getClipboard(mimeTypes,
+   , ,
+   , ))
+{
+if (outCount != 2)
+LOG_DBG("clipboard fetch produced wrong results");
+else
+{
+env->SetObjectArrayElement(values,0,tojstringAndFree(env, 
outStreams[0]));
+env->SetObjectArrayElement(values,1,tojstringAndFree(env, 
outStreams[1]));
+free (outMimeTypes[0]);
+free (outMimeTypes[1]);
+free (outMimeTypes);
+free (outStreams);
+}
+}
+else
+LOG_DBG("failed to fetch mime-types");
 
-return 
env->NewStringUTF(getLOKDocument()->getTextSelection("text/plain;charset=utf-8"));
+return values;
 }
 
 extern "C"
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index e1efc01f9..713032122 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -78,6 +78,9 @@ public class LOActivity extends AppCompatActivity {
 
 private int providerId;
 
+/// Unique number identifying this app + document.
+private long loadDocumentMillis = 0;
+
 @Nullable
 private URI documentUri;
 
@@ -478,6 +481,8 @@ public class LOActivity extends AppCompatActivity {
 mWebView.loadUrl(finalUrlToLoad);
 
 documentLoaded = true;
+
+loadDocumentMillis = android.os.SystemClock.uptimeMillis();
 }
 
 static {
@@ -564,46 +569,13 @@ public class LOActivity extends AppCompatActivity {
 case "uno":
 switch (messageAndParam[1]) {
 case ".uno:Paste":
-clipData = clipboardManager.getPrimaryClip();
-if (clipData != null) {
-if 
(clipData.getDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
-final ClipData.Item clipItem = 
clipData.getItemAt(0);
-nativeHandler.post(new Runnable() {
-@Override
-public void run() {
-
LOActivity.this.paste("text/plain;charset=utf-16", 
clipItem.getText().toString());
-}
-});
-}
-return false;
-}
+return performPaste();
+case ".uno:Copy":
+case ".uno:Cut":
+populateClipboard();
 break;
- 

[Libreoffice-commits] online.git: android/lib

2019-12-18 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e07dca49eb0a271ea800462ae08f8e18f46b699e
Author: Jan Holesovsky 
AuthorDate: Wed Dec 18 23:14:05 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Dec 19 00:25:34 2019 +0100

android: The .mo resource (translation) files have to be in 'unpack'.

So that they are copied to the normal filesystem and boost::local can
pick them up from there.

Change-Id: Ic36288b14023decf9e507b5d7d883849010cd2a7
Reviewed-on: https://gerrit.libreoffice.org/85454
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 631524dce..997bdfd23 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -74,6 +74,11 @@ task copyUnpackAssets(type: Copy) {
 includes = ["types.rdb"]
 rename 'types.rdb', 'udkapi.rdb'
 }
+
+into('resource') {
+from "${liboInstdir}/${liboSharedResFolder}"
+includes = ['**']
+}
 }
 into('user/fonts') {
 from "${liboInstdir}/share/fonts/truetype"
@@ -124,11 +129,6 @@ task copyAssets(type: Copy) {
 into('program') {
 from "${liboInstdir}/program"
 includes = ['services.rdb', 'services/services.rdb']
-
-into('resource') {
-from "${liboInstdir}/${liboSharedResFolder}"
-includes = ['*en-US.res']
-}
 }
 into('share') {
 from "${liboInstdir}/share"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2019-12-12 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c2385112acd9fe14c3859b21c8b757af3af2779c
Author: Jan Holesovsky 
AuthorDate: Thu Dec 12 10:14:34 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Dec 12 10:17:16 2019 +0100

android: Make all the .uno: commands work again.

Was a problem introduced by c6f36965cfc1bd68fdb88b01d493163b5d176bcc.

Change-Id: I8fbc722ed73af19a6462c87242d431eea118f1a2
Reviewed-on: https://gerrit.libreoffice.org/85020
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index bae078ab9..e1efc01f9 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -605,6 +605,7 @@ public class LOActivity extends AppCompatActivity {
 break;
 }
 }
+break;
 case "DIM_SCREEN": {
 mainHandler.post(new Runnable() {
 @Override
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2019-12-11 Thread Pedro Pinto Silva (via logerrit)
 android/lib/src/main/res/values-pt-rBR/strings.xml |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 1a6ab5ae287cf2b7c39a63e650179953fde153b8
Author: Pedro Pinto Silva 
AuthorDate: Wed Dec 11 20:23:01 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Dec 11 20:43:57 2019 +0100

android: Brazil Portuguese translations of the lib.

Change-Id: I587a69518d23c7f2a7580918610619bd78821754
Reviewed-on: https://gerrit.libreoffice.org/84982
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/src/main/res/values-pt-rBR/strings.xml 
b/android/lib/src/main/res/values-pt-rBR/strings.xml
new file mode 100644
index 0..4e668e628
--- /dev/null
+++ b/android/lib/src/main/res/values-pt-rBR/strings.xml
@@ -0,0 +1,10 @@
+
+Este documento é apenas de 
leitura, salvaguardar está desabilitado.
+Permissão de armazenamento é 
requirida
+Falha no carregamento do 
documento
+Falha ao inserir imagem
+Não foi possível abrir o gestor de 
arquivos
+
+
+Carregando...
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2019-12-11 Thread Eloy Crespo (via logerrit)
 android/lib/src/main/res/values-es/strings.xml |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 166a0f2c02ad1d91c622f128bd6c12fc9eedf254
Author: Eloy Crespo 
AuthorDate: Wed Dec 11 20:22:08 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Dec 11 20:43:31 2019 +0100

android: Spanish translations of the lib.

Change-Id: I8fc84c9d406a2cd7be840ec2f6e09a9869e8e157
Reviewed-on: https://gerrit.libreoffice.org/84981
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/src/main/res/values-es/strings.xml 
b/android/lib/src/main/res/values-es/strings.xml
new file mode 100644
index 0..c488031e1
--- /dev/null
+++ b/android/lib/src/main/res/values-es/strings.xml
@@ -0,0 +1,10 @@
+
+Este archivo es de solo lectura, 
el guardado está deshabilitado.
+Se requiere permiso de 
almacenamiento
+Error al determinar el archivo a 
cargar
+Error al insertar imagen
+No se puede abrir el selector de 
archivos
+
+
+Cargando...
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib

2019-12-11 Thread Michael Meeks (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e12de33ecf76b8f2828edf8d163d23fb5a435137
Author: Michael Meeks 
AuthorDate: Wed Dec 11 11:19:28 2019 +
Commit: Michael Meeks 
CommitDate: Wed Dec 11 13:22:49 2019 +0100

android: encode SCHEME_FILE paths as URIs not paths.

Fixes encoding problems particularly with eg.
SCHEME_FILE: getPath(): 
/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/u...@demoserver.com%2Fnextcloud/test.docx

Change-Id: I0f2a84ff29fffd87ef059727bfb530bb54ab2ab9
Reviewed-on: https://gerrit.libreoffice.org/84936
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index a8a9b80ad..bae078ab9 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -248,7 +248,7 @@ public class LOActivity extends AppCompatActivity {
 }
 } else if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_FILE)) {
 isDocEditable = true;
-urlToLoad = getIntent().getData().getPath();
+urlToLoad = getIntent().getData().toString();
 Log.d(TAG, "SCHEME_FILE: getPath(): " + 
getIntent().getData().getPath());
 // Gather data to rebuild IFile object later
 providerId = getIntent().getIntExtra(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/js loleaflet/Makefile.am loleaflet/util

2019-12-11 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |7 
+++
 loleaflet/Makefile.am|8 
+++-
 loleaflet/js/global.js   |9 
+++--
 loleaflet/util/create-l10n-all-js.pl |2 ++
 4 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 0cd43ead59be4ac7efc6b17cf2bc537f48ca3576
Author: Jan Holesovsky 
AuthorDate: Wed Dec 11 11:46:52 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Dec 11 11:49:37 2019 +0100

android: Make the localization work for the JS pieces.

To have the menu translated.

Change-Id: I8d4d90d260aa3fcd80a8eb68515b22c58c9b3e18
Reviewed-on: https://gerrit.libreoffice.org/84931
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index a9cca125c..a8a9b80ad 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -460,14 +460,21 @@ public class LOActivity extends AppCompatActivity {
 // trigger the load of the document
 String finalUrlToLoad = 
"file:///android_asset/dist/loleaflet.html?file_path=" +
 urlToLoad + "=1";
+
+// set the language
+finalUrlToLoad += "=" + 
getResources().getConfiguration().locale.toLanguageTag();
+
 if (isDocEditable) {
 finalUrlToLoad += "=edit";
 } else {
 finalUrlToLoad += "=readonly";
 }
+
 if (isDocDebuggable) {
 finalUrlToLoad += "=true";
 }
+
+// load the page
 mWebView.loadUrl(finalUrlToLoad);
 
 documentLoaded = true;
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index e829b9956..410e7453e 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -3,13 +3,11 @@ L10N_PO = $(wildcard $(srcdir)/po/*.po)
 
 if !ENABLE_MOBILEAPP
 L10N_JSON = $(patsubst 
$(srcdir)/po/%.po,$(builddir)/dist/l10n/%.json,$(L10N_PO))
-endif
-
-if ENABLE_IOSAPP
+else
 L10N_IOS_ALL_JS = $(builddir)/dist/l10n-all.js
 L10N_JSON = $(L10N_IOS_ALL_JS)
 
-$(L10N_IOS_ALL_JS) : $(wildcard $(srcdir)/po/ui-*.po) $(shell find 
$(srcdir)/l10n -name '*.*')
+$(L10N_IOS_ALL_JS) : $(wildcard $(srcdir)/po/ui-*.po) $(shell find 
$(srcdir)/l10n -name '*.*') $(srcdir)/util/create-l10n-all-js.pl
for F in $(wildcard $(srcdir)/po/ui-*.po); do \
$(srcdir)/util/po2json.py $$F -o $$F.json; \
done
@@ -34,7 +32,7 @@ LOLEAFLET_IMAGES_CUSTOM_SRC = $(shell find 
$(CUSTOM_ICONS_DIRECTORY) -name '*.*'
 LOLEAFLET_IMAGES_CUSTOM_DST = $(patsubst 
$(CUSTOM_ICONS_DIRECTORY)/%,$(builddir)/dist/images/%,$(LOLEAFLET_IMAGES_CUSTOM_SRC))
 
 LOLEAFLET_L10N_SRC = $(shell find $(srcdir)/l10n -name '*.*')
-if !ENABLE_IOSAPP
+if !ENABLE_MOBILEAPP
 LOLEAFLET_L10N_DST =  $(patsubst 
$(srcdir)/l10n/%,$(builddir)/dist/l10n/%,$(LOLEAFLET_L10N_SRC))
 endif
 
diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index bb751a76b..b582afd16 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -83,7 +83,7 @@
 
global._ = function (string) {
// In the mobile app case we can't use the stuff from 
l10n-for-node, as that assumes HTTP.
-   if (window.ThisIsTheiOSApp) {
+   if (window.ThisIsAMobileApp) {
// We use another approach just for iOS for now.
if (window.LOCALIZATIONS.hasOwnProperty(string)) {
// window.postMobileDebug('_(' + string + '): 
YES: ' + window.LOCALIZATIONS[string]);
@@ -96,9 +96,6 @@
// window.postMobileDebug('_(' + string + '): 
NO');
return string;
}
-   } else if (window.ThisIsAMobileApp) {
-   // And bail out without translations on other mobile 
platforms.
-   return string;
} else {
return string.toLocaleString();
}
@@ -138,7 +135,7 @@
 
var lang = global.getParameterByName('lang');
global.queueMsg = [];
-   if (window.ThisIsTheiOSApp)
+   if (window.ThisIsAMobileApp)
window.LANG = lang;
if (global.socket && global.socket.readyState !== 3) {
global.socket.onopen = function () {
@@ -149,7 +146,7 @@
 
global.socket.send('loolclient ' + 
ProtocolVersionNumber);
 
-   if (window.ThisIsTheiOSApp) {
+   if (window.ThisIsAMobileApp) {
msg += ' lang=' + window.LANG;
} else {
 
diff --git 

[Libreoffice-commits] online.git: android/lib

2019-12-10 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |8 
++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 0b90f8cece43e0e209c96750817211b5986fd45d
Author: Jan Holesovsky 
AuthorDate: Tue Dec 10 22:55:36 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Dec 10 23:05:12 2019 +0100

android: Fix crash when starting a slideshow.

Change-Id: Iff5e4feaf4d1c496713a6401f6f03a17ae326ec5
Reviewed-on: https://gerrit.libreoffice.org/84905
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 66dc87497..a9cca125c 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -632,15 +632,11 @@ public class LOActivity extends AppCompatActivity {
 .setView(R.layout.lolib_dialog_loading)
 .create();
 
+slideShowProgress.show();
+
 nativeHandler.post(new Runnable() {
 @Override
 public void run() {
-LOActivity.this.runOnUiThread(new Runnable() {
-@Override
-public void run() {
-slideShowProgress.show();
-}
-});
 Log.v(TAG, "saving svg for slideshow by " + 
Thread.currentThread().getName());
 final String slideShowFileUri = new 
File(LOActivity.this.getCacheDir(), "slideShow.svg").toURI().toString();
 LOActivity.this.saveAs(slideShowFileUri, "svg");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib loleaflet/src

2019-12-10 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   80 
+-
 loleaflet/src/control/Control.Toolbar.js |7 
 2 files changed, 51 insertions(+), 36 deletions(-)

New commits:
commit c6f36965cfc1bd68fdb88b01d493163b5d176bcc
Author: Jan Holesovsky 
AuthorDate: Sat Aug 10 00:21:50 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Tue Dec 10 17:10:29 2019 +0100

android: Framework to be able to broadcast to another activity.

Change-Id: I24634c5e06223bd1c5cdb8da511159b03ce35719
Reviewed-on: https://gerrit.libreoffice.org/84871
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index dbb58d0b0..3fe1c317f 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -528,7 +528,8 @@ public class LOActivity extends AppCompatActivity {
  * return true to pass the message to the native part or false to block 
the message
  */
 boolean interceptMsgFromWebView(String message) {
-switch (message) {
+String[] messageAndParam = message.split(" ", 2); // the command and 
the rest (that can potentially contain spaces too)
+switch (messageAndParam[0]) {
 case "PRINT":
 mainHandler.post(new Runnable() {
 @Override
@@ -540,47 +541,53 @@ public class LOActivity extends AppCompatActivity {
 case "SLIDESHOW":
 initiateSlideShow();
 return false;
-case "uno .uno:Paste":
-clipData = clipboardManager.getPrimaryClip();
-if (clipData != null) {
-if 
(clipData.getDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
-final ClipData.Item clipItem = clipData.getItemAt(0);
+case "SAVE":
+sendBroadcast(messageAndParam[0], messageAndParam[1]);
+return false;
+case "uno":
+switch (messageAndParam[1]) {
+case ".uno:Paste":
+clipData = clipboardManager.getPrimaryClip();
+if (clipData != null) {
+if 
(clipData.getDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
+final ClipData.Item clipItem = 
clipData.getItemAt(0);
+nativeHandler.post(new Runnable() {
+@Override
+public void run() {
+
LOActivity.this.paste("text/plain;charset=utf-16", 
clipItem.getText().toString());
+}
+});
+}
+return false;
+}
+break;
+case ".uno:Copy": {
 nativeHandler.post(new Runnable() {
 @Override
 public void run() {
-
LOActivity.this.paste("text/plain;charset=utf-16", 
clipItem.getText().toString());
+String tempSelectedText = 
LOActivity.this.getTextSelection();
+if (!tempSelectedText.equals("")) {
+clipData = 
ClipData.newPlainText(ClipDescription.MIMETYPE_TEXT_PLAIN, tempSelectedText);
+clipboardManager.setPrimaryClip(clipData);
+}
 }
 });
+break;
 }
-return false;
-}
-break;
-case "uno .uno:Copy": {
-nativeHandler.post(new Runnable() {
-@Override
-public void run() {
-String tempSelectedText = 
LOActivity.this.getTextSelection();
-if (!tempSelectedText.equals("")) {
-clipData = 
ClipData.newPlainText(ClipDescription.MIMETYPE_TEXT_PLAIN, tempSelectedText);
-clipboardManager.setPrimaryClip(clipData);
-}
-}
-});
-break;
-}
-case "uno .uno:Cut": {
-nativeHandler.post(new Runnable() {
-@Override
-public void run() {
-String tempSelectedText = 
LOActivity.this.getTextSelection();
-if (!tempSelectedText.equals("")) {
-clipData = 

[Libreoffice-commits] online.git: android/lib

2019-12-03 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle  |2 +-
 android/lib/libSettings.gradle.in |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5f9e088fe614491975357dd385404f6013badb00
Author: Jan Holesovsky 
AuthorDate: Tue Dec 3 10:39:51 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Dec 3 14:33:20 2019 +0100

android: Replace the value in fonts with real name instead of 'null'.

Change-Id: Iefb5737662eb5463429951c815e5bb0891abd875
Reviewed-on: https://gerrit.libreoffice.org/84313
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index dcce0172e..631524dce 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -93,7 +93,7 @@ task copyUnpackAssets(type: Copy) {
 filter {
 String line ->
 line.replaceAll(
-'@@APPLICATION_ID@@', new 
String("${android.defaultConfig.applicationId}")
+'@@APPLICATION_ID@@', new String("${liboApplicationId}")
 ).replaceAll(
 // FIXME Avoid the Android system fonts for the moment,
 // the huge Noto Sans fonts have terrible impact on the 1st
diff --git a/android/lib/libSettings.gradle.in 
b/android/lib/libSettings.gradle.in
index 3736a35fe..bd40967c3 100644
--- a/android/lib/libSettings.gradle.in
+++ b/android/lib/libSettings.gradle.in
@@ -8,4 +8,5 @@ ext {
 liboVersionMajor= '@LOOLWSD_VERSION_MAJOR@'
 liboVersionMinor= '@LOOLWSD_VERSION_MAJOR@'
 liboGitFullCommit   = '@LOOLWSD_VERSION_HASH@'
+liboApplicationId   = '@ANDROID_PACKAGE_NAME@'
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: android/lib

2019-10-29 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |2 ++
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |6 
+++---
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 983feb78c83c87eca0343235baacb5fbb1f8
Author: Jan Holesovsky 
AuthorDate: Tue Oct 29 20:37:50 2019 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Oct 29 20:51:08 2019 +0100

android: Copy stuff from assets/unpack with every git commit change.

I've just spent many hours debugging why a type is not known to the
cppuhelper and is throwing a "cannot get type description for type ...".
It turned out it was just a stale .rdb on the device that avoided being
updated.

So this change will help developers (much lower risk of stale rdb
files), while not a problem for the releases (each version bump has to
update the rdb's anyway).

Change-Id: Ie73245cfc78da8faf97f08ef52e6358a8e71218d
Reviewed-on: https://gerrit.libreoffice.org/81707
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 0120a2416..dcce0172e 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -20,6 +20,7 @@ android {
 
 buildTypes {
 debug {
+buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
 ndk {
 //abiFilters "x86", "armeabi-v7a", "armeabi"
 abiFilters "armeabi-v7a"
@@ -27,6 +28,7 @@ android {
 debuggable true
 }
 release {
+buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
 ndk {
 abiFilters "armeabi-v7a"
 }
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 95c7c040f..dbb58d0b0 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -64,7 +64,7 @@ import androidx.core.content.ContextCompat;
 public class LOActivity extends AppCompatActivity {
 final static String TAG = "LOActivity";
 
-private static final String ASSETS_EXTRACTED_PREFS_KEY = 
"ASSETS_EXTRACTED";
+private static final String ASSETS_EXTRACTED_GIT_COMMIT = 
"ASSETS_EXTRACTED_GIT_COMMIT";
 private static final int PERMISSION_WRITE_EXTERNAL_STORAGE = 777;
 private static final String KEY_ENABLE_SHOW_DEBUG_INFO = 
"ENABLE_SHOW_DEBUG_INFO";
 
@@ -204,10 +204,10 @@ public class LOActivity extends AppCompatActivity {
 }
 
 private void updatePreferences() {
-if (sPrefs.getInt(ASSETS_EXTRACTED_PREFS_KEY, 0) != 
BuildConfig.VERSION_CODE) {
+if (!sPrefs.getString(ASSETS_EXTRACTED_GIT_COMMIT, 
"").equals(BuildConfig.GIT_COMMIT)) {
 if (copyFromAssets(getAssets(), "unpack", 
getApplicationInfo().dataDir) &&
 copyFonts("/system/fonts", getApplicationInfo().dataDir + 
"/user/fonts")) {
-sPrefs.edit().putInt(ASSETS_EXTRACTED_PREFS_KEY, 
BuildConfig.VERSION_CODE).apply();
+sPrefs.edit().putString(ASSETS_EXTRACTED_GIT_COMMIT, 
BuildConfig.GIT_COMMIT).apply();
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: android/lib

2019-10-25 Thread Jan Holesovsky (via logerrit)
 android/lib/build.gradle |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 473e52d27bcca36a0ec46d558406c19cfef7a4c5
Author: Jan Holesovsky 
AuthorDate: Fri Oct 25 13:45:10 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Fri Oct 25 14:31:26 2019 +0200

android: Fix a linking problem.

This is needed after core.git's
f68a36b62ed327eb67efdfea0ac46645b4d90877, without it the native code
crashes:

E/AndroidRuntime: FATAL EXCEPTION: main

Process: com.collabora.libreoffice.debug, PID: 25358
java.lang.UnsatisfiedLinkError: dlopen failed: library 
"libc++_shared.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at 
org.libreoffice.androidlib.LOActivity.(LOActivity.java:467)
at java.lang.Class.newInstance(Native Method)
at 
android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
...

Change-Id: If0d0f3ade3d2a5a8692dcc3d79edbfb51cd7e2ed
Reviewed-on: https://gerrit.libreoffice.org/81499
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index f208d302b..0120a2416 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -11,6 +11,11 @@ android {
 targetSdkVersion 28
 versionCode 1
 versionName "1.0"
+externalNativeBuild {
+cmake {
+arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_STL=c++_shared"
+}
+}
 }
 
 buildTypes {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: android/lib loleaflet/src

2019-09-06 Thread kaishu-sahu (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   30 
--
 loleaflet/src/map/Map.js |8 ++
 2 files changed, 33 insertions(+), 5 deletions(-)

New commits:
commit 0f9492268e8684b16e9c3d92be26eeb814fcf7a3
Author: kaishu-sahu 
AuthorDate: Sun Jul 28 05:13:26 2019 +0530
Commit: Jan Holesovsky 
CommitDate: Fri Sep 6 11:23:29 2019 +0200

android: add support for screen dimming from JS.

Change-Id: Icd766c7dcc9c2d62ec90945ec88fa46f88a4711d
Reviewed-on: https://gerrit.libreoffice.org/76489
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 2258a78a2..95c7c040f 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -32,6 +32,7 @@ import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
 import android.util.Log;
+import android.view.WindowManager;
 import android.webkit.JavascriptInterface;
 import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
@@ -154,9 +155,10 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
-/** Copies fonts except the NotoSans from the system to our location.
- *  This is necessary because the NotoSans is huge and fontconfig needs
- *  ages to parse them.
+/**
+ * Copies fonts except the NotoSans from the system to our location.
+ * This is necessary because the NotoSans is huge and fontconfig needs
+ * ages to parse them.
  */
 private static boolean copyFonts(String fromPath, String targetDir) {
 try {
@@ -171,8 +173,7 @@ public class LOActivity extends AppCompatActivity {
 if (!fontFileName.equals("Roboto-Regular.ttf")) {
 Log.i(TAG, "Ignored font file: " + fontFile);
 continue;
-}
-else {
+} else {
 Log.i(TAG, "Copying font file: " + fontFile);
 }
 
@@ -214,6 +215,7 @@ public class LOActivity extends AppCompatActivity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
+getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
 sPrefs = 
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
 updatePreferences();
 
@@ -579,6 +581,24 @@ public class LOActivity extends AppCompatActivity {
 });
 break;
 }
+case "DIM_SCREEN": {
+mainHandler.post(new Runnable() {
+@Override
+public void run() {
+
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+}
+});
+return false;
+}
+case "LIGHT_SCREEN": {
+mainHandler.post(new Runnable() {
+@Override
+public void run() {
+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+}
+});
+return false;
+}
 }
 return true;
 }
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 118e74833..d5db0a0dd 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1162,6 +1162,11 @@ L.Map = L.Evented.extend({
this._active = false;
clearTimeout(vex.timer);
 
+   if (window.ThisIsTheAndroidApp) {
+   window.postMobileMessage('DIM_SCREEN');
+   return;
+   }
+
var message = '';
var map = this;
if (!map['wopi'].DisableInactiveMessages) {
@@ -1189,6 +1194,9 @@ L.Map = L.Evented.extend({
 
notifyActive : function() {
this.lastActiveTime = Date.now();
+   if (window.ThisIsTheAndroidApp) {
+   window.postMobileMessage('LIGHT_SCREEN');
+   }
},
 
_dimIfInactive: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: android/lib

2019-07-23 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |   31 
+-
 1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit 68b33ba7f28dff5d5a315638dad91b2ecc303caf
Author: Jan Holesovsky 
AuthorDate: Tue Jul 23 14:17:34 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Tue Jul 23 14:20:25 2019 +0200

android: Load the document only after we've got the permission.

Without this, the first start was failing, there was only a black screen
and the request for permission.

Change-Id: I7929048ca51b044dcb574f48bd2b7bc9a27e0ec8

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index ce1243348..2258a78a2 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -86,6 +86,7 @@ public class LOActivity extends AppCompatActivity {
 
 private boolean isDocEditable = false;
 private boolean isDocDebuggable = BuildConfig.DEBUG;
+private boolean documentLoaded = false;
 
 private ClipboardManager clipboardManager;
 private ClipData clipData;
@@ -218,19 +219,8 @@ public class LOActivity extends AppCompatActivity {
 
 setContentView(R.layout.lolib_activity_main);
 
-AssetManager assetManager = getResources().getAssets();
-
 isDocDebuggable = sPrefs.getBoolean(KEY_ENABLE_SHOW_DEBUG_INFO, false) 
&& BuildConfig.DEBUG;
 
-ApplicationInfo applicationInfo = getApplicationInfo();
-String dataDir = applicationInfo.dataDir;
-Log.i(TAG, String.format("Initializing LibreOfficeKit, dataDir=%s\n", 
dataDir));
-
-//redirectStdio(true);
-
-String cacheDir = getApplication().getCacheDir().getAbsolutePath();
-String apkFile = getApplication().getPackageResourcePath();
-
 if (getIntent().getData() != null) {
 
 if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
@@ -274,8 +264,6 @@ public class LOActivity extends AppCompatActivity {
 finish();
 }
 
-createLOOLWSD(dataDir, cacheDir, apkFile, assetManager, urlToLoad);
-
 mWebView = findViewById(R.id.browser);
 
 WebSettings webSettings = mWebView.getSettings();
@@ -421,7 +409,8 @@ public class LOActivity extends AppCompatActivity {
 Log.d(TAG, "onPause() - hinting to save, we might need to return to 
the doc");
 
 // A Save similar to an autosave
-postMobileMessageNative("save dontTerminateEdit=true 
dontSaveIfUnmodified=true");
+if (documentLoaded)
+postMobileMessageNative("save dontTerminateEdit=true 
dontSaveIfUnmodified=true");
 }
 
 @Override
@@ -445,6 +434,18 @@ public class LOActivity extends AppCompatActivity {
 }
 
 private void loadDocument() {
+// setup the LOOLWSD
+ApplicationInfo applicationInfo = getApplicationInfo();
+String dataDir = applicationInfo.dataDir;
+Log.i(TAG, String.format("Initializing LibreOfficeKit, dataDir=%s\n", 
dataDir));
+
+String cacheDir = getApplication().getCacheDir().getAbsolutePath();
+String apkFile = getApplication().getPackageResourcePath();
+AssetManager assetManager = getResources().getAssets();
+
+createLOOLWSD(dataDir, cacheDir, apkFile, assetManager, urlToLoad);
+
+// trigger the load of the document
 String finalUrlToLoad = 
"file:///android_asset/dist/loleaflet.html?file_path=" +
 urlToLoad + "=1";
 if (isDocEditable) {
@@ -456,6 +457,8 @@ public class LOActivity extends AppCompatActivity {
 finalUrlToLoad += "=true";
 }
 mWebView.loadUrl(finalUrlToLoad);
+
+documentLoaded = true;
 }
 
 static {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: android/lib loleaflet/src

2019-07-22 Thread kaishu-sahu (via logerrit)
 android/lib/src/main/cpp/androidapp.cpp  |   21 +
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |  130 
+++---
 loleaflet/src/control/Control.ContextToolbar.js  |6 
 3 files changed, 123 insertions(+), 34 deletions(-)

New commits:
commit 73f839164a3a2bd0dbec31aaff8c2fcbb7f331b3
Author: kaishu-sahu 
AuthorDate: Mon Jun 17 06:00:00 2019 +0530
Commit: Jan Holesovsky 
CommitDate: Mon Jul 22 12:03:09 2019 +0200

android: add cut, copy, paste support to document viewer.

Change-Id: I85c3a602ab7e98272a193c392bf7bcfd1050dc90
Reviewed-on: https://gerrit.libreoffice.org/74127
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/android/lib/src/main/cpp/androidapp.cpp 
b/android/lib/src/main/cpp/androidapp.cpp
index f15ebc6a6..5f89ffcc4 100644
--- a/android/lib/src/main/cpp/androidapp.cpp
+++ b/android/lib/src/main/cpp/androidapp.cpp
@@ -332,4 +332,25 @@ Java_org_libreoffice_androidlib_LOActivity_saveAs(JNIEnv 
*env, jobject instance,
 env->ReleaseStringUTFChars(fileUri_, fileUri);
 env->ReleaseStringUTFChars(format_, format);
 }
+
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_org_libreoffice_androidlib_LOActivity_getTextSelection(JNIEnv *env, 
jobject instance) {
+
+return 
env->NewStringUTF(getLOKDocument()->getTextSelection("text/plain;charset=utf-8"));
+}
+
+extern "C"
+JNIEXPORT void JNICALL
+Java_org_libreoffice_androidlib_LOActivity_paste(JNIEnv *env, jobject 
instance, jstring mimeType_,
+   jstring data_) {
+const char *mimeType = env->GetStringUTFChars(mimeType_, 0);
+const char *data = env->GetStringUTFChars(data_, 0);
+const size_t nSize = env->GetStringLength(data_);
+
+getLOKDocument()->paste(mimeType, data, nSize);
+
+env->ReleaseStringUTFChars(mimeType_, mimeType);
+env->ReleaseStringUTFChars(data_, data);
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 7bd40af27..3d6838a12 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -10,6 +10,9 @@
 package org.libreoffice.androidlib;
 
 import android.Manifest;
+import android.content.ClipData;
+import android.content.ClipDescription;
+import android.content.ClipboardManager;
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
 import android.content.Intent;
@@ -23,6 +26,7 @@ import android.os.AsyncTask;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.Looper;
 import android.preference.PreferenceManager;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
@@ -83,6 +87,12 @@ public class LOActivity extends AppCompatActivity {
 private boolean isDocEditable = false;
 private boolean isDocDebuggable = BuildConfig.DEBUG;
 
+private ClipboardManager clipboardManager;
+private ClipData clipData;
+private Thread nativeMsgThread;
+private Handler nativeHandler;
+private Looper nativeLooper;
+
 private ValueCallback valueCallback;
 public static final int REQUEST_SELECT_FILE = 555;
 
@@ -282,6 +292,18 @@ public class LOActivity extends AppCompatActivity {
 
 mainHandler = new Handler(getMainLooper());
 
+clipboardManager = (ClipboardManager) 
getSystemService(CLIPBOARD_SERVICE);
+nativeMsgThread = new Thread(new Runnable() {
+@Override
+public void run() {
+Looper.prepare();
+nativeLooper = Looper.myLooper();
+nativeHandler = new Handler(nativeLooper);
+Looper.loop();
+}
+});
+nativeMsgThread.start();
+
 mWebView.setWebChromeClient(new WebChromeClient() {
 @Override
 public boolean onShowFileChooser(WebView mWebView, 
ValueCallback filePathCallback, WebChromeClient.FileChooserParams 
fileChooserParams) {
@@ -406,6 +428,7 @@ public class LOActivity extends AppCompatActivity {
 protected void onDestroy() {
 super.onDestroy();
 Log.i(TAG, "onDestroy() - we know we are leaving the document");
+nativeLooper.quit();
 postMobileMessageNative("BYE");
 }
 
@@ -497,20 +520,62 @@ public class LOActivity extends AppCompatActivity {
 }
 
 /**
- * return true to pass the message to the native part and false to block 
the message
+ * return true to pass the message to the native part or false to block 
the message
  */
 boolean interceptMsgFromWebView(String message) {
-if (message.equals("PRINT")) {
-mainHandler.post(new Runnable() {
-

[Libreoffice-commits] online.git: android/lib

2019-07-15 Thread Jan Holesovsky (via logerrit)
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java|  
  4 ++--
 android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java |  
  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fd4d896a7fc5a2d8d38632840295e224288f215a
Author: Jan Holesovsky 
AuthorDate: Mon Jul 15 13:57:18 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Mon Jul 15 19:41:44 2019 +0200

android: Rename the .xml files to avoid potential conflicts.

Change-Id: I6209309c038f16aff150494adf14953aa6f31541

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 861c114c4..98ac6f1ce 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -201,7 +201,7 @@ public class LOActivity extends AppCompatActivity {
 sPrefs = 
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
 updatePreferences();
 
-setContentView(R.layout.activity_main);
+setContentView(R.layout.lolib_activity_main);
 
 AssetManager assetManager = getResources().getAssets();
 
@@ -480,7 +480,7 @@ public class LOActivity extends AppCompatActivity {
 private void initiateSlideShow() {
 final AlertDialog slideShowProgress = new AlertDialog.Builder(this)
 .setCancelable(false)
-.setView(R.layout.dialog_loading)
+.setView(R.layout.lolib_dialog_loading)
 .create();
 new AsyncTask() {
 @Override
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java
index 3a957b154..21b9f 100644
--- 
a/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java
+++ 
b/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java
@@ -31,7 +31,7 @@ public class SlideShowActivity extends AppCompatActivity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
-setContentView(R.layout.activity_slide_show);
+setContentView(R.layout.lolib_activity_slide_show);
 slideShowWebView = findViewById(R.id.slide_show_webView);
 if (savedInstanceState == null) {
 slidesSvgUri = getIntent().getStringExtra(SVG_URI_KEY);
diff --git a/android/lib/src/main/res/layout/activity_main.xml 
b/android/lib/src/main/res/layout/lolib_activity_main.xml
similarity index 100%
rename from android/lib/src/main/res/layout/activity_main.xml
rename to android/lib/src/main/res/layout/lolib_activity_main.xml
diff --git a/android/lib/src/main/res/layout/activity_slide_show.xml 
b/android/lib/src/main/res/layout/lolib_activity_slide_show.xml
similarity index 100%
rename from android/lib/src/main/res/layout/activity_slide_show.xml
rename to android/lib/src/main/res/layout/lolib_activity_slide_show.xml
diff --git a/android/lib/src/main/res/layout/dialog_loading.xml 
b/android/lib/src/main/res/layout/lolib_dialog_loading.xml
similarity index 100%
rename from android/lib/src/main/res/layout/dialog_loading.xml
rename to android/lib/src/main/res/layout/lolib_dialog_loading.xml
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits