diff options
Diffstat (limited to 'extensions/test/ole/cpnt/cpnt.cxx')
-rw-r--r-- | extensions/test/ole/cpnt/cpnt.cxx | 110 |
1 files changed, 39 insertions, 71 deletions
diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index 3369e03d644b..ec7bac088b59 100644 --- a/extensions/test/ole/cpnt/cpnt.cxx +++ b/extensions/test/ole/cpnt/cpnt.cxx @@ -25,7 +25,7 @@ #include <stdio.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <uno/environment.h> #include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> @@ -390,88 +390,88 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( Sequence<sal_Int8> SAL_CALL OComponent::methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException ) { sal_Int8 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence<float> SAL_CALL OComponent::methodFloat(const Sequence< float>& aSeq) throw( RuntimeException ) { float _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence<double> SAL_CALL OComponent::methodDouble(const Sequence< double >& aSeq) throw( RuntimeException) { double _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Bool > SAL_CALL OComponent::methodBool(const Sequence< sal_Bool >& aSeq) throw( RuntimeException) { sal_Bool _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Int16 > SAL_CALL OComponent::methodShort(const Sequence< sal_Int16 >& aSeq) throw( RuntimeException ) { sal_Int16 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_uInt16 > SAL_CALL OComponent::methodUShort(const Sequence< sal_uInt16 >& aSeq) throw( RuntimeException ) { sal_uInt16 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException) { sal_Int32 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException) { sal_uInt32 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString >& aSeq) throw( RuntimeException) { OUString _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException) { sal_Unicode _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) throw( RuntimeException) { Any _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; TypeClass _t= _x.getValueTypeClass(); if( _t== TypeClass_STRING) OUString s(* (rtl_uString**)_x.getValue()); @@ -483,8 +483,8 @@ Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) thro Sequence< Type > SAL_CALL OComponent::methodType(const Sequence< Type >& aSeq) throw( RuntimeException ) { Type _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ - _x= aSeq.getConstArray()[i]; + for( const auto& i : aSeq.getConstArray() ){ + _x= i; } return aSeq; } @@ -1076,93 +1076,61 @@ void SAL_CALL OComponent::in_methodAll( // INOUT ----------------------------------------------------------------------------------- void SAL_CALL OComponent::testinout_methodByte(sal_Int8& rOut) throw( RuntimeException ) { - sal_Int8 tmp = rOut; - rOut = m_int8; - m_int8 = tmp; + std::swap( m_int8, rOut ); } void SAL_CALL OComponent::testinout_methodFloat(float& rOut) throw( RuntimeException ) { - float tmp = rOut; - rOut = m_float; - m_float = tmp; + std::swap( m_float, rOut ); } - void SAL_CALL OComponent::testinout_methodDouble(double& rOut) throw( RuntimeException ) { - double tmp = rOut; - rOut = m_double; - m_double = tmp; + std::swap( m_double, rOut ); } void SAL_CALL OComponent::testinout_methodBool(sal_Bool& rOut) throw( RuntimeException ) { - sal_Bool tmp = rOut; - rOut = m_bool; - m_bool = tmp; + std::swap( m_bool, rOut ); } void SAL_CALL OComponent::testinout_methodShort(sal_Int16& rOut) throw( RuntimeException ) { - sal_Int16 tmp= rOut; - rOut = m_int16; - m_int16 = tmp; + std::swap( m_int16, rOut ); } void SAL_CALL OComponent::testinout_methodUShort(sal_uInt16& rOut) throw( RuntimeException ) { - sal_uInt16 tmp = rOut; - rOut = m_uint16; - m_uint16 = tmp; + std::swap( m_uint16, rOut ); } void SAL_CALL OComponent::testinout_methodLong(sal_Int32& rOut) throw( RuntimeException ) { - sal_Int32 tmp = rOut; - rOut = m_int32; - m_int32 = tmp; + std::swap( m_int32, rOut ); } void SAL_CALL OComponent::testinout_methodULong(sal_uInt32& rOut) throw( RuntimeException ) { - sal_uInt32 tmp = rOut; - rOut = m_uint32; - m_uint32 = tmp; + std::swap( m_uint32, rOut ); } void SAL_CALL OComponent::testinout_methodHyper(sal_Int64& rOut) throw( RuntimeException ) { - sal_Int64 tmp = rOut; - rOut = m_int64; - m_int64 = tmp; + std::swap( m_int64, rOut ); } - void SAL_CALL OComponent::testinout_methodUHyper(sal_uInt64& rOut) throw( RuntimeException ) { - sal_uInt64 tmp = rOut; - rOut = m_uint64; - m_uint64 = tmp; + std::swap( m_uint64, rOut ); } - void SAL_CALL OComponent::testinout_methodString(OUString& rOut) throw( RuntimeException ) { - OUString tmp = rOut; - rOut = m_string; - m_string = tmp; + std::swap( m_string, rOut ); } void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException) { - sal_Unicode tmp = rOut; - rOut = m_char; - m_char = tmp; + std::swap( m_char, rOut ); } void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException) { - Any tmp = rOut; - rOut = m_any; - m_any = tmp; + std::swap( m_any, rOut ); } void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeException) { - Type tmp = rOut; - rOut = m_type; - m_type = tmp; + std::swap( m_type, rOut ); } - void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) { |