diff --git a/mozilla/content/base/public/MANIFEST b/mozilla/content/base/public/MANIFEST index 245cbe5ec1d..6ba56736eb3 100644 --- a/mozilla/content/base/public/MANIFEST +++ b/mozilla/content/base/public/MANIFEST @@ -1,6 +1,7 @@ # # This is a list of local files which get copied to the mozilla:dist:content directory # +nsContentErrors.h nsContentPolicyUtils.h nsContentUtils.h nsIAnonymousContent.h diff --git a/mozilla/content/base/public/Makefile.in b/mozilla/content/base/public/Makefile.in index d9fabef469e..5ce32b31c3c 100644 --- a/mozilla/content/base/public/Makefile.in +++ b/mozilla/content/base/public/Makefile.in @@ -33,6 +33,7 @@ EXPORTS = \ nsIContent.h \ nsIAnonymousContent.h \ nsIContentIterator.h \ +nsContentErrors.h \ nsContentPolicyUtils.h \ nsContentUtils.h \ nsIDocument.h \ diff --git a/mozilla/content/base/public/nsContentErrors.h b/mozilla/content/base/public/nsContentErrors.h new file mode 100644 index 00000000000..c46f50cf22c --- /dev/null +++ b/mozilla/content/base/public/nsContentErrors.h @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (original author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nsContentErrors_h___ +#define nsContentErrors_h___ + +/** Error codes for nsICSSParser::ParseAndAppendDeclaration */ +#define NS_CSS_PARSER_DROP_DECLARATION \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 0) + + +/** Error codes for nsIContent::GetAttr */ +// Returned if the attr exists and has a value +#define NS_CONTENT_ATTR_HAS_VALUE NS_OK + +// Returned if the attr exists but has no value +#define NS_CONTENT_ATTR_NO_VALUE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 1) + +// Returned if the attr does not exist +#define NS_CONTENT_ATTR_NOT_THERE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 2) + + +/** Error codes for nsIHTMLStyleSheet */ +// XXX this is not really used +#define NS_HTML_STYLE_PROPERTY_NOT_THERE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 3) + + +/** Error codes for MaybeTriggerAutoLink */ +#define NS_XML_AUTOLINK_EMBED \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 4) +#define NS_XML_AUTOLINK_NEW \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 5) +#define NS_XML_AUTOLINK_REPLACE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 6) +#define NS_XML_AUTOLINK_UNDEFINED \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 7) + +#endif // nsContentErrors_h___ diff --git a/mozilla/content/base/public/nsIContent.h b/mozilla/content/base/public/nsIContent.h index 4f951a1082c..feded8d5276 100644 --- a/mozilla/content/base/public/nsIContent.h +++ b/mozilla/content/base/public/nsIContent.h @@ -42,6 +42,7 @@ #include "nsISupports.h" #include "nsEvent.h" #include "nsAString.h" +#include "nsContentErrors.h" // Forward declarations class nsIAtom; @@ -546,16 +547,4 @@ public: #endif }; -// nsresult codes for GetAttr -/** Returned if the attr exists and has a value */ -#define NS_CONTENT_ATTR_HAS_VALUE NS_OK - -/** Returned if the attr exists but has no value */ -#define NS_CONTENT_ATTR_NO_VALUE \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,0) - -/** Returned if the attr does not exist */ -#define NS_CONTENT_ATTR_NOT_THERE \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1) - #endif /* nsIContent_h___ */ diff --git a/mozilla/content/base/public/nsIStyledContent.h b/mozilla/content/base/public/nsIStyledContent.h index f51aad48d29..9b9a6f3339e 100644 --- a/mozilla/content/base/public/nsIStyledContent.h +++ b/mozilla/content/base/public/nsIStyledContent.h @@ -59,7 +59,7 @@ public: NS_IMETHOD GetID(nsIAtom*& aResult) const = 0; NS_IMETHOD GetClasses(nsVoidArray& aArray) const = 0; - NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const = 0; + NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const = 0; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) = 0; NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule) = 0; diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index b8d95191604..64eb27520fa 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -2234,10 +2234,10 @@ nsGenericElement::GetClasses(nsVoidArray& aArray) const return NS_OK; } -NS_IMETHODIMP +NS_IMETHODIMP_(PRBool) nsGenericElement::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const { - return NS_COMFALSE; + return PR_FALSE; } NS_IMETHODIMP diff --git a/mozilla/content/base/src/nsGenericElement.h b/mozilla/content/base/src/nsGenericElement.h index e05413f2ce4..8cd0b8e5413 100644 --- a/mozilla/content/base/src/nsGenericElement.h +++ b/mozilla/content/base/src/nsGenericElement.h @@ -415,7 +415,7 @@ public: // nsIStyledContent interface methods NS_IMETHOD GetID(nsIAtom*& aResult) const; NS_IMETHOD GetClasses(nsVoidArray& aArray) const; - NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; + NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule); NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index 227c7fe0794..744bb6fa19b 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -4528,9 +4528,6 @@ nsSelection::GetHint(HINT *aHintRight) -/** DeleteFromDocument - * will return NS_OK if it handles the event or NS_COMFALSE if not. - */ NS_IMETHODIMP nsSelection::DeleteFromDocument() { @@ -5017,7 +5014,7 @@ nsTypedSelection::RemoveItem(nsIDOMRange *aItem) return NS_OK; } } - return NS_COMFALSE; + return NS_OK; } diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index b0cd787e4df..de67870466a 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -2265,13 +2265,13 @@ nsGenericHTMLElement::GetClasses(nsVoidArray& aArray) const return NS_OK; } -nsresult +NS_IMETHODIMP_(PRBool) nsGenericHTMLElement::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const { - if (nsnull != mAttributes) { + if (mAttributes) { return mAttributes->HasClass(aClass, aCaseSensitive); } - return NS_COMFALSE; + return PR_FALSE; } nsresult diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.h b/mozilla/content/html/content/src/nsGenericHTMLElement.h index fa2bf4895a1..2e20b758fa6 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.h +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.h @@ -212,7 +212,7 @@ public: NS_IMETHOD GetHTMLAttribute(nsIAtom* aAttribute, nsHTMLValue& aValue) const; NS_IMETHOD GetID(nsIAtom*& aResult) const; NS_IMETHOD GetClasses(nsVoidArray& aArray) const; - NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; + NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule); NS_IMETHOD GetBaseURL(nsIURI*& aBaseURL) const; diff --git a/mozilla/content/html/style/public/nsICSSParser.h b/mozilla/content/html/style/public/nsICSSParser.h index cd5233da4e1..6f8dd0a33c2 100644 --- a/mozilla/content/html/style/public/nsICSSParser.h +++ b/mozilla/content/html/style/public/nsICSSParser.h @@ -114,10 +114,6 @@ public: #define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L) #define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L) -// Success code that can be returned from ParseAndAppendDeclaration() -#define NS_CSS_PARSER_DROP_DECLARATION \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1) - extern NS_EXPORT nsresult NS_NewCSSParser(nsICSSParser** aInstancePtrResult); diff --git a/mozilla/content/html/style/src/nsCSSParser.cpp b/mozilla/content/html/style/src/nsCSSParser.cpp index f22be3c5fe0..50583682c98 100644 --- a/mozilla/content/html/style/src/nsCSSParser.cpp +++ b/mozilla/content/html/style/src/nsCSSParser.cpp @@ -68,6 +68,7 @@ #include "nsINameSpaceManager.h" #include "nsINameSpace.h" #include "nsThemeConstants.h" +#include "nsContentErrors.h" #include "prprf.h" diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index 973b229a047..a3dd758968e 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -3952,7 +3952,7 @@ static PRBool SelectorMatches(RuleProcessorData &data, if (result) { nsAtomList* classList = aSelector->mClassList; while (nsnull != classList) { - if (localTrue == (NS_COMFALSE == data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) { + if (localTrue == (!data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) { result = PR_FALSE; break; } diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.cpp b/mozilla/content/html/style/src/nsHTMLAttributes.cpp index 6046003b7d5..48e291e12dd 100644 --- a/mozilla/content/html/style/src/nsHTMLAttributes.cpp +++ b/mozilla/content/html/style/src/nsHTMLAttributes.cpp @@ -1433,7 +1433,7 @@ nsHTMLAttributes::GetClasses(nsVoidArray& aArray) const return NS_OK; } -NS_IMETHODIMP +NS_IMETHODIMP_(PRBool) nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const { NS_PRECONDITION(aClass, "unexpected null pointer"); @@ -1442,7 +1442,7 @@ nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const if (aCaseSensitive) { do { if (classList->mAtom == aClass) - return NS_OK; + return PR_TRUE; classList = classList->mNext; } while (classList); } else { @@ -1457,12 +1457,12 @@ nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const classList->mAtom->GetUnicode(&class2Buf); nsDependentString class2(class2Buf); if (class1.Equals(class2, nsCaseInsensitiveStringComparator())) - return NS_OK; + return PR_TRUE; classList = classList->mNext; } while (classList); } } - return NS_COMFALSE; + return PR_FALSE; } #ifdef UNIQUE_ATTR_SUPPORT diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.h b/mozilla/content/html/style/src/nsHTMLAttributes.h index 907bc8ca28b..7c7e38e7a8d 100644 --- a/mozilla/content/html/style/src/nsHTMLAttributes.h +++ b/mozilla/content/html/style/src/nsHTMLAttributes.h @@ -231,7 +231,7 @@ public: NS_METHOD GetID(nsIAtom*& aResult) const; NS_METHOD GetClasses(nsVoidArray& aArray) const; - NS_METHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; + NS_METHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; NS_METHOD Clone(nsHTMLAttributes** aInstancePtrResult) const; diff --git a/mozilla/content/xml/content/public/nsIXMLContent.h b/mozilla/content/xml/content/public/nsIXMLContent.h index a387831658b..ed0c37dbc22 100644 --- a/mozilla/content/xml/content/public/nsIXMLContent.h +++ b/mozilla/content/xml/content/public/nsIXMLContent.h @@ -83,16 +83,6 @@ public: NS_IMETHOD GetXMLBaseURI(nsIURI **aURI) = 0; }; -// Some return values for MaybeTriggerAutoLink -#define NS_XML_AUTOLINK_EMBED \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 4) -#define NS_XML_AUTOLINK_NEW \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 5) -#define NS_XML_AUTOLINK_REPLACE \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 6) -#define NS_XML_AUTOLINK_UNDEFINED \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 7) - extern nsresult NS_NewXMLElement(nsIContent** aResult, nsINodeInfo* aNodeInfo); diff --git a/mozilla/content/xul/content/src/nsXULAttributes.cpp b/mozilla/content/xul/content/src/nsXULAttributes.cpp index 574120a6464..70e095c707f 100644 --- a/mozilla/content/xul/content/src/nsXULAttributes.cpp +++ b/mozilla/content/xul/content/src/nsXULAttributes.cpp @@ -737,10 +737,10 @@ nsXULAttributes::GetClasses(nsVoidArray& aArray) const return nsClassList::GetClasses(mClassList, aArray); } -nsresult +PRBool nsXULAttributes::HasClass(nsIAtom* aClass) const { - return nsClassList::HasClass(mClassList, aClass) ? NS_OK : NS_COMFALSE; + return nsClassList::HasClass(mClassList, aClass); } nsresult nsXULAttributes::SetClassList(nsClassList* aClassList) diff --git a/mozilla/content/xul/content/src/nsXULAttributes.h b/mozilla/content/xul/content/src/nsXULAttributes.h index d36c31ebcc3..e9ec8d2bd91 100644 --- a/mozilla/content/xul/content/src/nsXULAttributes.h +++ b/mozilla/content/xul/content/src/nsXULAttributes.h @@ -184,7 +184,7 @@ public: // Style Helpers nsresult GetClasses(nsVoidArray& aArray) const; - nsresult HasClass(nsIAtom* aClass) const; + PRBool HasClass(nsIAtom* aClass) const; nsresult SetClassList(nsClassList* aClassList); nsresult UpdateClassList(const nsAString& aValue); diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index f61c02b3f83..4a89e7b12b0 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -3784,7 +3784,7 @@ nsXULElement::GetClasses(nsVoidArray& aArray) const return NS_ERROR_NULL_POINTER; // XXXwaterson kooky error code to return, but... } -NS_IMETHODIMP +NS_IMETHODIMP_(PRBool) nsXULElement::HasClass(nsIAtom* aClass, PRBool /*aCaseSensitive*/) const { // XXXwaterson if we decide to lazily fault the class list in @@ -3793,9 +3793,9 @@ nsXULElement::HasClass(nsIAtom* aClass, PRBool /*aCaseSensitive*/) const return Attributes()->HasClass(aClass); if (mPrototype) - return nsClassList::HasClass(mPrototype->mClassList, aClass) ? NS_OK : NS_COMFALSE; + return nsClassList::HasClass(mPrototype->mClassList, aClass); - return NS_COMFALSE; + return PR_FALSE; } NS_IMETHODIMP diff --git a/mozilla/content/xul/content/src/nsXULElement.h b/mozilla/content/xul/content/src/nsXULElement.h index 2bfb2cf44fa..8e2665f3f36 100644 --- a/mozilla/content/xul/content/src/nsXULElement.h +++ b/mozilla/content/xul/content/src/nsXULElement.h @@ -473,7 +473,7 @@ public: // nsIStyledContent NS_IMETHOD GetID(nsIAtom*& aResult) const; NS_IMETHOD GetClasses(nsVoidArray& aArray) const; - NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; + NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule); diff --git a/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp b/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp index 3235b18cfca..8ba5204d7cc 100644 --- a/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp +++ b/mozilla/dom/src/base/nsScriptNameSpaceManager.cpp @@ -308,7 +308,7 @@ nsScriptNameSpaceManager::FillHashWithDOMInterfaces() nsCOMPtr if_info; nsXPIDLCString if_name; - for ( ; domInterfaces->IsDone() == NS_COMFALSE; domInterfaces->Next()) { + for ( ; domInterfaces->IsDone() == NS_ENUMERATOR_FALSE; domInterfaces->Next()) { rv = domInterfaces->CurrentItem(getter_AddRefs(entry)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp b/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp index 3235b18cfca..8ba5204d7cc 100644 --- a/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp +++ b/mozilla/dom/src/build/nsScriptNameSpaceManager.cpp @@ -308,7 +308,7 @@ nsScriptNameSpaceManager::FillHashWithDOMInterfaces() nsCOMPtr if_info; nsXPIDLCString if_name; - for ( ; domInterfaces->IsDone() == NS_COMFALSE; domInterfaces->Next()) { + for ( ; domInterfaces->IsDone() == NS_ENUMERATOR_FALSE; domInterfaces->Next()) { rv = domInterfaces->CurrentItem(getter_AddRefs(entry)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mozilla/extensions/python/xpcom/src/PyGBase.cpp b/mozilla/extensions/python/xpcom/src/PyGBase.cpp index 9579305f01a..b44e9de6bb5 100644 --- a/mozilla/extensions/python/xpcom/src/PyGBase.cpp +++ b/mozilla/extensions/python/xpcom/src/PyGBase.cpp @@ -517,7 +517,7 @@ static nsresult do_dispatch( method = PyObject_GetAttrString(real_ob, (char *)szMethodName); if ( !method ) { PyErr_Clear(); - ret = NS_COMFALSE; + ret = NS_PYXPCOM_NO_SUCH_METHOD; goto done; } // Make the call @@ -564,7 +564,7 @@ nsresult PyG_Base::InvokeNativeViaPolicy( nsresult nr = InvokeNativeViaPolicyInternal(szMethodName, ppResult, szFormat, va); va_end(va); - if (nr==NS_COMFALSE) { + if (nr == NS_PYXPCOM_NO_SUCH_METHOD) { // Only problem was missing method. PyErr_Format(PyExc_AttributeError, "The object does not have a '%s' function.", szMethodName); } @@ -587,7 +587,7 @@ nsresult PyG_Base::InvokeNativeGetViaPolicy( strncat(buf, szPropertyName, sizeof(buf)*sizeof(buf[0])-strlen(buf)-1); buf[sizeof(buf)/sizeof(buf[0])-1] = '\0'; ret = InvokeNativeViaPolicyInternal(buf, ppResult, nsnull, nsnull); - if (ret == NS_COMFALSE) { + if (ret == NS_PYXPCOM_NO_SUCH_METHOD) { // No method of that name - just try a property. // Bit to a hack here to maintain the use of a policy. // We actually get the policies underlying object @@ -637,7 +637,7 @@ nsresult PyG_Base::InvokeNativeSetViaPolicy( va_start(va, szPropertyName); ret = InvokeNativeViaPolicyInternal(buf, NULL, "O", va); va_end(va); - if (ret == NS_COMFALSE) { + if (ret == NS_PYXPCOM_NO_SUCH_METHOD) { // No method of that name - just try a property. // Bit to a hack here to maintain the use of a policy. // We actually get the policies underlying object diff --git a/mozilla/extensions/python/xpcom/src/PyXPCOM.h b/mozilla/extensions/python/xpcom/src/PyXPCOM.h index 32e4003a176..fca431d96c9 100644 --- a/mozilla/extensions/python/xpcom/src/PyXPCOM.h +++ b/mozilla/extensions/python/xpcom/src/PyXPCOM.h @@ -60,6 +60,9 @@ extern nsIID Py_nsIID_NULL; ************************************************************************** *************************************************************************/ +#define NS_PYXPCOM_NO_SUCH_METHOD \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_PYXPCOM, 0) + // The exception object (loaded from the xpcom .py code) extern PYXPCOM_EXPORT PyObject *PyXPCOM_Error; diff --git a/mozilla/js/src/xpconnect/src/xpccomponents.cpp b/mozilla/js/src/xpconnect/src/xpccomponents.cpp index ed1989b6eaa..06fb0ee6a3a 100644 --- a/mozilla/js/src/xpconnect/src/xpccomponents.cpp +++ b/mozilla/js/src/xpconnect/src/xpccomponents.cpp @@ -173,7 +173,7 @@ nsXPCComponents_Interfaces::NewEnumerate(nsIXPConnectWrappedNative *wrapper, while(1) { - if(NS_COMFALSE == e->IsDone() && + if(NS_ENUMERATOR_FALSE == e->IsDone() && NS_SUCCEEDED(e->CurrentItem(getter_AddRefs(isup))) && isup) { e->Next(); diff --git a/mozilla/layout/base/nsFrameManager.cpp b/mozilla/layout/base/nsFrameManager.cpp index d0e0d3e3a66..b020a6a7849 100644 --- a/mozilla/layout/base/nsFrameManager.cpp +++ b/mozilla/layout/base/nsFrameManager.cpp @@ -74,6 +74,7 @@ #include "nsUnicharUtils.h" #include "nsPrintfCString.h" #include "nsDummyLayoutRequest.h" +#include "nsLayoutErrors.h" #ifdef DEBUG //#define NOISY_DEBUG diff --git a/mozilla/layout/base/nsIFrameSelection.h b/mozilla/layout/base/nsIFrameSelection.h index 63eff1f1193..43842dc89ee 100644 --- a/mozilla/layout/base/nsIFrameSelection.h +++ b/mozilla/layout/base/nsIFrameSelection.h @@ -155,16 +155,14 @@ public: */ NS_IMETHOD ShutDown() = 0; - /** HandleKeyEvent will accept an event and frame and - * will return NS_OK if it handles the event or NS_COMFALSE if not. + /** HandleKeyEvent will accept an event. *

DOES NOT ADDREF

* @param aGuiEvent is the event that should be dealt with by aFocusFrame * @param aFrame is the frame that MAY handle the event */ NS_IMETHOD HandleTextEvent(nsGUIEvent *aGuiEvent) = 0; - /** HandleKeyEvent will accept an event and frame and - * will return NS_OK if it handles the event or NS_COMFALSE if not. + /** HandleKeyEvent will accept an event and a PresContext. *

DOES NOT ADDREF

* @param aGuiEvent is the event that should be dealt with by aFocusFrame * @param aFrame is the frame that MAY handle the event diff --git a/mozilla/layout/base/nsLayoutErrors.h b/mozilla/layout/base/nsLayoutErrors.h new file mode 100644 index 00000000000..da587a39c04 --- /dev/null +++ b/mozilla/layout/base/nsLayoutErrors.h @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (original author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nsLayoutErrors_h___ +#define nsLayoutErrors_h___ + +/** Error codes for nsITableLayout */ +#define NS_TABLELAYOUT_CELL_NOT_FOUND \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 0) + + +/** Error codes for frame property functions */ +#define NS_IFRAME_MGR_PROP_NOT_THERE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1) + +#define NS_IFRAME_MGR_PROP_OVERWRITTEN \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2) + + +/** Error codes for nsFrame::GetNextPrevLineFromeBlockFrame */ +#define NS_POSITION_BEFORE_TABLE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3) + +#endif // nsLayoutErrors_h___ diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 45df60a3adc..f111db6bc98 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -106,6 +106,7 @@ #include "nsIObserverService.h" // for reflow observation #include "nsIDocShell.h" // for reflow observation #include "nsIDOMRange.h" +#include "nsLayoutErrors.h" #ifdef MOZ_PERF_METRICS #include "nsITimeRecorder.h" #endif @@ -3353,7 +3354,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend) 0, //irrelavent since we set outsidelimit outsideLimit ); - if (NS_COMFALSE == result) //NS_COMFALSE should ALSO break + if (NS_POSITION_BEFORE_TABLE == result) //NS_POSITION_BEFORE_TABLE should ALSO break break; if (NS_OK != result || !pos.mResultFrame ) return result?result:NS_ERROR_FAILURE; diff --git a/mozilla/layout/base/public/MANIFEST b/mozilla/layout/base/public/MANIFEST index 224fde16a8d..452bc1ca9e7 100644 --- a/mozilla/layout/base/public/MANIFEST +++ b/mozilla/layout/base/public/MANIFEST @@ -40,6 +40,7 @@ nsIStyleContext.h nsIStyleFrameConstruction.h nsIStyleSet.h nsITextFrame.h +nsLayoutErrors.h nsReflowType.h nsStyleChangeList.h nsStyleConsts.h diff --git a/mozilla/layout/base/public/Makefile.in b/mozilla/layout/base/public/Makefile.in index 61dc12cdb39..792178ae314 100644 --- a/mozilla/layout/base/public/Makefile.in +++ b/mozilla/layout/base/public/Makefile.in @@ -66,6 +66,7 @@ nsIStatefulFrame.h \ nsIStyleContext.h \ nsIStyleFrameConstruction.h \ nsIStyleSet.h \ +nsLayoutErrors.h \ nsReflowType.h \ nsStyleChangeList.h \ nsStyleConsts.h \ diff --git a/mozilla/layout/base/public/nsIFrameManager.h b/mozilla/layout/base/public/nsIFrameManager.h index d080d4feaee..d67910dfddd 100644 --- a/mozilla/layout/base/public/nsIFrameManager.h +++ b/mozilla/layout/base/public/nsIFrameManager.h @@ -68,13 +68,6 @@ typedef void // Option flags for GetFrameProperty() member function #define NS_IFRAME_MGR_REMOVE_PROP 0x0001 -// nsresult error codes for frame property functions -#define NS_IFRAME_MGR_PROP_NOT_THERE \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1) - -#define NS_IFRAME_MGR_PROP_OVERWRITTEN \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2) - /** * Frame manager interface. The frame manager serves two purposes: *

  • provides a service for mapping from content to frame and from out-of-flow diff --git a/mozilla/layout/base/public/nsIFrameSelection.h b/mozilla/layout/base/public/nsIFrameSelection.h index 63eff1f1193..43842dc89ee 100644 --- a/mozilla/layout/base/public/nsIFrameSelection.h +++ b/mozilla/layout/base/public/nsIFrameSelection.h @@ -155,16 +155,14 @@ public: */ NS_IMETHOD ShutDown() = 0; - /** HandleKeyEvent will accept an event and frame and - * will return NS_OK if it handles the event or NS_COMFALSE if not. + /** HandleKeyEvent will accept an event. *

    DOES NOT ADDREF

    * @param aGuiEvent is the event that should be dealt with by aFocusFrame * @param aFrame is the frame that MAY handle the event */ NS_IMETHOD HandleTextEvent(nsGUIEvent *aGuiEvent) = 0; - /** HandleKeyEvent will accept an event and frame and - * will return NS_OK if it handles the event or NS_COMFALSE if not. + /** HandleKeyEvent will accept an event and a PresContext. *

    DOES NOT ADDREF

    * @param aGuiEvent is the event that should be dealt with by aFocusFrame * @param aFrame is the frame that MAY handle the event diff --git a/mozilla/layout/base/public/nsLayoutErrors.h b/mozilla/layout/base/public/nsLayoutErrors.h new file mode 100644 index 00000000000..da587a39c04 --- /dev/null +++ b/mozilla/layout/base/public/nsLayoutErrors.h @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jonas Sicking (original author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nsLayoutErrors_h___ +#define nsLayoutErrors_h___ + +/** Error codes for nsITableLayout */ +#define NS_TABLELAYOUT_CELL_NOT_FOUND \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 0) + + +/** Error codes for frame property functions */ +#define NS_IFRAME_MGR_PROP_NOT_THERE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1) + +#define NS_IFRAME_MGR_PROP_OVERWRITTEN \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2) + + +/** Error codes for nsFrame::GetNextPrevLineFromeBlockFrame */ +#define NS_POSITION_BEFORE_TABLE \ + NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3) + +#endif // nsLayoutErrors_h___ diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 156728ddf8d..f9b5c0fe7a6 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -75,6 +75,7 @@ #include "prenv.h" #include "plstr.h" #include "nsGUIEvent.h" +#include "nsLayoutErrors.h" #ifdef IBMBIDI #include "nsBidiPresUtils.h" @@ -6051,7 +6052,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext, if (resultFrame) { - if (NS_COMFALSE == result) + if (NS_POSITION_BEFORE_TABLE == result) { nsCOMPtr selCon; result = GetSelectionController(aPresContext, getter_AddRefs(selCon)); diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 54428438ed8..834045cb558 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -62,6 +62,7 @@ #include "nsCSSRendering.h" #include "nsTransform2D.h" #include "nsRegion.h" +#include "nsLayoutErrors.h" static NS_DEFINE_CID(kRegionCID, NS_REGION_CID); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index def3e3a3f6e..7132d48b1fc 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -96,6 +96,7 @@ #include "nsILookAndFeel.h" #include "nsLayoutCID.h" #include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID +#include "nsLayoutErrors.h" static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);//for triple click pref static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID); @@ -3357,7 +3358,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext, aPos->mContentOffsetEnd = aPos->mContentOffset; //result frame is the result frames parent. resultFrame->GetParent(&aPos->mResultFrame); - return NS_COMFALSE; + return NS_POSITION_BEFORE_TABLE; } } } diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 227c7fe0794..744bb6fa19b 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -4528,9 +4528,6 @@ nsSelection::GetHint(HINT *aHintRight) -/** DeleteFromDocument - * will return NS_OK if it handles the event or NS_COMFALSE if not. - */ NS_IMETHODIMP nsSelection::DeleteFromDocument() { @@ -5017,7 +5014,7 @@ nsTypedSelection::RemoveItem(nsIDOMRange *aItem) return NS_OK; } } - return NS_COMFALSE; + return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 156728ddf8d..f9b5c0fe7a6 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -75,6 +75,7 @@ #include "prenv.h" #include "plstr.h" #include "nsGUIEvent.h" +#include "nsLayoutErrors.h" #ifdef IBMBIDI #include "nsBidiPresUtils.h" @@ -6051,7 +6052,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext, if (resultFrame) { - if (NS_COMFALSE == result) + if (NS_POSITION_BEFORE_TABLE == result) { nsCOMPtr selCon; result = GetSelectionController(aPresContext, getter_AddRefs(selCon)); diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 54428438ed8..834045cb558 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -62,6 +62,7 @@ #include "nsCSSRendering.h" #include "nsTransform2D.h" #include "nsRegion.h" +#include "nsLayoutErrors.h" static NS_DEFINE_CID(kRegionCID, NS_REGION_CID); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index def3e3a3f6e..7132d48b1fc 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -96,6 +96,7 @@ #include "nsILookAndFeel.h" #include "nsLayoutCID.h" #include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID +#include "nsLayoutErrors.h" static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);//for triple click pref static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID); @@ -3357,7 +3358,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext, aPos->mContentOffsetEnd = aPos->mContentOffset; //result frame is the result frames parent. resultFrame->GetParent(&aPos->mResultFrame); - return NS_COMFALSE; + return NS_POSITION_BEFORE_TABLE; } } } diff --git a/mozilla/layout/html/base/src/nsFrameManager.cpp b/mozilla/layout/html/base/src/nsFrameManager.cpp index d0e0d3e3a66..b020a6a7849 100644 --- a/mozilla/layout/html/base/src/nsFrameManager.cpp +++ b/mozilla/layout/html/base/src/nsFrameManager.cpp @@ -74,6 +74,7 @@ #include "nsUnicharUtils.h" #include "nsPrintfCString.h" #include "nsDummyLayoutRequest.h" +#include "nsLayoutErrors.h" #ifdef DEBUG //#define NOISY_DEBUG diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 45df60a3adc..f111db6bc98 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -106,6 +106,7 @@ #include "nsIObserverService.h" // for reflow observation #include "nsIDocShell.h" // for reflow observation #include "nsIDOMRange.h" +#include "nsLayoutErrors.h" #ifdef MOZ_PERF_METRICS #include "nsITimeRecorder.h" #endif @@ -3353,7 +3354,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend) 0, //irrelavent since we set outsidelimit outsideLimit ); - if (NS_COMFALSE == result) //NS_COMFALSE should ALSO break + if (NS_POSITION_BEFORE_TABLE == result) //NS_POSITION_BEFORE_TABLE should ALSO break break; if (NS_OK != result || !pos.mResultFrame ) return result?result:NS_ERROR_FAILURE; diff --git a/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h b/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h index aba3e8f5463..d28b00776e1 100644 --- a/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h +++ b/mozilla/layout/html/style/src/nsIHTMLStyleSheet.h @@ -79,7 +79,4 @@ extern NS_EXPORT nsresult extern NS_EXPORT nsresult NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult); -#define NS_HTML_STYLE_PROPERTY_NOT_THERE \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,2) - #endif /* nsIHTMLStyleSheet_h___ */ diff --git a/mozilla/layout/html/table/public/nsITableLayout.h b/mozilla/layout/html/table/public/nsITableLayout.h index 778cc066f89..8532520eb6e 100644 --- a/mozilla/layout/html/table/public/nsITableLayout.h +++ b/mozilla/layout/html/table/public/nsITableLayout.h @@ -45,11 +45,6 @@ class nsIDOMElement; #define NS_ITABLELAYOUT_IID \ { 0xa9222e6b, 0x437e, 0x11d3, { 0xb2, 0x27, 0x0, 0x40, 0x95, 0xe2, 0x7a, 0x10 }} - -#define NS_TABLELAYOUT_CELL_NOT_FOUND \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3) - - /** * nsITableLayout * interface for layout objects that act like tables. diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index a4e4607976d..7cdd38f4eab 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -75,6 +75,7 @@ #include "nsHTMLReflowCommand.h" #include "nsIFrameManager.h" #include "nsCSSRendering.h" +#include "nsLayoutErrors.h" diff --git a/mozilla/layout/style/nsCSSParser.cpp b/mozilla/layout/style/nsCSSParser.cpp index f22be3c5fe0..50583682c98 100644 --- a/mozilla/layout/style/nsCSSParser.cpp +++ b/mozilla/layout/style/nsCSSParser.cpp @@ -68,6 +68,7 @@ #include "nsINameSpaceManager.h" #include "nsINameSpace.h" #include "nsThemeConstants.h" +#include "nsContentErrors.h" #include "prprf.h" diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index 973b229a047..a3dd758968e 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -3952,7 +3952,7 @@ static PRBool SelectorMatches(RuleProcessorData &data, if (result) { nsAtomList* classList = aSelector->mClassList; while (nsnull != classList) { - if (localTrue == (NS_COMFALSE == data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) { + if (localTrue == (!data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) { result = PR_FALSE; break; } diff --git a/mozilla/layout/style/nsICSSParser.h b/mozilla/layout/style/nsICSSParser.h index cd5233da4e1..6f8dd0a33c2 100644 --- a/mozilla/layout/style/nsICSSParser.h +++ b/mozilla/layout/style/nsICSSParser.h @@ -114,10 +114,6 @@ public: #define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L) #define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L) -// Success code that can be returned from ParseAndAppendDeclaration() -#define NS_CSS_PARSER_DROP_DECLARATION \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1) - extern NS_EXPORT nsresult NS_NewCSSParser(nsICSSParser** aInstancePtrResult); diff --git a/mozilla/layout/tables/nsITableLayout.h b/mozilla/layout/tables/nsITableLayout.h index 778cc066f89..8532520eb6e 100644 --- a/mozilla/layout/tables/nsITableLayout.h +++ b/mozilla/layout/tables/nsITableLayout.h @@ -45,11 +45,6 @@ class nsIDOMElement; #define NS_ITABLELAYOUT_IID \ { 0xa9222e6b, 0x437e, 0x11d3, { 0xb2, 0x27, 0x0, 0x40, 0x95, 0xe2, 0x7a, 0x10 }} - -#define NS_TABLELAYOUT_CELL_NOT_FOUND \ - NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3) - - /** * nsITableLayout * interface for layout objects that act like tables. diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index a4e4607976d..7cdd38f4eab 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -75,6 +75,7 @@ #include "nsHTMLReflowCommand.h" #include "nsIFrameManager.h" #include "nsCSSRendering.h" +#include "nsLayoutErrors.h" diff --git a/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp b/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp index 8a4cb347fe3..4e32b3ba10a 100644 --- a/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp +++ b/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp @@ -2419,7 +2419,7 @@ nsresult nsMsgDBEnumerator::PrefetchNext() else flags = 0; } - while (mFilter && mFilter(mResultHdr, mClosure) != NS_OK && !(flags & MSG_FLAG_EXPUNGED)); + while (mFilter && NS_FAILED(mFilter(mResultHdr, mClosure)) && !(flags & MSG_FLAG_EXPUNGED)); if (mResultHdr) { @@ -2601,7 +2601,7 @@ nsresult nsMsgDBThreadEnumerator::PrefetchNext() if (numChildren == 0) continue; } - if (mFilter && mFilter(mResultThread) != NS_OK) + if (mFilter && NS_FAILED(mFilter(mResultThread))) continue; else break; @@ -2642,7 +2642,7 @@ nsMsgFlagSetFilter(nsIMsgDBHdr *msg, void *closure) PRUint32 msgFlags, desiredFlags; desiredFlags = * (PRUint32 *) closure; msg->GetFlags(&msgFlags); - return (msgFlags & desiredFlags) ? NS_OK : NS_COMFALSE; + return (msgFlags & desiredFlags) ? NS_OK : NS_ERROR_FAILURE; } static nsresult @@ -2653,7 +2653,7 @@ nsMsgUnreadFilter(nsIMsgDBHdr* msg, void* closure) nsresult rv = db->IsHeaderRead(msg, &wasRead); if (NS_FAILED(rv)) return rv; - return !wasRead ? NS_OK : NS_COMFALSE; + return !wasRead ? NS_OK : NS_ERROR_FAILURE; } nsresult @@ -2686,7 +2686,7 @@ nsMsgReadFilter(nsIMsgDBHdr* msg, void* closure) nsresult rv = db->IsHeaderRead(msg, &wasRead); if (NS_FAILED(rv)) return rv; - return wasRead ? NS_OK : NS_COMFALSE; + return wasRead ? NS_OK : NS_ERROR_FAILURE; } // note that we can't just use EnumerateMessagesWithFlag(MSG_FLAG_READ) because we need diff --git a/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp b/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp index 3c19f289c3c..0cf805ac866 100644 --- a/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp +++ b/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp @@ -802,7 +802,7 @@ nsresult nsMsgThreadEnumerator::Prefetch() nsMsgKey parentKey; nsMsgKey curKey; - if (mFilter && mFilter(mResultHdr, mClosure) != NS_OK) { + if (mFilter && NS_FAILED(mFilter(mResultHdr, mClosure))) { mResultHdr = nsnull; continue; } @@ -867,7 +867,7 @@ nsMsgThreadUnreadFilter(nsIMsgDBHdr* msg, void* closure) nsresult rv = db->IsHeaderRead(msg, &wasRead); if (NS_FAILED(rv)) return rv; - return !wasRead ? NS_OK : NS_COMFALSE; + return !wasRead ? NS_OK : NS_ERROR_FAILURE; } NS_IMETHODIMP nsMsgThread::EnumerateUnreadMessages(nsMsgKey parentKey, nsISimpleEnumerator* *result) diff --git a/mozilla/xpcom/base/nsError.h b/mozilla/xpcom/base/nsError.h index cf6ce170807..5fd3fed9320 100644 --- a/mozilla/xpcom/base/nsError.h +++ b/mozilla/xpcom/base/nsError.h @@ -89,6 +89,8 @@ #define NS_ERROR_MODULE_DOM_XPATH 22 #define NS_ERROR_MODULE_DOM_RANGE 23 #define NS_ERROR_MODULE_URILOADER 24 +#define NS_ERROR_MODULE_CONTENT 25 +#define NS_ERROR_MODULE_PYXPCOM 26 /* NS_ERROR_MODULE_GENERAL should be used by modules that do not * care if return code values overlap. Callers of methods that @@ -150,9 +152,6 @@ /* Standard "it worked" return value */ #define NS_OK 0 -/* The backwards COM false. This is deprecated, please do not use */ -#define NS_COMFALSE 1 - #define NS_ERROR_BASE ((nsresult) 0xC1F30000) /* Returned when an instance is not initialized */ diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index 644466e9f6b..47b055899da 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -593,7 +593,7 @@ PLDHashTableEnumeratorImpl::IsDone() if (!mCount || (mCurrent == mCount)) return NS_OK; - return NS_COMFALSE; + return NS_ENUMERATOR_FALSE; } NS_IMETHODIMP