mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:10:47 +00:00
Fix bug #4255
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17182 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a3b6f9b27f
commit
f14cb00652
3 changed files with 38 additions and 11 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2003-07-10 Benhur Stein <benhur@inf.ufsm.br>
|
||||
|
||||
* Source/NSSavePanel.m: added new private method
|
||||
_compareFilename:with:. Use it in _selectCellName:.
|
||||
In [-browser:createRowsForColumn:inMatrix:]: use self as context to
|
||||
sortedArrayUsingFunction:context:
|
||||
* Source/NSOpenPanel.m (-_selectCellName:): use new [NSSavePanel
|
||||
_compareFilename:with:] method.
|
||||
* This fixes bug #4255
|
||||
|
||||
2003-07-05 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* configure.ac: Add openbsd flags like freebsd.
|
||||
|
|
|
@ -60,6 +60,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
- (void) _selectTextInColumn: (int)column;
|
||||
- (void) _setupForDirectory: (NSString *)path file: (NSString *)filename;
|
||||
- (BOOL) _shouldShowExtension: (NSString *)extension isDir: (BOOL *)isDir;
|
||||
- (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2;
|
||||
@end
|
||||
|
||||
@implementation NSOpenPanel (_PrivateMethods)
|
||||
|
@ -183,7 +184,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
if(cellLength < titleLength)
|
||||
continue;
|
||||
|
||||
result = [cellString compare:title options:0 range:range];
|
||||
result = [self _compareFilename:[cellString substringWithRange:range]
|
||||
with:title];
|
||||
|
||||
if(result == NSOrderedSame)
|
||||
{
|
||||
|
|
|
@ -62,6 +62,13 @@ static NSFileManager *_fm = nil;
|
|||
|
||||
static BOOL _gs_display_reading_progress = NO;
|
||||
|
||||
//
|
||||
// SavePanel filename compare
|
||||
//
|
||||
@interface NSString (_gsSavePanel)
|
||||
- (NSComparisonResult)_gsSavePanelCompare:(NSString *)other;
|
||||
@end
|
||||
|
||||
//
|
||||
// NSSavePanel private methods
|
||||
//
|
||||
|
@ -80,6 +87,7 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
- (void) _setupForDirectory: (NSString *)path file: (NSString *)name;
|
||||
- (BOOL) _shouldShowExtension: (NSString *)extension isDir: (BOOL *)isDir;
|
||||
- (void) _windowResized: (NSNotification*)n;
|
||||
- (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2;
|
||||
@end /* NSSavePanel (PrivateMethods) */
|
||||
|
||||
@implementation NSSavePanel (_PrivateMethods)
|
||||
|
@ -364,7 +372,6 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
NSArray *cells;
|
||||
NSMatrix *matrix;
|
||||
NSComparisonResult result;
|
||||
NSRange range;
|
||||
int i, titleLength, cellLength, numberOfCells;
|
||||
|
||||
matrix = [_browser matrixInColumn:[_browser lastColumn]];
|
||||
|
@ -375,9 +382,6 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
if(!titleLength)
|
||||
return;
|
||||
|
||||
range.location = 0;
|
||||
range.length = titleLength;
|
||||
|
||||
cells = [matrix cells];
|
||||
numberOfCells = [cells count];
|
||||
|
||||
|
@ -389,7 +393,7 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
if(cellLength != titleLength)
|
||||
continue;
|
||||
|
||||
result = [cellString compare:title options:0 range:range];
|
||||
result = [self _compareFilename:cellString with:title];
|
||||
|
||||
if(result == NSOrderedSame)
|
||||
{
|
||||
|
@ -490,6 +494,21 @@ selectCellWithString: (NSString*)title
|
|||
[_browser setMaxVisibleColumns: [_browser frame].size.width / 140];
|
||||
}
|
||||
|
||||
- (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2
|
||||
{
|
||||
if (_delegateHasCompareFilter)
|
||||
{
|
||||
return [_delegate panel: self
|
||||
compareFilename: n1
|
||||
with: n2
|
||||
caseSensitive: YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [n1 _gsSavePanelCompare: n2];
|
||||
}
|
||||
}
|
||||
|
||||
@end /* NSSavePanel (PrivateMethods) */
|
||||
|
||||
//
|
||||
|
@ -1074,10 +1093,6 @@ selectCellWithString: (NSString*)title
|
|||
//
|
||||
// SavePanel filename compare
|
||||
//
|
||||
@interface NSString (_gsSavePanel)
|
||||
- (NSComparisonResult)_gsSavePanelCompare:(NSString *)other;
|
||||
@end
|
||||
|
||||
@implementation NSString (_gsSavePanel)
|
||||
- (NSComparisonResult)_gsSavePanelCompare:(NSString *)other
|
||||
{
|
||||
|
@ -1301,7 +1316,7 @@ createRowsForColumn: (int)column
|
|||
if (_delegateHasCompareFilter == YES)
|
||||
{
|
||||
files = [files sortedArrayUsingFunction: compareFilenames
|
||||
context: nil];
|
||||
context: self];
|
||||
}
|
||||
else
|
||||
files = [files sortedArrayUsingSelector: @selector(_gsSavePanelCompare:)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue