Skip to content

Commit 0521ee6

Browse files
#15, EXM-47487: Check if update is allowed before to start the process.
1 parent 0aa96e7 commit 0521ee6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/main/java/com/oxygenxml/prolog/updater/DitaPrologUpdater.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void updateProlog(final WSEditor wsEditor, final boolean isNewDocument) {
5151
WSEditorPage currentPage = wsEditor.getCurrentPage();
5252

5353
// create a PrologContentCreator
54-
PrologContentCreator prologContentCreater = new PrologContentCreator(getAuthorName(), getDateFormat(), getMaxNoOfRevisedElements());
54+
final PrologContentCreator prologContentCreater = new PrologContentCreator(getAuthorName(), getDateFormat(), getMaxNoOfRevisedElements());
5555

5656
final DitaEditor[] ditaEditor = new DitaEditor[1];
5757
if (currentPage instanceof WSAuthorEditorPage) {
@@ -73,14 +73,12 @@ public void updateProlog(final WSEditor wsEditor, final boolean isNewDocument) {
7373
// Update prolog.
7474
AWTUtil.invokeSynchronously(new Runnable() {
7575
public void run() {
76-
if (ditaEditor[0] != null) {
77-
if(prologContentCreater.isAllowedUpdate(ditaEditor[0].getDocumentType())) {
78-
boolean wasUpdated = ditaEditor[0].updateProlog(isNewDocument);
79-
if (!wasUpdated) {
80-
showWarnMessage(wsEditor);
81-
}
82-
}
83-
}
76+
if(ditaEditor[0] != null && prologContentCreater.isAllowedUpdate(ditaEditor[0].getDocumentType())) {
77+
boolean wasUpdated = ditaEditor[0].updateProlog(isNewDocument);
78+
if (!wasUpdated) {
79+
showWarnMessage(wsEditor);
80+
}
81+
}
8482
}
8583
});
8684
}

0 commit comments

Comments
 (0)