From dc3ce8e2dd275aadc8f97487807d1dad1270653c Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Wed, 21 Aug 2013 22:25:14 -0700 Subject: [PATCH] CopyableLabel: Avoid creating Flash movie for empty string A label built for an empty string is almost certainly a dummy being initialized by UiBinder before the data is available to render into the widgets. Delay allocation of the movie DOM as the movie just has to be rebuilt later when the real text is supplied by the UI code. Change-Id: Ifcefbb8bba3d9befa60c608c4457135ada0821b4 --- .../java/com/google/gwtexpui/clippy/client/CopyableLabel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java index 18060ab59c..75f2e8b5e1 100644 --- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java +++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java @@ -130,7 +130,7 @@ public class CopyableLabel extends Composite implements HasText { } private void embedMovie() { - if (flashEnabled && UserAgent.hasFlash) { + if (flashEnabled && UserAgent.hasFlash && text.length() > 0) { final String flashVars = "text=" + URL.encodeQueryString(getText()); final SafeHtmlBuilder h = new SafeHtmlBuilder();