Closed Bug 223243 Opened 21 years ago Closed 21 years ago

margins pref no longer works

Categories

(Core :: Printing: Output, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jblanco, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

In Mozilla you use to be able to have the following prefs set in all.js and
mozilla would print all documents with no margins.

pref("print.print_margin_bottom", "0.0");
pref("print.print_margin_left", "0.0");
pref("print.print_margin_right", "0.0");
pref("print.print_margin_top", "0.0");

You cannot do this anymore.  Now Mozilla will look to see if a specific printer
will have the settings and if not will then set the default margin values to
0.5.  I think the above prefs should still be able to be used.  They are
generic, not printer specific, and can be used as the default settings for every
printer that's used in Mozilla. This allows the user to set the default printer
margin settings to whatever they wish.
What mozilla does now is look for the specific printer setting and use that
margin setting. If there is no pref set, it will set the margin to 0.5. With my
patch mozilla will look for the specific printer setting first and will use
that margin setting. If the margin pref is not set, it will then look for the
generic pref without the appended printer name and will use that setting.  If
there is no specific printer or non specific printer margin pref set, it will
set the margin to 0.5.
Comment on attachment 133855 [details] [diff] [review]
patch to be able to use non printer specific margin prefs

strcmpi is so not portable :)
Attachment #133855 - Flags: review-
use:

nsCRT::strcasecmp
Attached patch using nsCRT::strcasecmp (obsolete) — Splinter Review
Attachment #133855 - Attachment is obsolete: true
Comment on attachment 134042 [details] [diff] [review]
using nsCRT::strcasecmp

> void nsPrintOptions::ReadInchesToTwipsPref(const char * aPrefId, 
>-                                           nscoord&     aTwips)
>+                                           nscoord&     aTwips,
>+                                           const char * aMarginPref)
> {
>   if (!mPrefBranch) {
>     return;
>@@ -1153,6 +1141,8 @@
>       aTwips = 0;
>     }
>     nsMemory::Free(str);
>+  } else if (nsCRT::strcasecmp(aPrefId, aMarginPref) ) {
>+      ReadInchesToTwipsPref(aMarginPref, aTwips, aMarginPref);
>   }
> }

sr=dbaron if, instead of adding a recursive call here, you do something like:

   nsresult rv = mPrefBranch->GetCharPref(aPrefId, &str);
+  if (NS_FAILED(rv) || !str)
+    rv = mPrefBranch->GetCharPref(aMarginPref, &str);
   if (NS_SUCCEEDED(rv) && str) {
Attachment #134042 - Attachment is obsolete: true
Attachment #134517 - Flags: review?(mkaply)
Attachment #134517 - Flags: review?(mkaply) → review+
I checked this in now
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: