summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2021-03-31 15:04:36 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2021-04-01 07:18:38 +0200
commit2d2e8414cbc0e52359d9b0440f06d4c99135a227 (patch)
treeaed07c52bd5e3801f98d361a2e70c44bc0e89d3b
parentf6d174c66025ad21829aa3e7f65a75ce6fa0074d (diff)
android: Don't mark doc changed on keypress in readonly mode
Since input etc. is otherwise ignored in readonly mode, also don't mark the document as changed on keypress. This e.g. avoids an unnecessary dialog whether or not to save the document after opening a document with experimental editing mode disabled, then pressing a key (on hardware keyboard, soft keyboard isn't shown in readonly mode) and then pressing the "Back" button to close the document again. Change-Id: I095c79549719d3760666605e1c642c58e6b1bb9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113417 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 441342654e5b4c61317b9a596396a1d817dd8547)
-rw-r--r--android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 960e3374a97a..cfdc81000f51 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -168,8 +168,8 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
layerView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
- if(keyEvent.getKeyCode() != KeyEvent.KEYCODE_BACK){
- isDocumentChanged=true;
+ if(!isReadOnlyMode() && keyEvent.getKeyCode() != KeyEvent.KEYCODE_BACK){
+ setDocumentChanged(true);
}
return false;
}