Closed Bug 293268 Opened 19 years ago Closed 19 years ago

[ps] CUPS backend contains hardcoded "mozilla"

Categories

(Core :: Printing: Output, defect)

All
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: kherron+mozilla, Assigned: kherron+mozilla)

References

()

Details

Attachments

(1 file)

The CUPS printing backend uses the hardcoded string "mozilla print job" for
print job titles. At the least, the hardcoded "mozilla" needs to be removed for
branding reasons. Better would be to do the same thing xprint does; see bug 285911.
This adds a function to the print job class for setting the job title, with an
implementation for CUPS. The fallback title--which should almost never be
used--is based on the one being considered for Xprint.
Attachment #182980 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #182980 - Flags: review?(cbiesinger)
Status: NEW → ASSIGNED
Comment on attachment 182980 [details] [diff] [review]
Pass the document title to CUPS

>+        const char *title = mJobTitle.IsVoid() ?
>+            "Document without title" : mJobTitle.get();
I'd expect "Untitled Document" or some such. Seeing as this is ASCII, I suppose
localizing it would be tricky.

>+        nsCString mJobTitle;        // IsVoid() if no title
IIRC nsXPIDLCString automatically defaults to void, that would save you from
having to initialize it yourself.
Attachment #182980 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
(In reply to comment #2)
> (From update of attachment 182980 [details] [diff] [review] [edit])
> >+        const char *title = mJobTitle.IsVoid() ?
> >+            "Document without title" : mJobTitle.get();
> I'd expect "Untitled Document" or some such. Seeing as this is ASCII, I suppose
> localizing it would be tricky.

I was just copying the fallback title used by xprint (see bug 285911). I can go
with whatever fallback title people want to use. I agree with Peter Weilbacher
that these titles will almost never appear in practice so they're not worth
localizing.

> >+        nsCString mJobTitle;        // IsVoid() if no title
> IIRC nsXPIDLCString automatically defaults to void, that would save you from
> having to initialize it yourself.

Maybe this reflects my inexperience but I'd rather leave it the way it is. The
void flag on string objects doesn't seem to be widely used--I for one didn't
know about it until I started writing this patch--so the explicit initialization
makes the code more clear.
Attachment #182980 - Flags: review?(cbiesinger) → review?(bzbarsky)
Comment on attachment 182980 [details] [diff] [review]
Pass the document title to CUPS

r=bzbarsky
Attachment #182980 - Flags: review?(bzbarsky) → review+
Attachment #182980 - Flags: approval1.8b2?
Comment on attachment 182980 [details] [diff] [review]
Pass the document title to CUPS

a=caillon if you land quickly, though i'd much prefer "Untitled" or "Untitled
Document" -- let's let the xprint-isms die.
Attachment #182980 - Flags: approval1.8b2? → approval1.8b2+
Checked in with the fallback title "Untitled Document":

/cvsroot/mozilla/gfx/src/ps/nsDeviceContextPS.cpp,v  <--  nsDeviceContextPS.cpp
new revision: 1.73; previous revision: 1.72
done
Checking in gfx/src/ps/nsIPrintJobPS.h;
/cvsroot/mozilla/gfx/src/ps/nsIPrintJobPS.h,v  <--  nsIPrintJobPS.h
new revision: 1.4; previous revision: 1.3
done
Checking in gfx/src/ps/nsPrintJobPS.cpp;
/cvsroot/mozilla/gfx/src/ps/nsPrintJobPS.cpp,v  <--  nsPrintJobPS.cpp
new revision: 1.7; previous revision: 1.6
done
Checking in gfx/src/ps/nsPrintJobPS.h;
/cvsroot/mozilla/gfx/src/ps/nsPrintJobPS.h,v  <--  nsPrintJobPS.h
new revision: 1.5; previous revision: 1.4
Status: ASSIGNED → RESOLVED
Closed: 19 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: