Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Rename nsTypedSelection to mozilla::Selection

RESOLVED FIXED in mozilla16

Status

()

Core
Selection
--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: ayg, Assigned: ayg)

Tracking

Trunk
mozilla16
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
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.
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.