]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Redirect document commandRelation and commandExecutorRelation terminals"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 7 Aug 2017 05:24:00 +0000 (08:24 +0300)
committerGerrit Code Review <gerrit2@www.simantics.org>
Mon, 7 Aug 2017 05:24:00 +0000 (08:24 +0300)
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/RVI.java
bundles/org.simantics.document.server.io/src/org/simantics/document/server/io/CommandContextImpl.java
bundles/org.simantics.modeling/scl/Simantics/Diagram.scl

index daae9b9c32f76cf5bc9a1c8b699aee6661f47f19..a5f22c83c1a44233bcce46550aefdab8a1b39dec 100644 (file)
@@ -407,8 +407,8 @@ public class RVI extends Bean {
                                        }
                                }
                        }
-                       if (str.indexOf(":", pos+1) > -1) {
-                           String x = str.substring(pos+1, end);
+                       if (str.indexOf(":", pos) > -1) {
+                           String x = str.substring(pos, end);
                            if (!x.isEmpty()) {
                                String[] parts = x.split(":");
                                if (parts.length == 3) {
index 5b49810fad9f8109c5a4a637ab24444ea3bf059c..5fb3a283e93a0b635768e5517fc1b3e6f14ac50d 100644 (file)
@@ -66,6 +66,12 @@ public class CommandContextImpl implements CommandContextMutable {
                if (context != null) {
                        Map<String,List<List<Object>>> from = context.getData(); 
                        for (Map.Entry<String, List<List<Object>>> entry : from.entrySet()) {
+                               String key = entry.getKey();
+                               Object existing = getValue(key);
+                               Object newValue = context.getValue(key);
+                               // Do not merge duplicates!
+                               if (newValue != null && newValue.equals(existing))
+                                       continue;
                                List<List<Object>> rows = ensureRowsAvailable(entry.getKey());
                                rows.addAll(entry.getValue());
                        }
index 554a25edad081a50f4388688d19820b359440942..0ee3e9d28ec03afeec9aff59d69097643472df72 100644 (file)
@@ -149,9 +149,15 @@ hasRandomIdentifier entity = runProc (claimRelatedValue_ entity L0.identifier GU
 
 """Returns all diagrams of the given model."""
 diagramsOf :: Model -> <ReadGraph> [Diagram]
-diagramsOf model = recurse
-                   DIA.Diagram 
-                   (configurationOf model)
+diagramsOf model = diagramsUnder $ configurationOf model
+
+"""
+Returns all diagrams under the specified diagram folder.
+The parameter can also be the configuration root `configurationOf`
+in which case this function returns the same as `diagramsOf model`.
+"""
+diagramsUnder :: DiagramFolder -> <ReadGraph> [Resource]
+diagramsUnder folder = recurse DIA.Diagram folder 
   where
     recurse t r = do
         cs = children r