From c228a7c567ba7d3737a9fcb523a0cfe5cf39495b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 25 Aug 2011 14:41:01 +0000 Subject: #3983 Labels in IE7 are rendered as preformatted by default svn changeset:20663/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VLabel.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java index 63d47ff405..28d16b4a39 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java @@ -12,6 +12,7 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HTML; import com.vaadin.terminal.gwt.client.ApplicationConnection; +import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; @@ -120,4 +121,15 @@ public class VLabel extends HTML implements Paintable { setStyleName(getElement(), CLASSNAME_UNDEFINED_WIDTH, false); } } + + @Override + public void setText(String text) { + if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { + // #3983 - IE6-IE8 incorrectly replaces \n with
so we do the + // escaping manually and set as HTML + super.setHTML(Util.escapeHTML(text)); + } else { + super.setText(text); + } + } } -- cgit v1.2.3