[Commits] r2382 - in sandbox/camptocamp/geobretagne: lib/GeoExt/data tests/lib/GeoExt/data

commits at geoext.org commits at geoext.org
Tue Sep 21 16:28:40 CEST 2010


Author: elemoine
Date: 2010-09-21 16:28:40 +0200 (Tue, 21 Sep 2010)
New Revision: 2382

Modified:
   sandbox/camptocamp/geobretagne/lib/GeoExt/data/PrintPage.js
   sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/PrintPage.html
Log:
apply patch-344-A0.diff from #340

Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/PrintPage.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/PrintPage.js	2010-09-21 13:17:28 UTC (rev 2381)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/PrintPage.js	2010-09-21 14:28:40 UTC (rev 2382)
@@ -262,7 +262,7 @@
         if(this.printProvider.layout.get("rotation") === false) {
             this.setRotation(0, true);
         }
-        this.setScale(this.scale);
+        this.scale && this.setScale(this.scale);
     },
     
     /** private: method[destroy]

Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/PrintPage.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/PrintPage.html	2010-09-21 13:17:28 UTC (rev 2381)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/PrintPage.html	2010-09-21 14:28:40 UTC (rev 2382)
@@ -107,7 +107,33 @@
             printPage.destroy();
             mapPanel.destroy();
         }
-        
+
+        // test case where onLayoutChange is called while we don't
+        // have a scale set in the print page
+        // http://trac.geoext.org/ticket/344
+        function test_setLayout_no_scale(t) {
+            t.plan(1);
+
+            var printProvider = new GeoExt.data.PrintProvider({
+                capabilities: printCapabilities
+            });
+
+            var printPage = new GeoExt.data.PrintPage({
+                printProvider: printProvider
+            });
+
+            var called = false;
+            printPage.setScale = function(scale, units) {
+                called = true;
+            };
+
+            printProvider.setLayout(printProvider.layouts.getAt(1));
+            t.eq(called, false,
+                 "setScale not called when scale is not set");
+
+            printPage.destroy();
+        }
+       
     </script>
   </head>  
   <body>



More information about the Commits mailing list