Bug 564050 - 'Save as PDF' should not fill in wrong titles for the Maemo file picker [r=vingtetun]

This commit is contained in:
Mark Finkle 2010-05-06 23:10:56 -04:00
Родитель 0dc5af0133
Коммит 4d920b28d9
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -1035,7 +1035,12 @@ var PageActions = {
picker.init(window, strings.getString("pageactions.saveas.pdf"), Ci.nsIFilePicker.modeSave);
picker.appendFilter("PDF", "*.pdf");
picker.defaultExtension = "pdf";
picker.defaultString = contentWindow.document.title + ".pdf";
let fileName = getDefaultFileName(null, null, contentWindow.document, null);
#ifdef MOZ_PLATFORM_MAEMO
fileName = fileName.replace(/[\*\:\?]+/g, " ");
#endif
picker.defaultString = fileName + ".pdf";
let dnldMgr = Cc["@mozilla.org/download-manager;1"].getService(Ci.nsIDownloadManager);
picker.displayDirectory = dnldMgr.defaultDownloadsDirectory;