Bug 305314, Save as plain text sometimes fails to use correct extension. Append correct extension. Patch by Nick Kreeger <nick.kreeger@gmail.com>. Camino-only. r=pinkerton

This commit is contained in:
mark%moxienet.com 2005-08-29 20:06:55 +00:00
Родитель 78e96ecd3e
Коммит ad1a27aac7
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -325,8 +325,12 @@ nsresult nsHeaderSniffer::PerformSave(nsIURI* inOriginalURI)
// need this because the |stringWith_nsAString| returns a NSString
// with an extension that the savePanel does not like and will add
// the extensions on top of an extensions
if (filterIndex == eSaveFormatPlainText) {
file = [file stringByDeletingPathExtension];
file = [file stringByAppendingPathExtension:@"txt"];
}
NSLog([file pathExtension]);
[savePanel setRequiredFileType: [file pathExtension]];
[savePanel setRequiredFileType:[file pathExtension]];
[savePanel setCanSelectHiddenExtension: YES];
}