- SELECT_m - Selector block
- NEGTOPOS_f - Threshold negative to positive
+* Bug #6733 fixed - Each call to xcos created an empty diagram.
+
* Bug #8744 fixed - Solving the initialization problem more than once crash
Scilab.
if (filename != null && filename.exists()) {
configuration.addToRecentFiles(filename);
+ }
- /*
- * looking for an already opened diagram
- */
- final Collection<XcosDiagram> diags = diagrams.get(filename);
- if (diags != null && !diags.isEmpty()) {
- diag = diags.iterator().next();
- }
+ /*
+ * looking for an already opened diagram
+ */
+ final Collection<XcosDiagram> diags = diagrams.get(filename);
+ if (diags != null && !diags.isEmpty()) {
+ diag = diags.iterator().next();
+ }
+ // if unsaved and empty, reuse it. Allocate otherwise.
+ if (filename == null && diag != null &&
+ diag.getModel().getChildCount(diag.getDefaultParent()) > 0) {
+ diag = null;
}
if (diag == null) {