Skip to content

Commit

Permalink
Editor: Restore behaviour - don't overwrite newer files unless conten…
Browse files Browse the repository at this point in the history
…t modified, by @harshad1 (PR gsantner#1758)
  • Loading branch information
gsantner authored and jiesou committed Jul 20, 2022
1 parent 56c9e5a commit 8dae07d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,9 @@ public boolean checkPermissions() {
// Only supports java.io.File. TODO: Android Content
public boolean saveDocument(final boolean forceSaveEmpty) {
// Document is written iff writeable && content has changed
if (checkPermissions() && _hlEditor != null && isAdded()) {
if (_document.saveContent(getContext(), _hlEditor.getText(), _shareUtil, forceSaveEmpty)) {
final CharSequence text = _hlEditor.getText();
if (!_document.isContentSame(text) && checkPermissions() && _hlEditor != null && isAdded()) {
if (_document.saveContent(getContext(), text, _shareUtil, forceSaveEmpty)) {
checkTextChangeState();
return true;
} else {
Expand Down

0 comments on commit 8dae07d

Please sign in to comment.