tdf#158331 android: Fix "Save As" for non-experimental mode
While "Save" (i.e. saving back to the original location)
doesn't make sense when editing is disabled (because the
doc cannot be changed) and the menu entry is therefore
not available when the experimental editing mode is
disabled, "Save As" does make sense, e.g. in order to
save a copy of a file opened from another app.
The menu entry was there, but not working as expected,
a 0-byte file was created.
This is because `LibreOfficeMainActivity#saveFileToOriginalSource`
would return early if experimental mode is disabled.
No longer do that, but save the file as requested.
Change-Id: I5785b6060c4ba9cdf3e9c3591b9f941ab987bf4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159857
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 5b1538d92e947f3afd1b4815c9c4f4d7565278dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159765
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 54418f5..b21ad02 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -416,7 +416,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
}
public void saveFileToOriginalSource() {
if (isReadOnlyMode() || mTempFile == null || mDocumentUri == null || !mDocumentUri.getScheme().equals(ContentResolver.SCHEME_CONTENT))
if (mTempFile == null || mDocumentUri == null || !mDocumentUri.getScheme().equals(ContentResolver.SCHEME_CONTENT))
return;
boolean copyOK = false;