diff --git a/src/common/imagall.cpp b/src/common/imagall.cpp index ca44263ad6..aaf6d459c7 100644 --- a/src/common/imagall.cpp +++ b/src/common/imagall.cpp @@ -60,6 +60,13 @@ void wxInitAllImageHandlers() wxImage::AddHandler( new wxCURHandler ); wxImage::AddHandler( new wxANIHandler ); #endif +#if wxUSE_XPM && (defined(__WXGTK__) || defined(__WXMOTIF__)) + // NB: keep this #ifdef in sync with the one in image.cpp + // (wxImage::InitStandardHandlers) - they must complement each other + // so that there's always exactly one XPM handler added after calling + // wxInitAllImageHandlers() + wxImage::AddHandler( new wxXPMHandler ); +#endif } #endif // wxUSE_IMAGE diff --git a/src/common/image.cpp b/src/common/image.cpp index 3e922fad22..f26ae13855 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1269,6 +1269,9 @@ void wxImage::InitStandardHandlers() #endif // wxUSE_STREAMS #if wxUSE_XPM && !defined(__WXGTK__) && !defined(__WXMOTIF__) + // NB: keep this #ifdef in sync with the one in imagall.cpp - + // they must complement each other so that there's always exactly + // one XPM handler added after calling wxInitAllImageHandlers() AddHandler(new wxXPMHandler); #endif }