From: Tuukka Lehtonen Date: Tue, 26 May 2020 10:33:48 +0000 (+0000) Subject: Merge "Counting of pending nodes does not work if null text is saved as """ X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=680a2159d36d893cf7fbf0212e7ffbff847a8f82;hp=b9331aba5aa5157e581e5038ff401c525ac18305;p=simantics%2Fplatform.git Merge "Counting of pending nodes does not work if null text is saved as """ --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java index 77eb78922..bf1bf563b 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java @@ -403,7 +403,7 @@ public class TextNode extends G2DNode implements IDynamicSelectionPainterNode, L if (hasState(STATE_EDITING)) return; - this.text = new String(text != null ? text : ""); + this.text = text; this.font = font; this.color = color; this.scale = scale; @@ -470,8 +470,8 @@ public class TextNode extends G2DNode implements IDynamicSelectionPainterNode, L // no value => value if(this.text == null && text != null) NodeUtil.decreasePending(this); - this.text = text != null ? text : ""; - caret = Math.min(caret, this.text.length()); + this.text = text; + caret = text != null ? Math.min(caret, text.length()) : 0; selectionTail = caret; resetCaches();