Closed Bug 762862 Opened 12 years ago Closed 12 years ago

Rename nsTypedSelection to mozilla::Selection

Categories

(Core :: DOM: Selection, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: ayg, Assigned: ayg)

Details

Attachments

(1 file)

What does "Typed" mean?  Nobody knows.  (At least, nobody I've spoken to.)  Now that nsTypedSelections are being more widely used -- see bug 693933, bug 762841 -- it makes sense to have a less mysterious name.
Flags: in-testsuite-
Component: Editor → Selection
QA Contact: editor → selection
Attached patch Patch v1Splinter Review
https://tbpl.mozilla.org/?tree=Try&rev=90743cdfeaa5

Hurry up before it bitrots!  :)

One thing I was unsure about: nsSelectionIterator was previously declared as "friend class nsSelectionIterator;" in nsTypedSelection.h inside nsTypedSelection, and otherwise only declared in nsSelection.cpp.  But when I changed nsTypedSelection to be in a namespace, it thought I meant mozilla::nsSelectionIterator.  But when I changed it to "friend class ::nsSelectionIterator;", it said that that doesn't name a type.  So I wound up forward-declaring "class nsSelectionIterator;" at the top of Selection.h.  Tell me if I should be doing something different -- I suspect I should.
Attachment #631360 - Flags: review?(ehsan)
(In reply to Aryeh Gregor from comment #0)
> What does "Typed" mean?  Nobody knows.  (At least, nobody I've spoken to.) 
> Now that nsTypedSelections are being more widely used -- see bug 693933, bug
> 762841 -- it makes sense to have a less mysterious name.

A selection class that you "type" in to your code?  ;-)
Attachment #631360 - Flags: review?(ehsan) → review+
(In reply to Aryeh Gregor from comment #1)
> Created attachment 631360 [details] [diff] [review]
> Patch v1
> 
> https://tbpl.mozilla.org/?tree=Try&rev=90743cdfeaa5
> 
> Hurry up before it bitrots!  :)
> 
> One thing I was unsure about: nsSelectionIterator was previously declared as
> "friend class nsSelectionIterator;" in nsTypedSelection.h inside
> nsTypedSelection, and otherwise only declared in nsSelection.cpp.  But when
> I changed nsTypedSelection to be in a namespace, it thought I meant
> mozilla::nsSelectionIterator.  But when I changed it to "friend class
> ::nsSelectionIterator;", it said that that doesn't name a type.  So I wound
> up forward-declaring "class nsSelectionIterator;" at the top of Selection.h.
> Tell me if I should be doing something different -- I suspect I should.

Yeah, "friend class" can only implicitly forward-declare the class if it's in the same namespace.  Now stop complaining about how C++ is not intuitive and whatnot!  :D
https://hg.mozilla.org/integration/mozilla-inbound/rev/dcd70e227b96

I rebased this to not be on top of bug 762841, so that I could push it ASAP and avoid bitrot.  (I already had to resolve one conflict.)
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/dcd70e227b96
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: