From 79dab26479a1b42f3bd19a6296418463ab5bfb93 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Sun, 3 Apr 2011 13:47:13 +0100 Subject: [PATCH] Prevent keys/values exceeding 255 characters --- net/systemeD/controls/AutoComplete.as | 3 +++ net/systemeD/halcyon/connection/actions/SetTagAction.as | 2 +- net/systemeD/potlatch2/TagGrid.mxml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/systemeD/controls/AutoComplete.as b/net/systemeD/controls/AutoComplete.as index a3eaa241..527b8049 100644 --- a/net/systemeD/controls/AutoComplete.as +++ b/net/systemeD/controls/AutoComplete.as @@ -81,6 +81,8 @@ package net.systemeD.controls { setStyle("paddingLeft",0); setStyle("paddingRight",0); rowCount = 7; + + if (maxChars) textInput.maxChars=maxChars; } //-------------------------------------------------------------------------- @@ -93,6 +95,7 @@ package net.systemeD.controls { private var showingDropdown:Boolean=false; private var tempCollection:Object; private var dropdownClosed:Boolean=true; + public var maxChars:uint=0; //-------------------------------------------------------------------------- // Overridden Properties diff --git a/net/systemeD/halcyon/connection/actions/SetTagAction.as b/net/systemeD/halcyon/connection/actions/SetTagAction.as index 625d039c..9e3680d8 100644 --- a/net/systemeD/halcyon/connection/actions/SetTagAction.as +++ b/net/systemeD/halcyon/connection/actions/SetTagAction.as @@ -11,7 +11,7 @@ package net.systemeD.halcyon.connection.actions { public function SetTagAction(entity:Entity, key:String, value:String) { super(entity, "Set "+key+"="+value); this.key = key; - this.value = value; + this.value = value.substr(0,255); } public override function doAction():uint { diff --git a/net/systemeD/potlatch2/TagGrid.mxml b/net/systemeD/potlatch2/TagGrid.mxml index 6abbd69e..e4551472 100644 --- a/net/systemeD/potlatch2/TagGrid.mxml +++ b/net/systemeD/potlatch2/TagGrid.mxml @@ -19,6 +19,7 @@ labelField="name" rowCount="10" restrict=" -􏿿" + maxChars="255" typedText="{outerDocument.selectedItem.key}"> @@ -36,6 +37,7 @@ labelField="name" rowCount="10" restrict=" -􏿿" + maxChars="255" typedText="{outerDocument.selectedItem.value}"> -- 2.37.0