Bug 1660527 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Please also be aware of [nsIPrintSettings.clone()](https://searchfox.org/mozilla-central/rev/73e4e809df771baeb61635b25f53dfb44e930904/widget/nsIPrintSettings.idl#127) (and [nsIPrintSettings.assign()](https://searchfox.org/mozilla-central/rev/73e4e809df771baeb61635b25f53dfb44e930904/widget/nsIPrintSettings.idl#132)). That should(!) allow you to cache a copy of the default settings you fetch with createDefaultSettings() that you leave untouched, and then whenever you need a new settings object initialized with the printer's defaults you'd `.clone()` that and then add settings saved to prefs, settings changed by the user in the UI, etc.
Please also be aware of [nsIPrintSettings.clone()](https://searchfox.org/mozilla-central/rev/73e4e809df771baeb61635b25f53dfb44e930904/widget/nsIPrintSettings.idl#127) (and [nsIPrintSettings.assign()](https://searchfox.org/mozilla-central/rev/73e4e809df771baeb61635b25f53dfb44e930904/widget/nsIPrintSettings.idl#132)). That should(!) allow you to cache a copy of the default settings you fetch with createDefaultSettings() that you leave untouched, and then whenever you need a new settings object initialized with the printer's defaults you'd `.clone()` that vanilla settings object and then add settings saved to prefs, settings changed by the user in the UI, etc. to the clone.

Back to Bug 1660527 Comment 1