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

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 16 18:40:49 UTC 2020


 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 <kendy at collabora.com>
AuthorDate: Mon Mar 16 17:38:23 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
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 <michael.meeks at collabora.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

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;


More information about the Libreoffice-commits mailing list