[Tools] testbot/web: Limit the width of edit fields so they fit in the page.

Francois Gouget fgouget at codeweavers.com
Fri Aug 31 10:17:40 CDT 2012


---
 testbot/lib/ObjectModel/CGI/FormPage.pm |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm
index 6a1fbae..4595e44 100644
--- a/testbot/lib/ObjectModel/CGI/FormPage.pm
+++ b/testbot/lib/ObjectModel/CGI/FormPage.pm
@@ -290,9 +290,10 @@ sub GenerateField
     }
     else
     {
+      my $Size=$PropertyDescriptor->GetMaxLength();
+      $Size=45 if ($Size > 45);
       print "<input type='$InputType' name='", $PropertyDescriptor->GetName(),
-            "' maxlength='", $PropertyDescriptor->GetMaxLength(), "' size='",
-            $PropertyDescriptor->GetMaxLength(), "'";
+            "' maxlength='", $PropertyDescriptor->GetMaxLength(), "' size='$Size'";
       if ($Value && $InputType ne "password")
       {
         print " value='", $self->CGI->escapeHTML($Value), "'";
-- 
1.7.10.4




More information about the wine-patches mailing list