[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 09 Jan 2006 22:53:25 -0000


albertel		Mon Jan  9 17:53:25 2006 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  - BUG#4540, default width was taking pixel width and treating it as mm
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.310 loncom/xml/londefdef.pm:1.311
--- loncom/xml/londefdef.pm:1.310	Wed Jan  4 18:14:24 2006
+++ loncom/xml/londefdef.pm	Mon Jan  9 17:53:25 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.310 2006/01/04 23:14:24 albertel Exp $
+# $Id: londefdef.pm,v 1.311 2006/01/09 22:53:25 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1961,11 +1961,16 @@
 
 	# width either comes forced from the TeXwidth or the width parameters.
 	# in either case it can be a percentage or absolute width.
-
+	# in the width case we ignore absolute width 
 	my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0);
 	if (!defined($TeXwidth)) {
-	    $TeXwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);
-	    if (!defined($TeXwidth)) { $TeXwidth = $textwidth; }
+	    my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,
+						       $safeeval,undef,1);
+	    if ($htmlwidth =~ /%/) {
+		$TeXwidth = $htmlwidth;
+	    } else { 
+		$TeXwidth = $textwidth;
+	    }
 	} else {
 	    $Apache::londefdef::table[-1]{'forcedtablewidth'} = 1;
 	}