B-1_14-DEV merge back to main
This commit is contained in:
@@ -611,6 +611,17 @@ JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantCurrency
|
||||
} else ThrowComFail(env, "putVariantCurrency failed", -1);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantLong
|
||||
(JNIEnv *env, jobject _this, jlong longValue)
|
||||
{
|
||||
VARIANT *v = extractVariant(env, _this);
|
||||
if (v) {
|
||||
VariantClear(v); // whatever was there before
|
||||
V_VT(v) = VT_I8;
|
||||
V_I8(v) = (LONGLONG)longValue;
|
||||
} else ThrowComFail(env, "putVariantLong failed", -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a dispatch object and sets the type to VT_DISPATCH.
|
||||
* There is currently no way to pass NULL into this method
|
||||
@@ -662,6 +673,18 @@ JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrency
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantLong
|
||||
(JNIEnv *env, jobject _this)
|
||||
{
|
||||
VARIANT *v = extractVariant(env, _this);
|
||||
if (v) {
|
||||
if (V_VT(v) != VT_I8) {
|
||||
return NULL;
|
||||
}
|
||||
return (jlong)V_I8(v);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantFloatRef
|
||||
(JNIEnv *env, jobject _this, jfloat val)
|
||||
@@ -689,6 +712,19 @@ JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantCurrencyRef
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantLongRef
|
||||
(JNIEnv *env, jobject _this, jlong longValue)
|
||||
{
|
||||
VARIANT *v = extractVariant(env, _this);
|
||||
if (v) {
|
||||
VariantClear(v); // whatever was there before
|
||||
LONGLONG *ps = (LONGLONG *)CoTaskMemAlloc(sizeof(LONGLONG));
|
||||
*ps = longValue;
|
||||
V_VT(v) = VT_I8|VT_BYREF;
|
||||
V_I8REF(v) = ps;
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_jacob_com_Variant_putVariantErrorRef
|
||||
(JNIEnv *env, jobject _this, jint i)
|
||||
{
|
||||
@@ -801,6 +837,19 @@ JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantCurrencyRef
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_jacob_com_Variant_getVariantLongRef
|
||||
(JNIEnv *env, jobject _this)
|
||||
{
|
||||
VARIANT *v = extractVariant(env, _this);
|
||||
if (v) {
|
||||
if (V_VT(v) != (VT_I8|VT_BYREF)) {
|
||||
return NULL;
|
||||
}
|
||||
return (jlong)*V_I8REF(v);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantErrorRef
|
||||
(JNIEnv *env, jobject _this)
|
||||
{
|
||||
@@ -1076,7 +1125,11 @@ JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantVariant
|
||||
VariantClear(v); // whatever was there before
|
||||
DECIMAL *pd = (DECIMAL *)CoTaskMemAlloc(sizeof(DECIMAL));
|
||||
pd->scale = scale;
|
||||
pd->sign = signum == 1?0:0x80;
|
||||
if (signum == 1 || signum == 0){
|
||||
pd->sign = 0;
|
||||
} else {
|
||||
pd->sign = 0x80;
|
||||
}
|
||||
pd->Hi32 = hi;
|
||||
pd->Mid32 = mid;
|
||||
pd->Lo32 = lo;
|
||||
@@ -1099,7 +1152,11 @@ JNIEXPORT jint JNICALL Java_com_jacob_com_Variant_getVariantVariant
|
||||
VariantClear(v); // whatever was there before
|
||||
d = (DECIMAL*)v;
|
||||
d->scale = scale;
|
||||
d->sign = signum == 1?0:0x80;
|
||||
if (signum == 1 || signum == 0){
|
||||
d->sign = 0;
|
||||
} else {
|
||||
d->sign = 0x80;
|
||||
}
|
||||
d->Hi32 = hi;
|
||||
d->Mid32 = mid;
|
||||
d->Lo32 = lo;
|
||||
|
||||
Reference in New Issue
Block a user