support of latest w3c dom spec changes

fixed a bug with unicode strings


git-svn-id: svn://10.0.0.236/trunk@72133 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sdv%sparc.spb.su
2000-06-13 21:22:35 +00:00
parent 0c33004b05
commit 010e6705be
13 changed files with 181 additions and 291 deletions

View File

@@ -427,6 +427,9 @@ void JavaDOMGlobals::Destroy(JNIEnv *env)
jobject JavaDOMGlobals::CreateNodeSubtype(JNIEnv *env,
nsIDOMNode *node)
{
if (!node)
return NULL;
PRUint16 nodeType = 0;
(void) node->GetNodeType(&nodeType);
@@ -597,3 +600,18 @@ void JavaDOMGlobals::ThrowException(JNIEnv *env,
// an exception is thrown in any case
}
nsString* JavaDOMGlobals::GetUnicode(JNIEnv *env,
jstring jstr)
{
jboolean iscopy = JNI_FALSE;
const jchar* name = env->GetStringChars(jstr, &iscopy);
if (!name) {
ThrowException(env, "GetStringChars failed");
return NULL;
}
nsString* ustr = new nsString((PRUnichar*)name,
env->GetStringLength(jstr));
env->ReleaseStringChars(jstr, name);
return ustr;
}