diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-03-29 19:45:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-30 09:13:23 +0200 |
commit | 79b13b4d50549820684549ef77b2ec1c4def5b03 (patch) | |
tree | 79a855cab64c0ed1fd3c1fdcad627e2404ae620d /basic | |
parent | ffbcbbc8dcc946d4d91cc08a937c2067be5a18b7 (diff) |
OSL_ASSERT->assert in basic
Change-Id: I8abe14706e9c6d1323d5d66a8b700ddaa2803f2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91333
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr-x64.cxx | 26 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr-x86.cxx | 26 | ||||
-rw-r--r-- | basic/source/uno/dlgcont.cxx | 5 |
4 files changed, 33 insertions, 32 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 4ba943acaf05..deef49e6af1c 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -756,7 +756,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) typelib_TypeDescription * pTD = nullptr; aType.getDescription( &pTD ); - OSL_ASSERT( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE ); + assert( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE ); Type aElementType( reinterpret_cast<typelib_IndirectTypeDescription *>(pTD)->pType ); ::typelib_typedescription_release( pTD ); @@ -1320,7 +1320,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn OUString aClassName = xIdlTargetClass->getName(); typelib_TypeDescription * pSeqTD = nullptr; typelib_typedescription_getByName( &pSeqTD, aClassName.pData ); - OSL_ASSERT( pSeqTD ); + assert( pSeqTD ); Type aElemType( reinterpret_cast<typelib_IndirectTypeDescription *>(pSeqTD)->pType ); // convert all array member and register them @@ -1361,7 +1361,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn { OUString aTypeName = aCurType.getTypeName(); typelib_typedescription_getByName( &pSeqTD, aTypeName.pData ); - OSL_ASSERT( pSeqTD ); + assert( pSeqTD ); if( pSeqTD->eTypeClass == typelib_TypeClass_SEQUENCE ) { aCurType = Type( reinterpret_cast<typelib_IndirectTypeDescription *>(pSeqTD)->pType ); @@ -4565,7 +4565,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP } while( pParentBasic == nullptr && pCurObject != nullptr ); - OSL_ASSERT( pParentBasic != nullptr ); + assert( pParentBasic != nullptr ); registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); } diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index 00f3984f7216..0cc276192fbc 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -52,7 +52,7 @@ using namespace css; Missing support for functions returning structs (see TODO in call()). Missing support for additional data types (64 bit integers, Any, ...; would - trigger OSL_ASSERT(false) in various switches). + trigger assert(false) in various switches). It is assumed that the variables passed into SbiDllMgr::Call to represent the arguments and return value have types that exactly match the Declare @@ -145,7 +145,7 @@ template< typename T > void add( } std::size_t alignment(SbxVariable const * variable) { - OSL_ASSERT(variable != nullptr); + assert(variable != nullptr); if ((variable->GetType() & SbxARRAY) == 0) { switch (variable->GetType()) { case SbxINTEGER: @@ -171,7 +171,7 @@ std::size_t alignment(SbxVariable const * variable) { case SbxBYTE: return 1; default: - OSL_ASSERT(false); + assert(false); return 1; } } else { @@ -194,7 +194,7 @@ ErrCode marshal( ErrCode marshalString( SbxVariable * variable, bool special, MarshalData & data, void ** buffer) { - OSL_ASSERT(variable != nullptr && buffer != nullptr); + assert(variable != nullptr && buffer != nullptr); OString str; ErrCode e = convert(variable->GetOUString(), &str); if (e != ERRCODE_NONE) { @@ -211,7 +211,7 @@ ErrCode marshalStruct( SbxVariable const * variable, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != nullptr); + assert(variable != nullptr); SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject()); assert(pobj); SbxArray* props = pobj->GetProperties(); @@ -228,7 +228,7 @@ ErrCode marshalArray( SbxVariable const * variable, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != nullptr); + assert(variable != nullptr); SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() ); assert(arr); sal_Int32 dims = arr->GetDims32(); @@ -261,7 +261,7 @@ ErrCode marshal( bool outer, SbxVariable * variable, bool special, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != nullptr); + assert(variable != nullptr); SbxDataType eVarType = variable->GetType(); bool bByVal = !(variable->GetFlags() & SbxFlagBits::Reference); @@ -309,7 +309,7 @@ ErrCode marshal( add(blob, variable->GetByte(), outer ? 8 : 1, offset); break; default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -356,7 +356,7 @@ ErrCode marshal( break; } default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -382,7 +382,7 @@ template< typename T > T read(void const ** pointer) { } void const * unmarshal(SbxVariable * variable, void const * data) { - OSL_ASSERT(variable != nullptr); + assert(variable != nullptr); if ((variable->GetType() & SbxARRAY) == 0) { switch (variable->GetType()) { case SbxINTEGER: @@ -421,7 +421,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) { variable->PutByte(read< sal_uInt8 >(&data)); break; default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -616,7 +616,7 @@ ErrCode call( result.PutByte(static_cast< sal_uInt8 >(iRetVal)); break; default: - OSL_ASSERT(false); + assert(false); break; } for (sal_uInt32 i = 1; i < (arguments == nullptr ? 0 : arguments->Count32()); ++i) { @@ -639,7 +639,7 @@ ErrCode call( ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc) { - OSL_ASSERT(proc != nullptr); + assert(proc != nullptr); if (name.getLength() != 0 && name[0] == '@') { //TODO: "@" vs. "#"??? sal_Int32 n = name.copy(1).toInt32(); //TODO: handle bad input if (n <= 0 || n > 0xFFFF) { diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index a6a9e9609674..3220691bbd61 100644 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -52,7 +52,7 @@ using namespace css::uno; Missing support for functions returning structs (see TODO in call()). Missing support for additional data types (64 bit integers, Any, ...; would - trigger OSL_ASSERT(false) in various switches). + trigger assert(false) in various switches). It is assumed that the variables passed into SbiDllMgr::Call to represent the arguments and return value have types that exactly match the Declare @@ -152,7 +152,7 @@ template< typename T > void add( } std::size_t alignment(SbxVariable * variable) { - OSL_ASSERT(variable != 0); + assert(variable != 0); if ((variable->GetType() & SbxARRAY) == 0) { switch (variable->GetType()) { case SbxINTEGER: @@ -178,7 +178,7 @@ std::size_t alignment(SbxVariable * variable) { case SbxBYTE: return 1; default: - OSL_ASSERT(false); + assert(false); return 1; } } else { @@ -201,7 +201,7 @@ ErrCode marshal( ErrCode marshalString( SbxVariable * variable, bool special, MarshalData & data, void ** buffer) { - OSL_ASSERT(variable != 0 && buffer != 0); + assert(variable != 0 && buffer != 0); OString str; ErrCode e = convert(variable->GetOUString(), &str); if (e != ERRCODE_NONE) { @@ -219,7 +219,7 @@ ErrCode marshalStruct( SbxVariable * variable, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != 0); + assert(variable != 0); SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject()); assert(pobj); SbxArray* props = pobj->GetProperties(); @@ -236,7 +236,7 @@ ErrCode marshalArray( SbxVariable * variable, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != 0); + assert(variable != 0); SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() ); assert(arr); sal_Int32 dims = arr->GetDims32(); @@ -269,7 +269,7 @@ ErrCode marshal( bool outer, SbxVariable * variable, bool special, std::vector< char > & blob, std::size_t offset, MarshalData & data) { - OSL_ASSERT(variable != 0); + assert(variable != 0); SbxDataType eVarType = variable->GetType(); bool bByVal = !(variable->GetFlags() & SbxFlagBits::Reference); @@ -317,7 +317,7 @@ ErrCode marshal( add(blob, variable->GetByte(), outer ? 4 : 1, offset); break; default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -364,7 +364,7 @@ ErrCode marshal( break; } default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -390,7 +390,7 @@ template< typename T > T read(void const ** pointer) { } void const * unmarshal(SbxVariable * variable, void const * data) { - OSL_ASSERT(variable != 0); + assert(variable != 0); if ((variable->GetType() & SbxARRAY) == 0) { switch (variable->GetType()) { case SbxINTEGER: @@ -429,7 +429,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) { variable->PutByte(read< sal_uInt8 >(&data)); break; default: - OSL_ASSERT(false); + assert(false); break; } } else { @@ -556,7 +556,7 @@ ErrCode call( DllMgr_call32(proc.proc, address(stack), stack.size()))); break; default: - OSL_ASSERT(false); + assert(false); break; } for (sal_uInt32 i = 1; i < (arguments == 0 ? 0 : arguments->Count32()); ++i) { @@ -579,7 +579,7 @@ ErrCode call( ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc) { - OSL_ASSERT(proc != 0); + assert(proc != 0); if ( !name.isEmpty() && name[0] == '@' ) { //TODO: "@" vs. "#"??? sal_Int32 n = name.copy(1).toInt32(); //TODO: handle bad input if (n <= 0 || n > 0xFFFF) { diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index a3f8fd6f565e..c07fa682c909 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -33,7 +33,7 @@ #include <dlgcont.hxx> #include <comphelper/fileformat.h> #include <comphelper/processfactory.hxx> - +#include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <xmlscript/xmldlg_imexp.hxx> @@ -201,9 +201,10 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e } catch (const Exception& ) { + TOOLS_WARN_EXCEPTION("basic", ""); // if we cannot get the version then the // Oasis2OOoTransformer will not be used - OSL_ASSERT(false); + assert(false); } } |