From 4d920b28d9d8158a7c6225c295250a97e39d92a6 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Thu, 6 May 2010 23:10:56 -0400 Subject: [PATCH] Bug 564050 - 'Save as PDF' should not fill in wrong titles for the Maemo file picker [r=vingtetun] --- mobile/chrome/content/browser-ui.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index 9b7d92aed5c1..6da8b8e96fe5 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -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;