Bug 716630 - Kill editor's warnings; r=ehsan
--- a/editor/Makefile.in
+++ b/editor/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
MODULE = editor
DIRS = public idl txtsvc libeditor txmgr composer
include $(topsrcdir)/config/rules.mk
--- a/editor/composer/src/Makefile.in
+++ b/editor/composer/src/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
MODULE = editor
LIBRARY_NAME = composer
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsComposerModule
--- a/editor/libeditor/base/Makefile.in
+++ b/editor/libeditor/base/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DIRS += tests
endif
MODULE = editor
--- a/editor/libeditor/html/Makefile.in
+++ b/editor/libeditor/html/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DIRS += tests
endif
MODULE = editor
--- a/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -9272,18 +9272,20 @@ nsHTMLEditRules::DocumentModifiedWorker(
return;
}
// DeleteNode below may cause a flush, which could destroy the editor
nsAutoScriptBlockerSuppressNodeRemoved scriptBlocker;
nsCOMPtr<nsIHTMLEditor> kungFuDeathGrip(mHTMLEditor);
nsCOMPtr<nsISelection> selection;
- nsresult res = mHTMLEditor->GetSelection(getter_AddRefs(selection));
- NS_ENSURE_SUCCESS(res, );
+ nsresult rv = mHTMLEditor->GetSelection(getter_AddRefs(selection));
+ if (NS_FAILED(rv)) {
+ return;
+ }
// Delete our bogus node, if we have one, since the document might not be
// empty any more.
if (mBogusNode) {
mEditor->DeleteNode(mBogusNode);
mBogusNode = nsnull;
}
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -5735,26 +5735,31 @@ nsHTMLEditor::ResetRootElementAndEventTa
nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
// Need to remove the event listeners first because BeginningOfDocument
// could set a new root (and event target is set by InstallEventListeners())
// and we won't be able to remove them from the old event target then.
RemoveEventListeners();
mRootElement = nsnull;
nsresult rv = InstallEventListeners();
- NS_ENSURE_SUCCESS(rv, );
+ if (NS_FAILED(rv)) {
+ return;
+ }
// We must have mRootElement now.
nsCOMPtr<nsIDOMElement> root;
rv = GetRootElement(getter_AddRefs(root));
- NS_ENSURE_SUCCESS(rv, );
- NS_ENSURE_TRUE(mRootElement, );
+ if (NS_FAILED(rv) || !mRootElement) {
+ return;
+ }
rv = BeginningOfDocument();
- NS_ENSURE_SUCCESS(rv, );
+ if (NS_FAILED(rv)) {
+ return;
+ }
// When this editor has focus, we need to reset the selection limiter to
// new root. Otherwise, that is going to be done when this gets focus.
nsCOMPtr<nsINode> node = GetFocusedNode();
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(node);
if (target) {
InitializeSelection(target);
}
--- a/editor/libeditor/html/nsWSRunObject.cpp
+++ b/editor/libeditor/html/nsWSRunObject.cpp
@@ -1848,16 +1848,17 @@ nsWSRunObject::GetAsciiWSBounds(PRInt16
*outEndOffset = endOffset;
return NS_OK;
}
nsresult
nsWSRunObject::FindRun(nsIDOMNode *aNode, PRInt32 aOffset, WSFragment **outRun, bool after)
{
+ *outRun = nsnull;
// given a dompoint, find the ws run that is before or after it, as caller needs
NS_ENSURE_TRUE(aNode && outRun, NS_ERROR_NULL_POINTER);
nsresult res = NS_OK;
WSFragment *run = mStartRun;
while (run)
{
PRInt16 comp = mHTMLEditor->sRangeHelper->ComparePoints(aNode, aOffset, run->mStartNode, run->mStartOffset);
--- a/editor/libeditor/text/Makefile.in
+++ b/editor/libeditor/text/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DIRS += tests
endif
MODULE = editor
--- a/editor/txmgr/src/Makefile.in
+++ b/editor/txmgr/src/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
MODULE = txmgr
LIBRARY_NAME = txmgr
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsTransactionManagerModule
--- a/editor/txmgr/tests/Makefile.in
+++ b/editor/txmgr/tests/Makefile.in
@@ -35,15 +35,16 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
CPP_UNIT_TESTS = TestTXMgr.cpp
include $(topsrcdir)/config/rules.mk
--- a/editor/txmgr/tests/TestTXMgr.cpp
+++ b/editor/txmgr/tests/TestTXMgr.cpp
@@ -4697,17 +4697,17 @@ aggregation_batch_stress_test()
PRInt32 iterations =
#ifdef DEBUG
10
#else
//
// 500 iterations sends 2,630,250 transactions through the system!!
//
- iterations = 500
+ 500
#endif
;
return stress_test(&factory, iterations);
}
int
main (int argc, char *argv[])
{
--- a/editor/txtsvc/src/Makefile.in
+++ b/editor/txtsvc/src/Makefile.in
@@ -34,16 +34,17 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
MODULE = txtsvc
LIBRARY_NAME = txtsvc_s
FORCE_STATIC_LIB = 1
MODULE_NAME = nsTextServicesModule
LIBXUL_LIBRARY = 1
--- a/editor/txtsvc/src/nsTextServicesDocument.cpp
+++ b/editor/txtsvc/src/nsTextServicesDocument.cpp
@@ -3258,21 +3258,21 @@ nsTextServicesDocument::SelectionIsValid
return(mSelStartIndex >= 0);
}
nsresult
nsTextServicesDocument::ComparePoints(nsIDOMNode* aParent1, PRInt32 aOffset1,
nsIDOMNode* aParent2, PRInt32 aOffset2,
PRInt32 *aResult)
{
- nsresult result;
-
+ *aResult = 0;
+
if (!sRangeHelper) {
- result = CallGetService("@mozilla.org/content/range-utils;1",
- &sRangeHelper);
+ nsresult result = CallGetService("@mozilla.org/content/range-utils;1",
+ &sRangeHelper);
NS_ENSURE_TRUE(sRangeHelper, result);
}
*aResult = sRangeHelper->ComparePoints(aParent1, aOffset1,
aParent2, aOffset2);
return NS_OK;
}