From: joncruz Date: Fri, 6 Apr 2007 22:27:16 +0000 (+0000) Subject: Corrected case where extension would not be added for opened filetypes not in default... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5fe5b7fdf793ff68fc434ca9dd4463da3baad55;p=inkscape.git Corrected case where extension would not be added for opened filetypes not in default list (i.e. jpeg) --- diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index 1ab500863..b6c35140e 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -1464,18 +1464,16 @@ FileSaveDialogImpl::getSelectionType() void FileSaveDialogImpl::setSelectionType( Inkscape::Extension::Extension * key ) { - extension = key; - // If no pointer to extension is passed in, look up based on filename extension. - if ( !extension ) { + if ( !key ) { // Not quite UTF-8 here. gchar *filenameLower = g_ascii_strdown(myFilename.c_str(), -1); - for ( int i = 0; !extension && (i < (int)fileTypes.size()); i++ ) { + for ( int i = 0; !key && (i < (int)fileTypes.size()); i++ ) { Inkscape::Extension::Output *ext = dynamic_cast(fileTypes[i].extension); if ( ext && ext->get_extension() ) { gchar *extensionLower = g_ascii_strdown( ext->get_extension(), -1 ); if ( g_str_has_suffix(filenameLower, extensionLower) ) { - extension = fileTypes[i].extension; + key = fileTypes[i].extension; } g_free(extensionLower); } @@ -1484,7 +1482,8 @@ void FileSaveDialogImpl::setSelectionType( Inkscape::Extension::Extension * key } // Ensure the proper entry in the combo box is selected. - if ( extension ) { + if ( key ) { + extension = key; gchar const * extensionID = extension->get_id(); if ( extensionID ) { for ( int i = 0; i < (int)fileTypes.size(); i++ ) {