android/source/src/java/org/libreoffice/LOKitTileProvider.java |   10 +-------
 external/libmspub/UnpackedTarball_libmspub.mk                  |    6 +++++
 external/libmspub/libmspub_android_arm.patch.1                 |   12 
++++++++++
 3 files changed, 20 insertions(+), 8 deletions(-)

New commits:
commit d2e547c82dd23eabfec7a828c5b9fed16313b1c4
Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
Date:   Sat Apr 7 19:28:17 2018 +0200

    libmspub: fix build for android-arm with debug enabled
    
    Change-Id: I2fff80f2e4a0bd1946c9b49d46871245f93bbb3e

diff --git a/external/libmspub/UnpackedTarball_libmspub.mk 
b/external/libmspub/UnpackedTarball_libmspub.mk
index 5ea3053d6f69..5e5bedb27d83 100644
--- a/external/libmspub/UnpackedTarball_libmspub.mk
+++ b/external/libmspub/UnpackedTarball_libmspub.mk
@@ -19,6 +19,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,libmspub,\
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libmspub))
 
+ifeq ($(ANDROID_APP_ABI),armeabi-v7a)
+$(eval $(call gb_UnpackedTarball_add_patches,libmspub, \
+    external/libmspub/libmspub_android_arm.patch.1 \
+))
+endif
+
 ifeq ($(COM_IS_CLANG),TRUE)
 ifneq ($(filter -fsanitize=%,$(CC)),)
 $(eval $(call gb_UnpackedTarball_add_patches,libmspub, \
diff --git a/external/libmspub/libmspub_android_arm.patch.1 
b/external/libmspub/libmspub_android_arm.patch.1
new file mode 100644
index 000000000000..2d7d0e12c02a
--- /dev/null
+++ b/external/libmspub/libmspub_android_arm.patch.1
@@ -0,0 +1,12 @@
+diff -ur libmspub.org/src/lib/libmspub_utils.cpp 
libmspub/src/lib/libmspub_utils.cpp
+--- libmspub.org/src/lib/libmspub_utils.cpp    2018-04-07 15:13:32.041792236 
+0200
++++ libmspub/src/lib/libmspub_utils.cpp        2018-04-07 15:14:08.547790739 
+0200
+@@ -29,7 +29,7 @@
+ {
+   va_list args;
+   va_start(args, format);
+-  std::vfprintf(stderr, format, args);
++  vfprintf(stderr, format, args);
+   va_end(args);
+ }
+ 
commit f0cc14ae68df223392685ca7b70fe4e176618b86
Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
Date:   Sat Apr 7 19:27:07 2018 +0200

    tdf#116152 android.net.Uri.encode(string) is even better...
    
    Change-Id: Ib779cec33de660e2c01843b76c9987aa774fba29

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 6aa994a4e8ae..a96f6092363c 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -24,8 +24,6 @@ import org.mozilla.gecko.gfx.CairoImage;
 import org.mozilla.gecko.gfx.IntSize;
 
 import java.io.File;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
 import java.nio.ByteBuffer;
 
 /**
@@ -71,12 +69,8 @@ class LOKitTileProvider implements TileProvider {
 
         Log.i(LOGTAG, "====> Loading file '" + input + "'");
         File fileToBeEncoded = new File(input);
-        String encodedFileName = "";
-        try {
-            encodedFileName = 
URLEncoder.encode(fileToBeEncoded.getName(),"UTF-8").replaceAll("\\+", "%20");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
+        String encodedFileName = 
android.net.Uri.encode(fileToBeEncoded.getName());
+
         mDocument = mOffice.documentLoad(
                 (new 
File(fileToBeEncoded.getParent(),encodedFileName)).getPath()
         );
commit 7e4d505f5f0ef4d7cc156f68dcf3af0d54a45fdf
Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
Date:   Sat Apr 7 18:43:16 2018 +0200

    tdf#116152 fix filenames with spaces (code expects %20, not +)
    
    URL-encoding added by 174229e4797b27eb795c6f2451ab1349c2c29ad8
    did fix filenames with #, but broke filenames with space in return.
    
    Change-Id: I7f1ac6aa79c921dfca699eb3cd8c927efba9d55c

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 0f1e9f9e444e..6aa994a4e8ae 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -73,7 +73,7 @@ class LOKitTileProvider implements TileProvider {
         File fileToBeEncoded = new File(input);
         String encodedFileName = "";
         try {
-            encodedFileName = 
URLEncoder.encode(fileToBeEncoded.getName(),"UTF-8");
+            encodedFileName = 
URLEncoder.encode(fileToBeEncoded.getName(),"UTF-8").replaceAll("\\+", "%20");
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to