X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2FSpreadsheetCell.java;fp=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2FSpreadsheetCell.java;h=5b732cf864b9f768fd90435ca641fcb3e1e204c8;hb=e5871be84f8ba53a1c80be728bcfb67231c29279;hp=dd05bf370fa92af0ddc41a2f1ba5f16bc8633c54;hpb=fb89ec6bace6b3eef93a4c437171bb173fc861b6;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCell.java b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCell.java index dd05bf370..5b732cf86 100644 --- a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCell.java +++ b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetCell.java @@ -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 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;