changing api for 2 string to force a output type.

This commit is contained in:
mjudge%netscape.com 2000-05-13 08:01:47 +00:00
Родитель 11161e82c4
Коммит 8a236c5082
5 изменённых файлов: 23 добавлений и 7 удалений

Просмотреть файл

@ -37,6 +37,5 @@
void setHint(in boolean right);
boolean getHint();
noscript xpidl nsIEnumerator getEnumerator();
DOMString toString();
DOMString toString(in DOMString formatType, in unsigned long flags, in int wrapCount);
};

Просмотреть файл

@ -87,7 +87,7 @@ public:
NS_IMETHOD GetEnumerator(nsIEnumerator** aReturn)=0;
NS_IMETHOD ToString(nsString& aReturn)=0;
NS_IMETHOD ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 aWrapCount, nsString& aReturn)=0;
};
@ -115,7 +115,7 @@ public:
NS_IMETHOD SetHint(PRBool aRight); \
NS_IMETHOD GetHint(PRBool* aReturn); \
NS_IMETHOD GetEnumerator(nsIEnumerator** aReturn); \
NS_IMETHOD ToString(nsString& aReturn); \
NS_IMETHOD ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 aWrapCount, nsString& aReturn); \
@ -143,7 +143,7 @@ public:
NS_IMETHOD SetHint(PRBool aRight) { return _to SetHint(aRight); } \
NS_IMETHOD GetHint(PRBool* aReturn) { return _to GetHint(aReturn); } \
NS_IMETHOD GetEnumerator(nsIEnumerator** aReturn) { return _to GetEnumerator(aReturn); } \
NS_IMETHOD ToString(nsString& aReturn) { return _to ToString(aReturn); } \
NS_IMETHOD ToString(const nsString& aFormatType, PRUint32 aFlags, PRInt32 aWrapCount, nsString& aReturn) { return _to ToString(aFormatType, aFlags, aWrapCount, aReturn); } \
extern "C" NS_DOM nsresult NS_InitSelectionClass(nsIScriptContext *aContext, void **aPrototype);

Просмотреть файл

@ -22,6 +22,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "jsnum.h"
#include "nsJSUtils.h"
#include "nsDOMError.h"
#include "nscore.h"

Просмотреть файл

@ -22,6 +22,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "jsnum.h"
#include "nsJSUtils.h"
#include "nsDOMError.h"
#include "nscore.h"
@ -918,6 +919,9 @@ SelectionToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
nsIDOMSelection *nativeThis = (nsIDOMSelection*)nsJSUtils::nsGetNativeThis(cx, obj);
nsresult result = NS_OK;
nsAutoString nativeRet;
nsAutoString b0;
PRUint32 b1;
PRInt32 b2;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
@ -932,8 +936,19 @@ SelectionToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
if (NS_FAILED(result)) {
return nsJSUtils::nsReportError(cx, obj, result);
}
if (argc < 3) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
}
result = nativeThis->ToString(nativeRet);
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR);
}
if (!JS_ValueToInt32(cx, argv[2], (int32 *)&b2)) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR);
}
result = nativeThis->ToString(b0, b1, b2, nativeRet);
if (NS_FAILED(result)) {
return nsJSUtils::nsReportError(cx, obj, result);
}
@ -1001,7 +1016,7 @@ static JSFunctionSpec SelectionMethods[] =
{"removeSelectionListener", SelectionRemoveSelectionListener, 1},
{"setHint", SelectionSetHint, 1},
{"getHint", SelectionGetHint, 0},
{"toString", SelectionToString, 0},
{"toString", SelectionToString, 3},
{0}
};

Просмотреть файл

@ -22,6 +22,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "jsnum.h"
#include "nsJSUtils.h"
#include "nsDOMError.h"
#include "nscore.h"