diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index d1f36eda2b42..3e3ed84b3aa4 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -1160,6 +1160,13 @@ void Bridge::map_to_java( bool in_param, bool out_param, bool special_wrapped_integral_types ) const { + // 4th param of Set*ArrayRegion changed from pointer to non-const to pointer + // to const between and ; work around that + // difference in a way that doesn't trigger loplugin:redundantcast: + void * data = const_cast(uno_data); + switch (type->eTypeClass) { case typelib_TypeClass_CHAR: @@ -1172,7 +1179,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetCharArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1182,7 +1189,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetCharArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1212,7 +1219,7 @@ void Bridge::map_to_java( { jni->SetBooleanArrayRegion( static_cast(jo_ar.get()), - 0, 1, static_cast(uno_data) ); + 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1223,7 +1230,7 @@ void Bridge::map_to_java( { jni->SetBooleanArrayRegion( static_cast(java_data->l), - 0, 1, static_cast(uno_data) ); + 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1252,7 +1259,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetByteArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1262,7 +1269,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetByteArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1292,7 +1299,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetShortArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1302,7 +1309,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetShortArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1332,7 +1339,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetIntArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1342,7 +1349,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetIntArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1372,7 +1379,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetLongArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1382,7 +1389,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetLongArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1411,7 +1418,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetFloatArrayRegion( - static_cast(jo_ar.get()), 0, 1, static_cast(uno_data) ); + static_cast(jo_ar.get()), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1421,7 +1428,7 @@ void Bridge::map_to_java( if (in_param) { jni->SetFloatArrayRegion( - static_cast(java_data->l), 0, 1, static_cast(uno_data) ); + static_cast(java_data->l), 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -1451,7 +1458,7 @@ void Bridge::map_to_java( { jni->SetDoubleArrayRegion( static_cast(jo_ar.get()), - 0, 1, static_cast(uno_data) ); + 0, 1, static_cast(data) ); jni.ensure_no_exception(); } java_data->l = jo_ar.release(); @@ -1462,7 +1469,7 @@ void Bridge::map_to_java( { jni->SetDoubleArrayRegion( static_cast(java_data->l), - 0, 1, static_cast(uno_data) ); + 0, 1, static_cast(data) ); jni.ensure_no_exception(); } } @@ -2081,7 +2088,7 @@ void Bridge::map_to_java( JLocalAutoRef jo_ar( jni ); sal_Int32 nElements; - uno_Sequence const * seq = 0; + uno_Sequence * seq = 0; if (in_param) { seq = *static_cast(uno_data); @@ -2105,7 +2112,7 @@ void Bridge::map_to_java( { jni->SetCharArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2116,7 +2123,7 @@ void Bridge::map_to_java( { jni->SetBooleanArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2127,7 +2134,7 @@ void Bridge::map_to_java( { jni->SetByteArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2139,7 +2146,7 @@ void Bridge::map_to_java( { jni->SetShortArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2151,7 +2158,7 @@ void Bridge::map_to_java( { jni->SetIntArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2163,7 +2170,7 @@ void Bridge::map_to_java( { jni->SetLongArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2174,7 +2181,7 @@ void Bridge::map_to_java( { jni->SetFloatArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break; @@ -2185,7 +2192,7 @@ void Bridge::map_to_java( { jni->SetDoubleArrayRegion( static_cast(jo_ar.get()), - 0, nElements, reinterpret_cast(seq->elements) ); + 0, nElements, reinterpret_cast(seq->elements) ); jni.ensure_no_exception(); } break;