[Libreoffice-commits] core.git: 2 commits - basegfx/source basic/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 30 07:13:59 UTC 2020


 basegfx/source/range/b2drangeclipper.cxx |    2 +-
 basic/source/classes/sbunoobj.cxx        |    8 ++++----
 basic/source/runtime/dllmgr-x64.cxx      |   26 +++++++++++++-------------
 basic/source/runtime/dllmgr-x86.cxx      |   26 +++++++++++++-------------
 basic/source/uno/dlgcont.cxx             |    5 +++--
 5 files changed, 34 insertions(+), 33 deletions(-)

New commits:
commit 781ed42935e5250ca7bf2d51b2cce52cdb2836b8
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Mar 29 19:39:13 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Mar 30 09:13:37 2020 +0200

    OSL_ASSERT->assert in basegfx
    
    Change-Id: I7ff49d327e435e2d6ea5f8bdcf7ce8d5302eea1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91332
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index 796551832dc3..3fe16599c290 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -725,7 +725,7 @@ namespace basegfx
                 if( nCurrPolyIdx == -1 )
                     nCurrPolyIdx=first->getTargetPolygonIndex();
 
-                OSL_ASSERT(nCurrPolyIdx != -1);
+                assert(nCurrPolyIdx != -1);
 
                 // second encounter of my rect -> second edge
                 // encountered, done
commit 79b13b4d50549820684549ef77b2ec1c4def5b03
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Mar 29 19:45:19 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Mar 30 09:13:23 2020 +0200

    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 at collabora.co.uk>

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);
         }
     }
 


More information about the Libreoffice-commits mailing list