basctl/source/basicide/basobj3.cxx  |    4 ++--
 basctl/source/basicide/bastype2.cxx |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 807e15ba0a33ef5206bca56a6d54c1bf367af892
Author:     tuanorn <[email protected]>
AuthorDate: Sun Oct 26 00:42:23 2025 -0400
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Mon Dec 8 13:03:59 2025 +0100

    tdf#43157 basctl: clean up OSL_ENSURE
    
    Change-Id: Ie6efb6a6b16b3ec4ed960f65c920ae3a84999238
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192998
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Tested-by: Jenkins

diff --git a/basctl/source/basicide/basobj3.cxx 
b/basctl/source/basicide/basobj3.cxx
index 2f2aa8b6e5ee..4f19235a3b0a 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -231,7 +231,7 @@ BasicManager* FindBasicManager( StarBASIC const * pLib )
     for (auto const& doc : aDocuments)
     {
         BasicManager* pBasicMgr = doc.getBasicManager();
-        OSL_ENSURE( pBasicMgr, "basctl::FindBasicManager: no basic manager for 
the document!" );
+        SAL_WARN_IF( !pBasicMgr, "basctl.basicide", "basctl::FindBasicManager: 
no basic manager for the document!" );
         if ( !pBasicMgr )
             continue;
 
@@ -390,7 +390,7 @@ tools::Long HandleBasicError( StarBASIC const * pBasic )
         {
             bool bProtected = false;
             ScriptDocument aDocument( 
ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
-            OSL_ENSURE( aDocument.isValid(), "basctl::HandleBasicError: no 
document for the given BasicManager!" );
+            SAL_WARN_IF( !aDocument.isValid(), "basctl.basicide", 
"basctl::HandleBasicError: no document for the given BasicManager!" );
             if ( aDocument.isValid() )
             {
                 const OUString& aOULibName( pBasic->GetName() );
diff --git a/basctl/source/basicide/bastype2.cxx 
b/basctl/source/basicide/bastype2.cxx
index bc80d4b578ea..65c94ebb02d6 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -101,7 +101,7 @@ DocumentEntry::DocumentEntry (
     m_aDocument(std::move(aDocument)),
     m_eLocation(eLocation)
 {
-    OSL_ENSURE( m_aDocument.isValid(), "DocumentEntry::DocumentEntry: illegal 
document!" );
+    SAL_WARN_IF( !m_aDocument.isValid(), "basctl.basicide", 
"DocumentEntry::DocumentEntry: illegal document!" );
 }
 
 DocumentEntry::~DocumentEntry()
@@ -140,7 +140,7 @@ EntryDescriptor::EntryDescriptor (
     m_aName(std::move(aName)),
     m_eType(eType)
 {
-    OSL_ENSURE( m_aDocument.isValid(), "EntryDescriptor::EntryDescriptor: 
invalid document!" );
+    SAL_WARN_IF( !m_aDocument.isValid(), "basctl.basicide", 
"EntryDescriptor::EntryDescriptor: invalid document!" );
 }
 
 EntryDescriptor::EntryDescriptor (
@@ -160,7 +160,7 @@ EntryDescriptor::EntryDescriptor (
     m_aMethodName(std::move(aMethodName)),
     m_eType(eType)
 {
-    OSL_ENSURE( m_aDocument.isValid(), "EntryDescriptor::EntryDescriptor: 
invalid document!" );
+    SAL_WARN_IF( !m_aDocument.isValid(), "basctl.basicide", 
"EntryDescriptor::EntryDescriptor: invalid document!" );
 }
 
 SbTreeListBox::SbTreeListBox(std::unique_ptr<weld::TreeView> xControl, 
weld::Window* pTopLevel)
@@ -191,7 +191,7 @@ SbTreeListBox::~SbTreeListBox()
 
 void SbTreeListBox::ScanEntry( const ScriptDocument& rDocument, 
LibraryLocation eLocation )
 {
-    OSL_ENSURE( rDocument.isAlive(), "TreeListBox::ScanEntry: illegal 
document!" );
+    SAL_WARN_IF( !rDocument.isAlive(), "basctl.basicide", 
"TreeListBox::ScanEntry: illegal document!" );
     if ( !rDocument.isAlive() )
         return;
 
@@ -687,7 +687,7 @@ bool SbTreeListBox::IsEntryProtected(const weld::TreeIter* 
pEntry)
     {
         EntryDescriptor aDesc(GetEntryDescriptor(pEntry));
         const ScriptDocument& rDocument( aDesc.GetDocument() );
-        OSL_ENSURE( rDocument.isAlive(), "TreeListBox::IsEntryProtected: no 
document, or document is dead!" );
+        SAL_WARN_IF( !rDocument.isAlive(), "basctl.basicide", 
"TreeListBox::IsEntryProtected: no document, or document is dead!" );
         if ( rDocument.isAlive() )
         {
             const OUString& aOULibName( aDesc.GetLibName() );
@@ -748,7 +748,7 @@ OUString SbTreeListBox::GetRootEntryName( const 
ScriptDocument& rDocument, Libra
 
 OUString SbTreeListBox::GetRootEntryBitmaps(const ScriptDocument& rDocument)
 {
-    OSL_ENSURE( rDocument.isValid(), "TreeListBox::GetRootEntryBitmaps: 
illegal document!" );
+    SAL_WARN_IF( !rDocument.isValid(), "basctl.basicide", 
"TreeListBox::GetRootEntryBitmaps: illegal document!" );
     if (!rDocument.isValid())
         return OUString();
 
@@ -803,7 +803,7 @@ void SbTreeListBox::SetCurrentEntry (EntryDescriptor const 
& rDesc)
         );
     }
     ScriptDocument aDocument = aDesc.GetDocument();
-    OSL_ENSURE( aDocument.isValid(), "TreeListBox::SetCurrentEntry: invalid 
document!" );
+    SAL_WARN_IF( !aDocument.isValid(), "basctl.basicide", 
"TreeListBox::SetCurrentEntry: invalid document!" );
     LibraryLocation eLocation = aDesc.GetLocation();
     bool bRootEntry = FindRootEntry(aDocument, eLocation, *m_xScratchIter);
     if (bRootEntry)

Reply via email to