diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2021-03-31 15:04:36 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2021-03-31 20:09:43 +0200 |
commit | 441342654e5b4c61317b9a596396a1d817dd8547 (patch) | |
tree | 224c068f06559e379e4a38707cc4c7717775bf93 /android | |
parent | 51f6e11aee50cc429021be27bd33875593425683 (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>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 4 |
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; } |