Closed
Bug 181442
Opened 23 years ago
Closed 23 years ago
Switch composer off of the deprecated nsIPref and start using nsIPrefBranch and friends
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: caillon, Assigned: caillon)
References
Details
Attachments
(1 file, 1 obsolete file)
|
19.86 KB,
patch
|
Brade
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
| Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
Comment on attachment 107140 [details] [diff] [review]
Proposed patch
Looks great; here's some little cleanup that shouldn't be too difficult.
change this to the preferred assignment style:
>Index: editor/composer/src/nsEditorSpellCheck.cpp
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
should be:
+ nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(kPrefServiceCID, &rv);
same change here:
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
I'd like to see some consistency for the do_GetService calls in this patch if
possible. In nsEditorSpellCheck.cpp and other places you use kPrefServiceCID
and define a static in the file but elsewhere (as in nsEditor.cpp and
nsTextEditRules.cpp) you use NS_PREFSERVICE_CONTRACTID. Am I missing something
subtle?
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
vs.
+ nsCOMPtr<nsIPrefBranch> prefBranch =
+ do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
See also:
>Index: editor/libeditor/html/nsHTMLCSSUtils.cpp
>Index: editor/libeditor/html/nsHTMLDataTransfer.cpp
>Index: editor/libeditor/html/nsHTMLEditRules.cpp
>Index: editor/libeditor/text/nsEditorEventListeners.cpp
>Index: editor/libeditor/text/nsPlaintextEditor.cpp
use assignment form here:
>Index: editor/libeditor/html/nsHTMLEditRules.cpp
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &res));
and here:
>Index: editor/libeditor/text/nsEditorEventListeners.cpp
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
and here:
>Index: editor/libeditor/text/nsPlaintextEditor.cpp
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(kPrefServiceCID, &rv));
and here:
>Index: editor/libeditor/text/nsTextEditRules.cpp
>+ nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
Attachment #107140 -
Flags: review-
Personally I prefer if we go with use of the NS_PREFSERVICE_CONTRACTID so we can
get rid of all the NS_DEFINE_CID declarations in each of our files that use prefs.
| Assignee | ||
Comment 4•23 years ago
|
||
The CIDs are gone, and I used the = operator for ctors instead.
Attachment #107140 -
Attachment is obsolete: true
Comment 5•23 years ago
|
||
Comment on attachment 107177 [details] [diff] [review]
Patch v2
HURRAY! r=brade
Attachment #107177 -
Flags: review+
Comment on attachment 107177 [details] [diff] [review]
Patch v2
sr=kin@netscape.com
Thanks for doing this!
Attachment #107177 -
Flags: superreview+
| Assignee | ||
Comment 7•23 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•