Author: kostat
Date: 2005-11-16 12:42:37 -0500 (Wed, 16 Nov 2005)
New Revision: 53133

Modified:
   
trunk/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs
   trunk/mcs/class/System.Drawing/System.Drawing.Text/changelog
   trunk/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs
   trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
Log:
open a correct stream.

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs 2005-11-16 
17:22:41 UTC (rev 53132)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs 2005-11-16 
17:42:37 UTC (rev 53133)
@@ -86,11 +86,11 @@
                }
 
                internal Bitmap (string filename, bool useIcm, ImageFormat 
format) {
-                       // TBD: useIcm param
-                       java.io.File file = vmw.common.IOUtils.getJavaFile 
(filename);
-                       if (!file.exists ())
-                                throw new System.IO.FileNotFoundException 
(filename);
-                       Initialize (new stream.FileImageInputStream (file), 
format);
+                       using(FileStream stream = new FileStream(filename, 
FileMode.Open, FileAccess.Read)) {
+                               // TBD: useIcm param
+                               io.InputStream jis = 
vmw.common.IOUtils.ToInputStream (stream);
+                               Initialize (new 
stream.MemoryCacheImageInputStream (jis), format);
+                       }
                }
 
                public Bitmap (Type type, string resource) {

Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2005-11-16 
17:22:41 UTC (rev 53132)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2005-11-16 
17:42:37 UTC (rev 53133)
@@ -1,5 +1,9 @@
 2005-11-16 Konstantin Triger <[EMAIL PROTECTED]>
 
+        * Bitmap.jvm.cs: open a correct stream.
+
+2005-11-16 Konstantin Triger <[EMAIL PROTECTED]>
+
         * FontFamily.jvm.cs, Font.jvm.cs: throw exception if invalid params.
 
 2005-11-16 Konstantin Triger <[EMAIL PROTECTED]>

Modified: 
trunk/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs
===================================================================
--- 
trunk/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs 
    2005-11-16 17:22:41 UTC (rev 53132)
+++ 
trunk/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs 
    2005-11-16 17:42:37 UTC (rev 53133)
@@ -27,6 +27,7 @@
 //
 
 using System;
+using System.IO;
 using awt = java.awt;
 using io = java.io;
 using vmw.common;
@@ -43,15 +44,11 @@
                }
 
                public void AddFontFile(string filename) {
-                       io.File file = IOUtils.getJavaFile(filename);
-                       io.FileInputStream stream = new 
io.FileInputStream(file);
-                       try {
+                       using(FileStream fs = new FileStream(filename, 
FileMode.Open, FileAccess.Read)) {
+                               io.InputStream stream = 
vmw.common.IOUtils.ToInputStream (fs);
                                awt.Font font = 
awt.Font.createFont(awt.Font.TRUETYPE_FONT, stream);
                                AddFont(font);
                        }
-                       finally {
-                               stream.close();
-                       }
                }
 #if INTPTR_SUPPORT
                public void AddMemoryFont(IntPtr memory, int length) {

Modified: trunk/mcs/class/System.Drawing/System.Drawing.Text/changelog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing.Text/changelog        
2005-11-16 17:22:41 UTC (rev 53132)
+++ trunk/mcs/class/System.Drawing/System.Drawing.Text/changelog        
2005-11-16 17:42:37 UTC (rev 53133)
@@ -1,3 +1,7 @@
+2005-11-16 Konstantin Triger <[EMAIL PROTECTED]>
+
+        * PrivateFontCollection.jvm.cs: open a correct stream.
+
 2005-11-13 Konstantin Triger <[EMAIL PROTECTED]>
 
        * Added LineLayout.jvm.cs, TextLineIterator.jvm.cs for text support

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

Reply via email to