Check whether there is a returned save panel, this wont be the case

when the user cancels the save operation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-06-02 21:40:07 +00:00
parent a8ecb0c14a
commit 053c28aa92
2 changed files with 25 additions and 21 deletions

View file

@ -1,3 +1,9 @@
2009-06-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSDocument.m (-runModalSavePanelForSaveOperation:...):
Check whether there is a returned save panel, this wont be the case
when the user cancels the save operation.
2009-05-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (detachDrawingThread:toTarget:withObject:):

View file

@ -1171,29 +1171,27 @@ originalContentsURL: (NSURL *)orig
contextInfo: (void *)contextInfo
{
// FIXME: Commit registered editors
NSSavePanel *savePanel = [self _runSavePanelForSaveOperation: saveOperation];
if (OVERRIDDEN(saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:))
if (savePanel)
{
NSString *fileName;
fileName = [self fileNameFromRunningSavePanelForSaveOperation: saveOperation];
[self saveToFile: fileName
saveOperation: saveOperation
delegate: delegate
didSaveSelector: didSaveSelector
contextInfo: contextInfo];
}
else
{
NSSavePanel *savePanel = [self _runSavePanelForSaveOperation: saveOperation];
NSURL *url = [savePanel URL];
[self saveToURL: url
ofType: [self fileTypeFromLastRunSavePanel]
forSaveOperation: saveOperation
delegate: delegate
didSaveSelector: didSaveSelector
contextInfo: contextInfo];
if (OVERRIDDEN(saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:))
{
[self saveToFile: [savePanel filename]
saveOperation: saveOperation
delegate: delegate
didSaveSelector: didSaveSelector
contextInfo: contextInfo];
}
else
{
[self saveToURL: [savePanel URL]
ofType: [self fileTypeFromLastRunSavePanel]
forSaveOperation: saveOperation
delegate: delegate
didSaveSelector: didSaveSelector
contextInfo: contextInfo];
}
}
}