]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 740071 ] Make tiff errors/warnings use wxLog functions
authorJulian Smart <julian@anthemion.co.uk>
Wed, 21 May 2003 18:25:24 +0000 (18:25 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 21 May 2003 18:25:24 +0000 (18:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/imagtiff.h
src/common/imagtiff.cpp

index 67657d6d4f3984e715fb9ddc91c47c7b5211ad92..1f953b3f4a8cebe00bd485e1403bf8ef8b32b501 100644 (file)
 class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
 {
 public:
-    inline wxTIFFHandler()
-    {
-        m_name = wxT("TIFF file");
-        m_extension = wxT("tif");
-        m_type = wxBITMAP_TYPE_TIF;
-        m_mime = wxT("image/tiff");
-    }
+    wxTIFFHandler();
 
 #if wxUSE_STREAMS
     virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
index 741bc364723fdc2940dc672f5b1543413b730f7c..657ff82ac5daa487bcf067690a3c3167443c3bca 100644 (file)
@@ -136,6 +136,22 @@ _tiffUnmapProc(thandle_t WXUNUSED(handle),
 {
 }
 
+static void
+TIFFwxWarningHandler(const char* module, const char* fmt, va_list ap)
+{
+    if (module != NULL)
+            wxLogWarning(_("tiff module: %s"), module);
+    wxLogWarning((wxChar *) fmt, ap);
+}
+static void
+TIFFwxErrorHandler(const char* module, const char* fmt, va_list ap)
+{
+    if (module != NULL)
+            wxLogError(_("tiff module: %s"), module);
+    wxVLogError((wxChar *) fmt, ap);
+}
+
 } // extern "C"
 
 TIFF*
@@ -162,6 +178,16 @@ TIFFwxOpen(wxOutputStream &stream, const char* name, const char* mode)
     return tif;
 }
 
+wxTIFFHandler::wxTIFFHandler()
+{
+    m_name = wxT("TIFF file");
+    m_extension = wxT("tif");
+    m_type = wxBITMAP_TYPE_TIF;
+    m_mime = wxT("image/tiff");
+    TIFFSetWarningHandler((TIFFErrorHandler) TIFFwxWarningHandler);
+    TIFFSetErrorHandler((TIFFErrorHandler) TIFFwxErrorHandler);
+}
+
 bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index )
 {
     if (index == -1)