add support for multiple extensions to wxImage handlers (closes #10570)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-09 23:13:34 +00:00
parent e225e700ef
commit ba4800d3ae
8 changed files with 46 additions and 6 deletions

View File

@@ -2438,10 +2438,12 @@ wxImageHandler *wxImage::FindHandler( const wxString& extension, wxBitmapType bi
while (node)
{
wxImageHandler *handler = (wxImageHandler*)node->GetData();
if ( (handler->GetExtension().Cmp(extension) == 0) &&
( (bitmapType == wxBITMAP_TYPE_ANY) || (handler->GetType() == bitmapType)) )
if ((bitmapType == wxBITMAP_TYPE_ANY) || (handler->GetType() == bitmapType))
{
return handler;
if (handler->GetExtension() == extension)
return handler;
if (handler->GetAltExtensions().Index(extension, false) != wxNOT_FOUND)
return handler;
}
node = node->GetNext();
}
@@ -2503,6 +2505,8 @@ wxString wxImage::GetImageExtWildcard()
{
wxImageHandler* Handler = (wxImageHandler*)Node->GetData();
fmts += wxT("*.") + Handler->GetExtension();
for (size_t i = 0; i < Handler->GetAltExtensions().size(); i++)
fmts += wxT(";*.") + Handler->GetAltExtensions()[i];
Node = Node->GetNext();
if ( Node ) fmts += wxT(";");
}