gecko-dev/editor
Masayuki Nakano 2773c4d0ef Bug 1310618 Replace nsresult variables |res| with |rv| under editor/ r=Ehsan
In our coding rules, variable names of nsresult should be rv.  Indeed, when you see |rv| in the code, you must assume that its type if nsresult.

However, a lot of code under editor/ uses |res| for the variables of nsresult.  Let's replace |res| with |rv|.

And this patch improves following points:

1. When |rv| is set in both |if| and |else| block and they are check outside of them, this moves the check into each |if| and |else| block because even if the failure is notified with warning, you cannot see which case was performed and failed.  This change makes it clear.

2. When |return rv;| returns non-error code because |rv| is checked with NS_ENSURE_SUCCESS() immediately before, setting replacing it with |return NS_OK;| is clearer.

3. Move declaration of |nsresult rv| into smaller scope as far as possible.  This prevents setting rv to unexpected value and easier to check its value at reading the code.

MozReview-Commit-ID: 9MAqj7sFey3

--HG--
extra : rebase_source : 0fd316b851ea616b3a95d8c1afc111ff55e11993
2016-10-19 18:09:33 +09:00
..
composer Bug 1310618 Replace nsresult variables |res| with |rv| under editor/ r=Ehsan 2016-10-19 18:09:33 +09:00
libeditor Bug 1310618 Replace nsresult variables |res| with |rv| under editor/ r=Ehsan 2016-10-19 18:09:33 +09:00
reftests Bug 1302993 - Update some stylo reftest expectations; r=heycam 2016-09-12 11:05:21 +05:30
txmgr Bug 1018486 - Part 2: Changes in editor/, r=masayuki 2016-09-07 10:50:37 -04:00
txtsvc Bug 1018486 - Part 2: Changes in editor/, r=masayuki 2016-09-07 10:50:37 -04:00
AsyncSpellCheckTestHelper.jsm
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
nsEditorCID.h
nsIContentFilter.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIDocumentStateListener.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIEditActionListener.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIEditor.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIEditorIMESupport.idl
nsIEditorMailSupport.idl Bug 1272893 - Remove nsISupportsArray from GetEmbeddedObjects() in editor. r=masayuki 2016-09-15 04:33:00 +02:00
nsIEditorObserver.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIEditorSpellCheck.idl Bug 1205983 - Remove all observer code from nsEditor. r=ehsan 2015-09-28 23:53:00 +02:00
nsIEditorStyleSheets.idl Bug 1244074 - Part 4: Use StyleSheetHandle instead of concrete style sheet class in most places. r=dholbert 2016-02-24 18:01:12 +11:00
nsIEditorUtils.idl Bug 1259517 - Make dropping images in editors work in e10s. r=baku 2016-06-21 15:17:37 -07:00
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1273001 - convert HTMLEditor::getLinkedObjects() to nsIArray. r=masayuki 2016-09-20 12:47:00 +02:00
nsIHTMLInlineTableEditor.idl
nsIHTMLObjectResizeListener.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIHTMLObjectResizer.idl
nsIPlaintextEditor.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsITableEditor.idl Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
nsIURIRefObject.idl
nsPIEditorTransaction.idl