Author: paullanders
Date: Thu Dec 18 01:04:20 2014
New Revision: 38253
URL: http://svn.gna.org/viewcvs/gnustep?rev=38253&view=rev
Log:
Prioritized setAllowedFileTypes over the types for a valid document.
Modified:
plugins/themes/WinUXTheme/ChangeLog
plugins/themes/WinUXTheme/WinNSOpenPanel.m
Modified: plugins/themes/WinUXTheme/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/plugins/themes/WinUXTheme/ChangeLog?rev=38253&r1=38252&r2=38253&view=diff
==============================================================================
--- plugins/themes/WinUXTheme/ChangeLog (original)
+++ plugins/themes/WinUXTheme/ChangeLog Thu Dec 18 01:04:20 2014
@@ -1,3 +1,8 @@
+2014-12-17 Paul Landers <[email protected]>
+
+ * WinNSOpenPanel.m: Setting the list of allowedFileTypes uses only those
in the list.
+ Otherwise, use the types for the valid document.
+
2014-09-25 Riccardo Mottola <[email protected]>
* WinUXTheme.h
Modified: plugins/themes/WinUXTheme/WinNSOpenPanel.m
URL:
http://svn.gna.org/viewcvs/gnustep/plugins/themes/WinUXTheme/WinNSOpenPanel.m?rev=38253&r1=38252&r2=38253&view=diff
==============================================================================
--- plugins/themes/WinUXTheme/WinNSOpenPanel.m (original)
+++ plugins/themes/WinUXTheme/WinNSOpenPanel.m Thu Dec 18 01:04:20 2014
@@ -573,26 +573,32 @@
{
names = [doc writableTypesForSaveOperation: NSSaveOperation];
}
-
- for (i = 0; i < [names count]; i++)
- {
- exts = [dc fileExtensionsFromType: [names objectAtIndex: i]];
-
- for (j = 0; j < [exts count]; j++)
+
+ // Check for presence of fileTypes and add...
+ if ([fileTypes count] == 0)
+ {
+ // fileTypes not specified, add from current documents allowed types
+ for (i = 0; i < [names count]; i++)
{
- if (![tps containsObject: [exts objectAtIndex: j]])
+ exts = [dc fileExtensionsFromType: [names objectAtIndex: i]];
+
+ for (j = 0; j < [exts count]; j++)
{
- [tps addObject: [exts objectAtIndex: j]];
+ if (![tps containsObject: [exts objectAtIndex: j]])
+ {
+ [tps addObject: [exts objectAtIndex: j]];
+ }
}
}
- }
-
- // Check for presence of fileTypes and add if necessary...
- for (i = 0; i < [fileTypes count]; ++i)
- {
- if ([tps indexOfObject:[fileTypes objectAtIndex:i]] == NSNotFound)
- [tps addObject:[fileTypes objectAtIndex:i]];
- }
+ }
+ else
+ {
+ for (i = 0; i < [fileTypes count]; ++i)
+ {
+ if ([tps indexOfObject:[fileTypes objectAtIndex:i]] == NSNotFound)
+ [tps addObject:[fileTypes objectAtIndex:i]];
+ }
+ }
types = [NSArray arrayWithArray: tps];
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs