[fusion-commits] r2554 - trunk/widgets/QuickPlot
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Jul 25 02:36:56 PDT 2012
Author: liuar
Date: 2012-07-25 02:36:56 -0700 (Wed, 25 Jul 2012)
New Revision: 2554
Modified:
trunk/widgets/QuickPlot/QuickPlotPanel.js
Log:
On behalf of Ted Yang.
fix the ticket 2081: http://trac.osgeo.org/mapguide/ticket/2081
The submission is mainly fix the problem that Customer paper size in Fusion QuickPlot works incorrect.
Modified: trunk/widgets/QuickPlot/QuickPlotPanel.js
===================================================================
--- trunk/widgets/QuickPlot/QuickPlotPanel.js 2012-07-24 07:12:18 UTC (rev 2553)
+++ trunk/widgets/QuickPlot/QuickPlotPanel.js 2012-07-25 09:36:56 UTC (rev 2554)
@@ -19,8 +19,19 @@
var i;
for (i = 0; i < widget.paperList.length; i++) {
var elOpt = document.createElement("option");
- elOpt.text = widget.paperList[i].name;
- elOpt.value = widget.paperList[i].size;
+ var name= widget.paperList[i].name.trim();
+
+ //users may set the page size as 279.4,215.9 which make the height before width
+ //we should always set width before height
+ //and also make sure the paper size name is right, otherwise will result in error
+ var sizeArray = widget.paperList[i].size.split(",");
+ var width = parseFloat(sizeArray[0]);
+ var height = parseFloat(sizeArray[1]);
+
+ var paperSizeFormatString = (width < height)? (width + "," + height + "," + name) : (height + "," + width + "," + name);
+
+ elOpt.text = name;
+ elOpt.value = paperSizeFormatString;
try {
paperList.add(elOpt, null);
}catch (ex) {
More information about the fusion-commits
mailing list