Revision: 13202 http://sourceforge.net/p/skim-app/code/13202 Author: hofman Date: 2023-01-05 00:00:57 +0000 (Thu, 05 Jan 2023) Log Message: ----------- select document fileType in export panel when saved type is not available
Modified Paths: -------------- trunk/SKMainDocument.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2023-01-04 10:43:44 UTC (rev 13201) +++ trunk/SKMainDocument.m 2023-01-05 00:00:57 UTC (rev 13202) @@ -366,12 +366,12 @@ NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] stringForKey:SKLastExportedTypeKey]; NSInteger lastExportedOption = [[NSUserDefaults standardUserDefaults] integerForKey:SKLastExportedOptionKey]; - if (lastExportedType == nil) { - lastExportedType = [self fileType]; + NSInteger idx = lastExportedType ? [formatPopUpButton indexOfItemWithRepresentedObject:lastExportedType] : -1; + if (idx == -1) { + idx = [formatPopUpButton indexOfItemWithRepresentedObject:[self fileType]]; lastExportedType = SKExportOptionDefault; } mdFlags.exportOption = lastExportedOption; - NSInteger idx = [formatPopUpButton indexOfItemWithRepresentedObject:lastExportedType]; [formatPopUpButton selectItemAtIndex:MAX(idx, 0)]; // update the last selected type and option view [self changeExportType:formatPopUpButton]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit