summaryrefslogtreecommitdiff
path: root/android
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:19:50 +0200
commitbcb74b50920a44729ba2c88db98738a61d8d9920 (patch)
treef76f601445e8c90e7d1c997d0470baeb88ef7a7a /android
parent224df2980f0626b1e0b7f40c14348771ffff58fe (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>
Diffstat (limited to 'android')
-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));