]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCell.java
ExternalRef corrections
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / SpreadsheetCell.java
index dd05bf370fa92af0ddc41a2f1ba5f16bc8633c54..5b732cf864b9f768fd90435ca641fcb3e1e204c8 100644 (file)
@@ -35,7 +35,7 @@ public class SpreadsheetCell implements SpreadsheetElement, SheetNode {
     final private SpreadsheetLine line;
     final private int column;
     int style;
-    Object content;
+    private Object content;
     final private Map<String, SheetNode> properties;
 
     public SpreadsheetCell(SpreadsheetLine line, int column) {
@@ -126,13 +126,15 @@ public class SpreadsheetCell implements SpreadsheetElement, SheetNode {
             return (T)f.result;
         } else if (content instanceof SpreadsheetSCLConstant) {
             SpreadsheetSCLConstant sclConstant = (SpreadsheetSCLConstant) content;
-            if(sclConstant.content instanceof Variant) {
-                Variant v = (Variant)sclConstant.content;
-                return (T) sclConstant.content;
-            } else if (sclConstant.content instanceof ExternalRef) {
-                return (T)env.getBook().getExternalRefValue(makeReferenceKey(), (ExternalRef)sclConstant.content);
+            Object c = sclConstant.getContent();
+            if(c instanceof Variant) {
+                Variant v = (Variant)c;
+                return (T) c;
+            } else if (c instanceof ExternalRef) {
+                ExternalRefData erd = env.getBook().getExternalRefValue(makeReferenceKey(), (ExternalRef)c); 
+                return (T)erd;
             } else {
-                throw new IllegalStateException();
+                throw new IllegalStateException("Unsupported content " + c);
             }
         } else {
             this.inProgress = false;