Closed
Bug 751785
Opened 13 years ago
Closed 13 years ago
Make Selection.toString() API use DOMString instead of wstring
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: MatsPalmgren_bugz, Assigned: jhk)
Details
(Whiteboard: [good first bug][mentor=Ms2ger][lang=c++])
Attachments
(1 file, 1 obsolete file)
5.67 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Make Selection.toString() API use DOMString instead of wchar,
per bug 748961 comment 11.
Updated•13 years ago
|
Whiteboard: [good first bug][mentor=Ms2ger][lang=c++]
Comment 1•13 years ago
|
||
Need to change the declarations in
http://mxr.mozilla.org/mozilla-central/source/content/base/public/nsISelection.idl#165
http://mxr.mozilla.org/mozilla-central/source/content/base/public/nsISelectionPrivate.idl#88
to use "DOMString" instead of "wstring", and the implementations in
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSelection.cpp#1313
The PRUnichar** arguments should become nsAString& in nsTypedSelection::ToString and nsTypedSelection::ToStringWithFormat.
Summary: Make Selection.toString() API use DOMString instead of wchar → Make Selection.toString() API use DOMString instead of wstring
Comment 2•13 years ago
|
||
I'm looking at this bug as an introduction to the mozilla bug tracker and other things, but the PRUnichar** arguments are pointers to that type if im right, so changing them to nsAString& does what? Is that a type?
Comment 3•13 years ago
|
||
nsAString& is a writable abstract string type; see <https://developer.mozilla.org/En/Mozilla_internal_string_guide> for more information about it.
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #631322 -
Flags: feedback?(Ms2ger)
Comment 5•13 years ago
|
||
Comment on attachment 631322 [details] [diff] [review]
Patch(v1)
Review of attachment 631322 [details] [diff] [review]:
-----------------------------------------------------------------
This looks great; just a few comments. Can you fix those and ask :smaug to review?
::: content/base/public/nsISelection.idl
@@ +134,5 @@
>
> /**
> * Returns the whole selection into a plain text string.
> */
> + DOMString toString();
Update the uuid.
::: layout/generic/nsSelection.cpp
@@ +1094,5 @@
> // null if the Selection has been disconnected (the shell is Destroyed).
> nsCOMPtr<nsIPresShell> shell =
> mFrameSelection ? mFrameSelection->GetShell() : nsnull;
> if (!shell) {
> + aReturn = ToNewUnicode(EmptyString());
This should just be 'aReturn.Truncate();' now.
@@ +1145,1 @@
> return rv;
And these four lines can be 'return encoder->EncodeToString(aReturn);'
Attachment #631322 -
Flags: feedback?(Ms2ger) → feedback+
Assignee | ||
Comment 6•13 years ago
|
||
Attachment #631322 -
Attachment is obsolete: true
Attachment #631333 -
Flags: review?(bugs)
Updated•13 years ago
|
Attachment #631333 -
Flags: review?(bugs) → review+
Updated•13 years ago
|
Assignee: nobody → jigneshhk1992
Keywords: checkin-needed
Updated•13 years ago
|
Keywords: checkin-needed
Comment 7•13 years ago
|
||
Updated•13 years ago
|
Flags: in-testsuite-
Target Milestone: --- → mozilla16
Comment 8•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 9•13 years ago
|
||
Ms2ger pushed a follow-up to comm-central fix bustage there as well.
https://hg.mozilla.org/comm-central/rev/1608d7734acb
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•