Closed Bug 230157 Opened 22 years ago Closed 19 years ago

nsDeviceContextSpecG prefs issues (wrong api)

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: sciguyryan)

References

Details

(Keywords: helpwanted, memory-leak, Whiteboard: [good first bug])

Attachments

(1 file, 4 obsolete files)

gfx/src/gtk/nsDeviceContextSpecG.cpp misuses prefs badly. See bug 225686 comment 6 for the leak (and misuse of the api in terms of ignoring the nsresult return) and see bug 225686 comment 14 for the fact that the deprecated prefs api is used. Chances are the xlib version has similar issues.
That's some impressive code right there, folks.
mlk keyword needed?
Keywords: helpwanted, mlk
Whiteboard: [good first bug]
Assignee: blizzard → mikael
Blocks: 175193
Status: NEW → ASSIGNED
Attached patch gtk patch (obsolete) — Splinter Review
bug 257381 removed the leak-part of this bug. This patch changes to use nsIPrefBranch + some small string code changes
Attachment #172813 - Flags: superreview?(roc)
Attachment #172813 - Flags: review?(bzbarsky)
Mikael, just my two cents. There's a file gfx/src/xlib/nsDeviceContextSpecXlib.cpp which serves the same purpose in the Xlib toolkit as nsDeviceContextSpecG.cpp does for gtk. You should create a patch for that file as well to keep the two toolkits in sync. This isn't hard to do; the two files are virtually identical other than the names of the identifiers. (There's a bug somewhere about replacing these two files with a single shared version, if you're looking for your next bug :-)
I don't know when I'll be able to get to this review; it will be at least a week...
Attachment #172813 - Attachment is obsolete: true
Attachment #172813 - Flags: superreview?(roc)
Attachment #172813 - Flags: review?(bzbarsky)
Summary: nsDeviceContextSpecG prefs usage issues (memory leaks, wrong api) → nsDeviceContextSpecG prefs issues (wrong api)
Attached patch Patch v2 (obsolete) — Splinter Review
Only requesting a review from bz for this one (not sure who to request a sr from). This patches: * mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp * mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp and * mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp I'm not sure if the last one is actually wanted here and I'll re-submit the patch without the modifications to that file if needed. If I missed any other files let me know. Patch based from the last patch submitted by Mikael Parknert.
Attachment #242333 - Flags: review?(bzbarsky)
I don't really know this code that well (either the prefs stuff or the code being patched). biesi, Neil, do you happen to know who's a good reviewer for the pref api changes?
Attachment #242333 - Attachment is obsolete: true
Attachment #242333 - Flags: review?(bzbarsky)
Removed Windows line endings.
Attachment #242344 - Attachment is obsolete: true
Attachment #242344 - Attachment description: Patch v2 → Patch v2 (Not including nsDeviceContextSpecQt changes)
Attachment #242344 - Attachment is obsolete: false
Comment on attachment 242345 [details] [diff] [review] Patch v2 (Inc. nsDeviceContextSpecQt.cpp changes) Per biesi requesting r,sr from roc.
Attachment #242345 - Flags: superreview?(roc)
Attachment #242345 - Flags: review?(roc)
(In reply to comment #0) >gfx/src/gtk/nsDeviceContextSpecG.cpp misuses prefs badly. Just looking at the file, nsPrinterFeatures ought to use a pref branch rather than concatenating strings all the time. (Who reads these prefs anyway?)
(In reply to comment #11) >(Who reads these prefs anyway?) As far as I understand it, the PrinterFeatures prefs (anything starting with "print.tmp.printerfeatures") are created by the the device context spec at the beginning of each print operation to list all of the printers and their capabilities. The prefs are then read by the print dialog to show the list of printers, paper sizes, and so on. There is an *amazing* amount of cruft in the printing interfaces...
Comment on attachment 242345 [details] [diff] [review] Patch v2 (Inc. nsDeviceContextSpecQt.cpp changes) I'd really like to see someone take ownership of this stuff and overhaul it properly, but for now we should definitely take this. Nice work.
Attachment #242345 - Flags: superreview?(roc)
Attachment #242345 - Flags: superreview+
Attachment #242345 - Flags: review?(roc)
Attachment #242345 - Flags: review+
Whiteboard: [good first bug] → [good first bug] [checkin needed]
I was going to land this patch, but it doesn't seem to apply cleanly to the current trunk.
Whiteboard: [good first bug] [checkin needed] → [good first bug]
Not actually sure what happened with that patch, I've gone through it and updated it to the latest trunk CVS so it should patch correctly now.
Assignee: mikael → sciguyryan+bugzilla
Attachment #242344 - Attachment is obsolete: true
Attachment #242345 - Attachment is obsolete: true
Whiteboard: [good first bug] → [good first bug] [checkin needed]
Checked in: Checking in gfx/src/qt/nsDeviceContextSpecQt.cpp; /cvsroot/mozilla/gfx/src/qt/nsDeviceContextSpecQt.cpp,v <-- nsDeviceContextSpecQt.cpp new revision: 1.5; previous revision: 1.4 done Checking in gfx/src/xlib/nsDeviceContextSpecXlib.cpp; /cvsroot/mozilla/gfx/src/xlib/nsDeviceContextSpecXlib.cpp,v <-- nsDeviceContextSpecXlib.cpp new revision: 1.52; previous revision: 1.51 done Checking in widget/src/gtk2/nsDeviceContextSpecG.cpp; /cvsroot/mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp,v <-- nsDeviceContextSpecG.cpp new revision: 1.74; previous revision: 1.73
Are there any other files that need patches? If not this can be marked as fixed. :)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug] [checkin needed] → [good first bug]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: