summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-04-09 10:03:06 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2021-04-12 07:33:11 +0200
commitb80deaefedfc9ac4fcaa14a8d350ebaa14d78a87 (patch)
treedac0d3694d79bd5b28210ca6980537e904cbcdd2
parent08b94cc0cb0b1681d432745fabdbbc4c7d136979 (diff)
android: Drop fallback of opening default doc
Drop the fallback of opening 'example.odt' when no file to open was given. I see no valid way how that fallback should be reached, so write an error log message instead, just in case there is still a way to get there. Change-Id: I8b8040ba0099cba9196f65982f09c67791be01c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113880 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit bcb74b50920a44729ba2c88db98738a61d8d9920)
-rw-r--r--android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 2f067b48f90b..022965e65052 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -60,7 +60,6 @@ import java.util.UUID;
public class LibreOfficeMainActivity extends AppCompatActivity implements SettingsListenerModel.OnSettingsPreferenceChangedListener {
private static final String LOGTAG = "LibreOfficeMainActivity";
- private static final String DEFAULT_DOC_PATH = "/assets/example.odt";
private static final String ENABLE_EXPERIMENTAL_PREFS_KEY = "ENABLE_EXPERIMENTAL";
private static final String ASSETS_EXTRACTED_PREFS_KEY = "ASSETS_EXTRACTED";
private static final String ENABLE_DEVELOPER_PREFS_KEY = "ENABLE_DEVELOPER";
@@ -211,9 +210,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
toolbarTop.setTitle(mInputFile.getName());
}
} else {
- mInputFile = new File(DEFAULT_DOC_PATH);
- mDocumentUri = Uri.fromFile(mInputFile);
- mbISReadOnlyMode = true;
+ Log.e(LOGTAG, "No document specified. This should never happen.");
+ return;
}
mDrawerLayout = findViewById(R.id.drawer_layout);
@@ -356,10 +354,6 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
* Save the document.
*/
public void saveDocument() {
- if (!mInputFile.exists()) {
- // Needed for handling null in case new document is not created.
- mInputFile = new File(DEFAULT_DOC_PATH);
- }
Toast.makeText(this, R.string.message_saving, Toast.LENGTH_SHORT).show();
// local save
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND_NOTIFY, ".uno:Save", true));