Applied patch [ 740071 ] Make tiff errors/warnings use wxLog functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,13 +25,7 @@
|
||||
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 );
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user