Author: gert
Date: 2007-05-23 17:06:58 -0400 (Wed, 23 May 2007)
New Revision: 77870

Added:
   trunk/gert/standalone/bug80765/
   trunk/gert/standalone/bug80765/default.build
   trunk/gert/standalone/bug80765/test.cs
Log:
Added test for bug #80765.


Added: trunk/gert/standalone/bug80765/default.build
===================================================================
--- trunk/gert/standalone/bug80765/default.build        2007-05-23 20:44:42 UTC 
(rev 77869)
+++ trunk/gert/standalone/bug80765/default.build        2007-05-23 21:06:58 UTC 
(rev 77870)
@@ -0,0 +1,59 @@
+<project name="bug80765" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
unsafe="true" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Drawing.dll" />
+                       </references>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug80765/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug80765/test.cs
===================================================================
--- trunk/gert/standalone/bug80765/test.cs      2007-05-23 20:44:42 UTC (rev 
77869)
+++ trunk/gert/standalone/bug80765/test.cs      2007-05-23 21:06:58 UTC (rev 
77870)
@@ -0,0 +1,60 @@
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Printing;
+
+class Program
+{
+       static int Main ()
+       {
+               PreviewPrintController printController = new 
PreviewPrintController ();
+               MyPrintDocument doc = new MyPrintDocument ();
+               doc.PrintController = printController;
+               doc.Print ();
+
+               if (doc.Matrix.Elements.Length != 6)
+                       return 1;
+               if (doc.Matrix.Elements [0] != 1)
+                       return 2;
+               if (doc.Matrix.Elements [1] != 0)
+                       return 3;
+               if (doc.Matrix.Elements [2] != 0)
+                       return 4;
+               if (doc.Matrix.Elements [3] != 1)
+                       return 5;
+               if (doc.Matrix.Elements [4] != 0)
+                       return 6;
+               if (doc.Matrix.Elements [5] != 0)
+                       return 7;
+               return 0;
+       }
+}
+
+public class MyPrintDocument : PrintDocument
+{
+       public MyPrintDocument ()
+       {
+       }
+
+       protected override void OnPrintPage (PrintPageEventArgs e)
+       {
+               base.OnPrintPage (e);
+
+               Graphics g = e.Graphics;
+               Matrix mx = g.Transform;
+               _matrix = mx;
+
+               RectangleF rec = g.ClipBounds;
+               if (rec == RectangleF.Empty)
+                       Environment.Exit (10);
+
+               e.HasMorePages = false;
+               e.Cancel = true;
+       }
+
+       public Matrix Matrix {
+               get { return _matrix; }
+       }
+
+       private Matrix _matrix;
+}


Property changes on: trunk/gert/standalone/bug80765/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to