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 #1758)
  • Loading branch information
gsantner committed Jul 12, 2022
1 parent bec5e6b commit 4ed4132
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 4ed4132

Please sign in to comment.