]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/pnghand.cpp
made wxFFile a bit more safe: don't crash when Tell() and Length() are called on...
[wxWidgets.git] / src / mac / pnghand.cpp
index 4f33c04b1e2988e434c1b12386dd3c1b0d8505ac..f25141d7e9c50e559a4dc236b295b8888414835b 100644 (file)
@@ -5,8 +5,8 @@
 // Modified by: 
 // Created:     04/01/98
 // RCS-ID:      $Id$
-// Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:     wxWindows license
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -57,7 +57,7 @@ extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
 void
 ima_png_error(png_struct *png_ptr, char *message)
 {
-    wxMessageBox(message, "PNG error");
+    wxMessageBox(wxString::FromAscii(message), wxT("PNG error"));
     longjmp(png_ptr->jmpbuf, 1);
 }
 
@@ -819,8 +819,9 @@ bool wxPNGReader::SaveXPM(char *filename, char *name)
         strcpy(nameStr, name);
     else
     {
-        strcpy(nameStr, filename);
-        wxStripExtension(nameStr);
+       wxString str = wxString::FromAscii(filename) ;
+       wxStripExtension( str ) ;
+        strcpy(nameStr, str.ToAscii() );
     }
     
     if ( GetDepth() > 4 )
@@ -888,7 +889,7 @@ bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
                                 int desiredWidth, int desiredHeight)
 {
     wxPNGReader reader;
-    if (reader.ReadFile((char*) (const char*) name))
+    if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) )
     {
         return reader.InstantiateBitmap(bitmap);
     }
@@ -901,4 +902,3 @@ bool wxPNGFileHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, in
     return FALSE;
 }
 
-