Closed Bug 312208 Opened 21 years ago Closed 21 years ago

Carbon menu code cleanup

Categories

(Core Graveyard :: Widget: Mac, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(1 file, 1 obsolete file)

11.37 KB, patch
mark
: review+
bent.mozilla
: review+
mikepinkerton
: superreview+
Details | Diff | Splinter Review
When I was writing the Cocoa menus, I found a bunch of Carbon menu code that can be cleaned up. Even though we're not going to use it for much longer, it'll probably be a reference for some time to come. This bug is for landing some of the cleanup that can be done.
Attached patch patch v1.0 (obsolete) — — Splinter Review
Attachment #199325 - Flags: review?(mark)
Comment on attachment 199325 [details] [diff] [review] patch v1.0 In both headers, you have: +#import <Carbon/Carbon.h> #include, please. More importantly, in nsMenuBarX.cpp, you have: @@ -720,22 +691,16 @@ nsMenuBarX::ContentAppended( nsIDocument * aDocument, nsIContent * aContainer, PRInt32 aNewIndexInContainer) { - if ( aContainer == mMenuBarContent ) { - //Register(aContainer, ); - //InsertMenu ( aNewIndexInContainer ); - } + nsCOMPtr<nsIChangeObserver> obs; + Lookup(aContainer, getter_AddRefs(obs)); + if (obs) + obs->ContentInserted(aDocument, aContainer, aNewIndexInContainer); else { - nsCOMPtr<nsIChangeObserver> obs; - Lookup ( aContainer, getter_AddRefs(obs) ); - if ( obs ) - obs->ContentInserted ( aDocument, aContainer, aNewIndexInContainer ); [...] You're now doing Lookup even if aContainer == mMenuBarContent. That doesn't seem right.
Attachment #199325 - Flags: review?(mark) → review-
Attached patch patch v1.1 — — Splinter Review
nice catch
Attachment #199325 - Attachment is obsolete: true
Attachment #199354 - Flags: review?(mark)
Comment on attachment 199354 [details] [diff] [review] patch v1.1 Much better.
Attachment #199354 - Flags: review?(mark) → review+
Attachment #199354 - Flags: superreview?(mikepinkerton)
Attachment #199354 - Flags: review?(bent.mozilla) → review+
Comment on attachment 199354 [details] [diff] [review] patch v1.1 sr=pink
Attachment #199354 - Flags: superreview?(mikepinkerton) → superreview+
Landed on trunk.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: