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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user