diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-04-07 19:27:07 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-04-07 19:36:43 +0200 |
commit | f0cc14ae68df223392685ca7b70fe4e176618b86 (patch) | |
tree | 590b0a9c987f6c2f62afd1157f4947e97e1450de /android | |
parent | 7e4d505f5f0ef4d7cc156f68dcf3af0d54a45fdf (diff) |
tdf#116152 android.net.Uri.encode(string) is even better...
Change-Id: Ib779cec33de660e2c01843b76c9987aa774fba29
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/LOKitTileProvider.java | 10 |
1 files changed, 2 insertions, 8 deletions
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() ); |