From b36d99d7aa1ad4a67c4fc0b3bd8ac233b1897e66 Mon Sep 17 00:00:00 2001 From: "alqahira%ardisson.org" Date: Tue, 29 Sep 2009 04:26:03 +0000 Subject: [PATCH] Bug 519311 - Filename extension and format can get out of sync in bookmarks export; always set the extension to match the remembered file format when setting up the panel. r/sr=smorgan git-svn-id: svn://10.0.0.236/branches/CAMINO_2_0_BRANCH@258519 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/application/MainController.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/camino/src/application/MainController.mm b/mozilla/camino/src/application/MainController.mm index f0f09c2c405..f8ce35a4fc4 100644 --- a/mozilla/camino/src/application/MainController.mm +++ b/mozilla/camino/src/application/MainController.mm @@ -1443,7 +1443,6 @@ const int kZoomActionsTag = 108; { NSSavePanel* savePanel = [NSSavePanel savePanel]; [savePanel setPrompt:NSLocalizedString(@"Export", @"Export")]; - [savePanel setRequiredFileType:@"html"]; [savePanel setCanSelectHiddenExtension:YES]; // get an accessory view for HTML or Safari .plist output @@ -1454,10 +1453,13 @@ const int kZoomActionsTag = 108; [[button itemAtIndex:1] setRepresentedObject:savePanel]; [savePanel setAccessoryView:mExportPanelView]; + // Set the initial extension based on the remembered value for the output type. + int selectedButton = [button indexOfSelectedItem]; + [self setFileExtension:[button itemAtIndex:selectedButton]]; + // start the save panel [NSMenu cancelAllTracking]; int saveResult = [savePanel runModalForDirectory:nil file:NSLocalizedString(@"ExportedBookmarkFile", @"Exported Bookmarks")]; - int selectedButton = [button indexOfSelectedItem]; if (saveResult != NSFileHandlingPanelOKButton) return; if (0 == selectedButton)