diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-07-23 13:48:34 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-07-23 13:48:34 +0000 |
commit | 24ef6ef652459c92fb355d6b983351b38a9b2339 (patch) | |
tree | 9ad3e5f868d23913f7fe4be1893e3d9ec134de90 /bridges/source/jni_uno | |
parent | 73d4f0dac7a316ebcdc66ad1e79a057e6f5fa5fb (diff) |
INTEGRATION: CWS sb20 (1.16.2); FILE MERGED
2004/07/02 13:16:19 sb 1.16.2.1: #i29740# When mapping ANYs from binary UNO to Java, do not lose information about type arguments of instantiated polymorphic struct types.
Diffstat (limited to 'bridges/source/jni_uno')
-rw-r--r-- | bridges/source/jni_uno/jni_data.cxx | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index 8c4219c77..89899cb56 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -2,9 +2,9 @@ * * $RCSfile: jni_data.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: obo $ $Date: 2004-06-04 03:00:39 $ + * last change: $Author: rt $ $Date: 2004-07-23 14:48:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1818,6 +1818,34 @@ void Bridge::map_to_java( } break; } + case typelib_TypeClass_STRUCT: + { + // Do not lose information about type arguments of instantiated + // polymorphic struct types: + rtl::OUString const & name = rtl::OUString::unacquired( + &pAny->pType->pTypeName); + OSL_ASSERT(name.getLength() > 0); + if (name[name.getLength() - 1] == '>') + { + // Box up in com.sun.star.uno.Any: + JLocalAutoRef jo_type(jni, create_type(jni, pAny->pType)); + jvalue java_data; + map_to_java( + jni, &java_data, pAny->pData, pAny->pType, 0, true, + false); + jo_any.reset(java_data.l); + jvalue args[2]; + args[0].l = jo_type.get(); + args[1].l = jo_any.get(); + jo_any.reset( + jni->NewObjectA( + m_jni_info->m_class_Any, + m_jni_info->m_ctor_Any_with_Type_Object, args)); + jni.ensure_no_exception(); + break; + } + // fall through + } default: { jvalue java_data; |