diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-24 14:54:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-24 14:54:51 +0200 |
commit | 9703cc63cea3c47d13afe5f9b0eb22c631000958 (patch) | |
tree | 65456e93a12de0f7f7303f7de7f72f683142b5e0 /bridges | |
parent | b39a778b5efa73936893a91b3223bb350bae1fb2 (diff) |
Remove o3tl/heap_ptr.hxx, use std::unique_ptr instead
Change-Id: Iac70c9be13892a36bfb5975f62e5345b88d4f144
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/jni_uno/jni_bridge.cxx | 6 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_data.cxx | 16 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_helper.h | 6 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_uno2java.cxx | 4 |
4 files changed, 17 insertions, 15 deletions
diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index ed71b694788f..ee382e539ae8 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -20,12 +20,12 @@ #include <sal/config.h> #include <cassert> +#include <memory> #include "jni_bridge.h" #include <boost/static_assert.hpp> #include "jvmaccess/unovirtualmachine.hxx" -#include "o3tl/heap_ptr.hxx" #include "rtl/ref.hxx" #include "rtl/strbuf.hxx" #include "uno/lbnames.h" @@ -310,7 +310,7 @@ void JNI_context::java_exc_occurred() const } jsize len = m_env->GetStringLength( (jstring) jo_descr.get() ); - o3tl::heap_ptr< rtl_mem > ustr_mem( + std::unique_ptr< rtl_mem > ustr_mem( rtl_mem::allocate( sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) ); rtl_uString * ustr = (rtl_uString *)ustr_mem.get(); @@ -386,7 +386,7 @@ OUString JNI_context::get_stack_trace( jobject jo_exc ) const { jsize len = m_env->GetStringLength( (jstring) jo_stack_trace.get() ); - o3tl::heap_ptr< rtl_mem > ustr_mem( + std::unique_ptr< rtl_mem > ustr_mem( rtl_mem::allocate( sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) ); rtl_uString * ustr = (rtl_uString *)ustr_mem.get(); diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index 60254849897d..81a1ca383161 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -20,10 +20,10 @@ #include <sal/config.h> #include <cassert> +#include <memory> #include "jni_bridge.h" -#include "o3tl/heap_ptr.hxx" #include "rtl/strbuf.hxx" #include "uno/sequence2.h" @@ -35,7 +35,7 @@ namespace jni_uno inline rtl_mem * seq_allocate( sal_Int32 nElements, sal_Int32 nSize ) { - o3tl::heap_ptr< rtl_mem > seq( + std::unique_ptr< rtl_mem > seq( rtl_mem::allocate( SAL_SEQUENCE_HEADER_SIZE + (nElements * nSize) ) ); uno_Sequence * p = (uno_Sequence *)seq.get(); p->nRefCount = 1; @@ -127,7 +127,7 @@ void createDefaultUnoValue( case typelib_TypeClass_SEQUENCE: { - o3tl::heap_ptr< rtl_mem > seq(seq_allocate(0, 0)); + std::unique_ptr< rtl_mem > seq(seq_allocate(0, 0)); if (assign) { uno_type_destructData(uno_data, type, 0); } @@ -561,7 +561,7 @@ void Bridge::map_to_uno( } else { - o3tl::heap_ptr< rtl_mem > mem( + std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (sal_Int64) ) ); *(jlong *) mem.get() = jni->CallLongMethodA( java_data.l, m_jni_info->m_method_Long_longValue, 0 ); @@ -579,7 +579,7 @@ void Bridge::map_to_uno( } else { - o3tl::heap_ptr< rtl_mem > mem( + std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (float) ) ); *(jfloat *) mem.get() = jni->CallFloatMethodA( java_data.l, m_jni_info->m_method_Float_floatValue, 0 ); @@ -599,7 +599,7 @@ void Bridge::map_to_uno( } else { - o3tl::heap_ptr< rtl_mem > mem( + std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (double) ) ); *(jdouble *) mem.get() = jni->CallDoubleMethodA( @@ -630,7 +630,7 @@ void Bridge::map_to_uno( case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: { - o3tl::heap_ptr< rtl_mem > mem( + std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( value_td.get()->nSize ) ); map_to_uno( jni, mem.get(), java_data, value_td.get()->pWeakRef, 0, @@ -972,7 +972,7 @@ void Bridge::map_to_uno( typelib_TypeDescriptionReference * element_type = ((typelib_IndirectTypeDescription *)td.get())->pType; - o3tl::heap_ptr< rtl_mem > seq; + std::unique_ptr< rtl_mem > seq; sal_Int32 nElements = jni->GetArrayLength( (jarray) java_data.l ); switch (element_type->eTypeClass) diff --git a/bridges/source/jni_uno/jni_helper.h b/bridges/source/jni_uno/jni_helper.h index ce16b6c587f2..1c67992e23f1 100644 --- a/bridges/source/jni_uno/jni_helper.h +++ b/bridges/source/jni_uno/jni_helper.h @@ -20,7 +20,9 @@ #ifndef INCLUDED_BRIDGES_SOURCE_JNI_UNO_JNI_HELPER_H #define INCLUDED_BRIDGES_SOURCE_JNI_UNO_JNI_HELPER_H -#include <o3tl/heap_ptr.hxx> +#include <sal/config.h> + +#include <memory> #include "jni_base.h" #include "jni_info.h" @@ -39,7 +41,7 @@ inline void jstring_to_ustring( else { jsize len = jni->GetStringLength( jstr ); - o3tl::heap_ptr< rtl_mem > mem( + std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) ); rtl_uString * ustr = (rtl_uString *)mem.get(); diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 6c035643daf8..337b24515752 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -20,8 +20,8 @@ #include <sal/config.h> #include <cassert> +#include <memory> -#include <o3tl/heap_ptr.hxx> #include <sal/alloca.h> #include "com/sun/star/uno/RuntimeException.hpp" @@ -95,7 +95,7 @@ void Bridge::handle_java_exc( + jni.get_stack_trace( jo_exc.get() ) ); } - o3tl::heap_ptr< rtl_mem > uno_data( rtl_mem::allocate( td.get()->nSize ) ); + std::unique_ptr< rtl_mem > uno_data( rtl_mem::allocate( td.get()->nSize ) ); jvalue val; val.l = jo_exc.get(); map_to_uno( |