diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-16 10:13:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-16 12:12:31 +0200 |
commit | 4a96fb8ec0130e1036913093836bcf28bc37a49b (patch) | |
tree | e7aad9be4ca417e9e64f688cc99bee0638037741 /bridges/source/jni_uno | |
parent | f33b6e341fb7dd1ab3acd4fe5457b716be316e89 (diff) |
loplugin:bufferadd loosen some constraints
and extend O*StringView to have a constructor that takes a pointer and a
length
Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8
Reviewed-on: https://gerrit.libreoffice.org/80872
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bridges/source/jni_uno')
-rw-r--r-- | bridges/source/jni_uno/jni_data.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index feb9674563c5..daff48a48492 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -1786,11 +1786,7 @@ void Bridge::map_to_java( if (in_param) { // call static <enum_class>.fromInt( int ) - OStringBuffer sig_buf( 5 + class_name.getLength() ); - sig_buf.append( "(I)L" ); - sig_buf.append( class_name.replace( '.', '/' ) ); - sig_buf.append( ';' ); - OString sig( sig_buf.makeStringAndClear() ); + OString sig = "(I)L" + class_name.replace( '.', '/' ) + ";"; jmethodID method_id = jni->GetStaticMethodID( static_cast<jclass>(jo_enum_class.get()), "fromInt", sig.getStr() ); jni.ensure_no_exception(); @@ -2275,11 +2271,7 @@ void Bridge::map_to_java( if (0 < nElements) { // call static <enum_class>.fromInt( int ) - OStringBuffer sig_buf( 5 + class_name.getLength() ); - sig_buf.append( "(I)L" ); - sig_buf.append( class_name.replace( '.', '/' ) ); - sig_buf.append( ';' ); - OString sig( sig_buf.makeStringAndClear() ); + OString sig = "(I)L" + class_name.replace( '.', '/' ) + ";"; jmethodID method_id = jni->GetStaticMethodID( static_cast<jclass>(jo_enum_class.get()), "fromInt", sig.getStr() ); jni.ensure_no_exception(); |