[Libreoffice-commits] core.git: 3 commits - include/sal sfx2/source

Tor Lillqvist tml at collabora.com
Wed Jan 22 22:20:58 PST 2014


 include/sal/log-areas.dox        |    6 --
 sfx2/source/appl/app.cxx         |    4 -
 sfx2/source/appl/appinit.cxx     |    2 
 sfx2/source/appl/appopen.cxx     |    2 
 sfx2/source/bastyp/fltfnc.cxx    |    2 
 sfx2/source/control/objface.cxx  |   86 ++++++++++++++++++---------------------
 sfx2/source/doc/docfile.cxx      |    6 +-
 sfx2/source/doc/objcont.cxx      |    2 
 sfx2/source/doc/objstor.cxx      |   22 ++++-----
 sfx2/source/doc/sfxbasemodel.cxx |    4 -
 sfx2/source/view/frmload.cxx     |    2 
 11 files changed, 64 insertions(+), 74 deletions(-)

New commits:
commit 6479c8815eb1f01d691904d8080b3bca79c31c9c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Jan 23 08:19:48 2014 +0200

    Bin useless as96863, mb93783, mv76033 verbiage from SAL_INFO output
    
    Change-Id: I58b6c311e9f13e433468863e639467428e5b268e

diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index e58a1a5..039ae60 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -146,7 +146,7 @@ SfxApplication* SfxApplication::GetOrCreate()
     ::osl::MutexGuard aGuard(theApplicationMutex::get());
     if (!pApp)
     {
-        SAL_INFO( "sfx.appl", "sfx2 (mb93783) ::SfxApplication::SetApp" );
+        SAL_INFO( "sfx.appl", "SfxApplication::SetApp" );
 
         pApp = new SfxApplication;
 
@@ -180,7 +180,7 @@ SfxApplication* SfxApplication::GetOrCreate()
 SfxApplication::SfxApplication()
     : pAppData_Impl( 0 )
 {
-    SAL_INFO( "sfx.appl", "sfx2 (mb93783) ::SfxApplication::SfxApplication" );
+    SAL_INFO( "sfx.appl", "SfxApplication::SfxApplication" );
 
     SetName( OUString("StarOffice") );
     SvtViewOptions::AcquireOptions();
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index f59ebfe..98bca56 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -199,7 +199,7 @@ OUString GetSpecialCharsForEdit(Window* pParent, const Font& rFont)
 
 bool SfxApplication::Initialize_Impl()
 {
-    SAL_INFO( "sfx.appl", "sfx2 (mb93783) ::SfxApplication::Initialize_Impl" );
+    SAL_INFO( "sfx.appl", "SfxApplication::Initialize_Impl" );
 
 #ifdef TLX_VALIDATE
     StgIo::SetErrorLink( LINK( this, SfxStorageErrHdl, Error ) );
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 31ded84..2e83717 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -1126,7 +1126,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
 
 void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate )
 {
-    SAL_INFO( "sfx.bastyp", "sfx2 (as96863) ::SfxFilterContainer::ReadFilters" );
+    SAL_INFO( "sfx.bastyp", "SfxFilterContainer::ReadFilters" );
     if ( !pFilterArr )
         CreateFilterArr();
 
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index bd29707..963df13 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1798,7 +1798,7 @@ void SfxMedium::Transfer_Impl()
 
     if ( !aNameURL.isEmpty() && ( !pImp->m_eError || (pImp->m_eError & ERRCODE_WARNING_MASK) ) )
     {
-        SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxMedium::Transfer_Impl, copying to target" );
+        SAL_INFO( "sfx.doc", "SfxMedium::Transfer_Impl, copying to target" );
 
         Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv;
         Reference< XOutputStream > rOutStream;
@@ -2084,7 +2084,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
                                        const OUString& aExtension,
                                        const OUString& aDestDir )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxMedium::DoInternalBackup_Impl( with destdir )" );
+    SAL_INFO( "sfx.doc", "SfxMedium::DoInternalBackup_Impl( with destdir )" );
 
     if ( !pImp->m_aBackupURL.isEmpty() )
         return; // the backup was done already
@@ -2160,7 +2160,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
 //------------------------------------------------------------------
 void SfxMedium::DoBackup_Impl()
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxMedium::DoBackup_Impl" );
+    SAL_INFO( "sfx.doc", "SfxMedium::DoBackup_Impl" );
 
        // source file name is the logical name of this medium
     INetURLObject aSource( GetURLObject() );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 243f818..47331fd 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1767,7 +1767,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
 //------------------------------------------------------------------------
 sal_Bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMedium& rTargetMedium )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::DisconnectStorage_Impl" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::DisconnectStorage_Impl" );
 
     // this method disconnects the storage from source medium, and attaches it to the backup created by the target medium
 
@@ -1825,7 +1825,7 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl(
 */
 
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::ConnectTmpStorage_Impl" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::ConnectTmpStorage_Impl" );
 
     sal_Bool bResult = sal_False;
 
@@ -1961,7 +1961,7 @@ sal_Bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium )
 
 sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::DoSaveCompleted" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::DoSaveCompleted" );
 
     sal_Bool bOk = sal_True;
     sal_Bool bMedChanged = pNewMed && pNewMed!=pMedium;
@@ -3131,7 +3131,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage()
 
 sal_Bool SfxObjectShell::SaveChildren( sal_Bool bObjectsOnly )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SaveChildren" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SaveChildren" );
 
     sal_Bool bResult = sal_True;
     if ( pImp->mpObjectContainer )
@@ -3145,7 +3145,7 @@ sal_Bool SfxObjectShell::SaveChildren( sal_Bool bObjectsOnly )
 
 sal_Bool SfxObjectShell::SaveAsChildren( SfxMedium& rMedium )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SaveAsChildren" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SaveAsChildren" );
 
     sal_Bool bResult = sal_True;
 
@@ -3171,7 +3171,7 @@ sal_Bool SfxObjectShell::SaveAsChildren( SfxMedium& rMedium )
 
 sal_Bool SfxObjectShell::SaveCompletedChildren( sal_Bool bSuccess )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SaveCompletedChildren" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SaveCompletedChildren" );
 
     sal_Bool bResult = sal_True;
 
@@ -3208,7 +3208,7 @@ sal_Bool SfxObjectShell::SaveCompletedChildren( sal_Bool bSuccess )
 sal_Bool SfxObjectShell::SwitchChildrenPersistance( const uno::Reference< embed::XStorage >& xStorage,
                                                     sal_Bool bForceNonModified )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SwitchChildrenPersistence" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SwitchChildrenPersistence" );
 
     if ( !xStorage.is() )
     {
@@ -3227,7 +3227,7 @@ sal_Bool SfxObjectShell::SwitchChildrenPersistance( const uno::Reference< embed:
 // Never call this method directly, always use the DoSaveCompleted call
 sal_Bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xStorage )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SaveCompleted" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SaveCompleted" );
 
     sal_Bool bResult = sal_False;
     sal_Bool bSendNotification = sal_False;
@@ -3379,7 +3379,7 @@ sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::
 
 sal_Bool SfxObjectShell::SwitchPersistance( const uno::Reference< embed::XStorage >& xStorage )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::SwitchPersistance" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::SwitchPersistance" );
 
     sal_Bool bResult = sal_False;
 #ifdef DBG_UTIL
@@ -3414,7 +3414,7 @@ sal_Bool SfxObjectShell::SwitchPersistance( const uno::Reference< embed::XStorag
 sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< embed::XStorage >& xSource,
                                                          const uno::Reference< embed::XStorage >& xTarget )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::CopyStoragesOfUnknownMediaType" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::CopyStoragesOfUnknownMediaType" );
 
     // This method does not commit the target storage and should not do it
     sal_Bool bResult = sal_True;
@@ -3529,7 +3529,7 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted,
                                                     sal_Bool bIsTemplate,
                                                     const uno::Reference< embed::XStorage >& xStor )
 {
-    SAL_INFO( "sfx.doc", "sfx2 (mv76033) SfxObjectShell::GenerateAndStoreThumbnail" );
+    SAL_INFO( "sfx.doc", "SfxObjectShell::GenerateAndStoreThumbnail" );
 
     bIsInGenerateThumbnail = sal_True;//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
 
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 9e4f716..248ffd0 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -617,7 +617,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
 
     SolarMutexGuard aGuard;
 
-    SAL_INFO( "sfx.view", "sfx2 (mb93783) ::SfxFrameLoader::load" );
+    SAL_INFO( "sfx.view", "SfxFrameLoader::load" );
 
     ::comphelper::NamedValueCollection aDescriptor( rArgs );
 
commit 31f57cb6791da8a0c681b9e5865f04eda7503f9c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Jan 23 08:12:37 2014 +0200

    Use the "sfx" log area consistently in sfx2
    
    Change-Id: I497d2d93e1a1819ff709c94007ae98f5ef312e77

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 81309fd..8a1c305 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -231,13 +231,6 @@ certain functionality.
 @li @c sdext.pdfimport.pdfparse
 @li @c sdext.presenter
 
- at section sfx2
-
- at li @c sfx2
- at li @c sfx2.appl
- at li @c sfx2.control
- at li @c sfx2.doc
-
 @section sfx
 
 @li @c sfx
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index c15ce42..f1aca79 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1113,7 +1113,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 
             Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY );
             Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, aTarget, FrameSearchFlag::ALL ) : Reference < XDispatch >();;
-            SAL_INFO( "sfx2.appl", "PERFORMANCE - SfxApplication::OpenDocExec_Impl" );
+            SAL_INFO( "sfx.appl", "PERFORMANCE - SfxApplication::OpenDocExec_Impl" );
             if ( xDisp.is() )
                 xDisp->dispatch( aURL, aArgs );
         }
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 431078e..308b2ff 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -212,7 +212,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
         {
 
             if ( pNext->GetSlotId() <= pIter->GetSlotId() )
-                SAL_WARN( "sfx2.control", "Wrong order" );
+                SAL_WARN( "sfx.control", "Wrong order" );
 
             if ( pIter->GetKind() == SFX_KIND_ENUM )
             {
@@ -229,7 +229,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pSlave->GetSlotId()));
-                        SAL_WARN("sfx2.control", aStr.getStr());
+                        SAL_WARN("sfx.control", aStr.getStr());
                     }
 
                     if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() )
@@ -240,7 +240,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pSlave->GetSlotId()));
-                        SAL_WARN("sfx2.control", aStr.getStr());
+                        SAL_WARN("sfx.control", aStr.getStr());
                     }
 
                     pSlave = pSlave->pNextSlot;
@@ -258,7 +258,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pIter->pLinkedSlot->GetSlotId()));
-                        SAL_WARN("sfx2.control", aStr.getStr());
+                        SAL_WARN("sfx.control", aStr.getStr());
                     }
                 }
 
@@ -273,7 +273,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                             pCurSlot->GetSlotId()));
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(pIter->GetSlotId()));
-                        SAL_WARN("sfx2.control", aStr.getStr());
+                        SAL_WARN("sfx.control", aStr.getStr());
                     }
                 }
                 while ( pCurSlot != pIter );
@@ -353,7 +353,7 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const
     {
         if(pGenoType)
             return pGenoType->GetRealSlot(pSlot);
-        SAL_WARN( "sfx2.control", "unknown Slot" );
+        SAL_WARN( "sfx.control", "unknown Slot" );
         return 0;
     }
 
@@ -374,7 +374,7 @@ const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const
     {
         if(pGenoType)
             return pGenoType->GetRealSlot(nSlotId);
-        SAL_WARN( "sfx2.control", "unknown Slot" );
+        SAL_WARN( "sfx.control", "unknown Slot" );
         return 0;
     }
 
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index b3b8347..b05698b 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -163,7 +163,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent ) const
     aDevice.SetDigitLanguage( eLang );
 
     {
-        SAL_INFO( "sfx2.doc", "PERFORMANCE SfxObjectShell::CreatePreviewMetaFile_Impl" );
+        SAL_INFO( "sfx.doc", "PERFORMANCE SfxObjectShell::CreatePreviewMetaFile_Impl" );
         ((SfxObjectShell*)this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect );
     }
     pFile->Stop();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 33c1ee8..dba8794 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1556,7 +1556,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
                 io::IOException,
                 RuntimeException )
 {
-    SAL_INFO( "sfx2.doc", "PERFORMANCE - SfxBaseModel::storeSelf" );
+    SAL_INFO( "sfx.doc", "PERFORMANCE - SfxBaseModel::storeSelf" );
     SfxModelGuard aGuard( *this );
 
     if ( m_pData->m_pObjectShell.Is() )
@@ -1686,7 +1686,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const   OUString&                   rURL
                                         const   Sequence< beans::PropertyValue >&  rArgs   )
         throw (io::IOException, RuntimeException)
 {
-    SAL_INFO( "sfx2.doc", "PERFORMANCE - SfxBaseModel::storeAsURL" );
+    SAL_INFO( "sfx.doc", "PERFORMANCE - SfxBaseModel::storeAsURL" );
     SfxModelGuard aGuard( *this );
 
     if ( m_pData->m_pObjectShell.Is() )
commit 8293b29304716d6bd117ab233b1238e1385ae592
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Jan 23 07:19:24 2014 +0200

    Use assert() and SAL_WARN() instead of DBG_ASSERT() and OSL_FAIL()
    
    Change-Id: Id3be30bc95325e8f18cf8cb55da2217984a26035

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index a53727b..81309fd 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -235,6 +235,7 @@ certain functionality.
 
 @li @c sfx2
 @li @c sfx2.appl
+ at li @c sfx2.control
 @li @c sfx2.doc
 
 @section sfx
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 9242e94..431078e 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -17,8 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
+#include <assert.h>
 #include <stdlib.h>
+
+#include <sal/log.hxx>
+
 #include <tools/rcid.h>
 #include <tools/stream.hxx>
 
@@ -155,9 +158,8 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
         for ( pIter = pSlots; nIter <= nCount; ++pIter, ++nIter )
         {
 
-            DBG_ASSERT( nIter == nCount ||
-                        pIter->GetSlotId() != (pIter+1)->GetSlotId(),
-                        "doppelte SID" );
+            assert( nIter == nCount ||
+                    pIter->GetSlotId() != (pIter+1)->GetSlotId() );
 
             // every master refers to his first slave (ENUM),
             // all slaves refer to their master.
@@ -165,7 +167,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
             if ( pIter->GetKind() == SFX_KIND_ENUM )
             {
                 pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId );
-                DBG_ASSERT( pIter->pLinkedSlot, "slave without master" );
+                assert( pIter->pLinkedSlot );
                 if ( !pIter->pLinkedSlot->pLinkedSlot )
                     ( (SfxSlot*) pIter->pLinkedSlot)->pLinkedSlot = pIter;
 
@@ -210,7 +212,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
         {
 
             if ( pNext->GetSlotId() <= pIter->GetSlotId() )
-                OSL_FAIL("Wrong order!");
+                SAL_WARN( "sfx2.control", "Wrong order" );
 
             if ( pIter->GetKind() == SFX_KIND_ENUM )
             {
@@ -227,7 +229,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pSlave->GetSlotId()));
-                        OSL_FAIL(aStr.getStr());
+                        SAL_WARN("sfx2.control", aStr.getStr());
                     }
 
                     if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() )
@@ -238,7 +240,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pSlave->GetSlotId()));
-                        OSL_FAIL(aStr.getStr());
+                        SAL_WARN("sfx2.control", aStr.getStr());
                     }
 
                     pSlave = pSlave->pNextSlot;
@@ -256,7 +258,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(
                             pIter->pLinkedSlot->GetSlotId()));
-                        OSL_FAIL(aStr.getStr());
+                        SAL_WARN("sfx2.control", aStr.getStr());
                     }
                 }
 
@@ -271,7 +273,7 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                             pCurSlot->GetSlotId()));
                         aStr.append(" , ");
                         aStr.append(static_cast<sal_Int32>(pIter->GetSlotId()));
-                        OSL_FAIL(aStr.getStr());
+                        SAL_WARN("sfx2.control", aStr.getStr());
                     }
                 }
                 while ( pCurSlot != pIter );
@@ -290,7 +292,7 @@ SfxInterface::~SfxInterface()
     SfxModule *pMod = pImpData->pModule;
     sal_Bool bRegistered = pImpData->bRegistered;
     delete pImpData;
-    DBG_ASSERT( bRegistered, "Interface not registered!" );
+    assert( bRegistered );
     if ( bRegistered )
     {
         if ( pMod )
@@ -307,7 +309,9 @@ SfxInterface::~SfxInterface()
 const SfxSlot* SfxInterface::GetSlot( sal_uInt16 nFuncId ) const
 {
     DBG_CHKTHIS(SfxInterface, 0);
-    DBG_ASSERT( this && pSlots && nCount, "" );
+
+    assert( pSlots );
+    assert( nCount );
 
     // find the id using binary search
     void* p = bsearch( &nFuncId, pSlots, nCount, sizeof(SfxSlot),
@@ -341,13 +345,15 @@ const SfxSlot* SfxInterface::GetSlot( const OUString& rCommand ) const
 const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const
 {
     DBG_CHKTHIS(SfxInterface, 0);
-    DBG_ASSERT( this && pSlots && nCount, "" );
+
+    assert( pSlots );
+    assert( nCount );
 
     if ( !ContainsSlot_Impl(pSlot) )
     {
         if(pGenoType)
             return pGenoType->GetRealSlot(pSlot);
-        OSL_FAIL("unknown Slot");
+        SAL_WARN( "sfx2.control", "unknown Slot" );
         return 0;
     }
 
@@ -359,14 +365,16 @@ const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const
 const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const
 {
     DBG_CHKTHIS(SfxInterface, 0);
-    DBG_ASSERT( this && pSlots && nCount, "" );
+
+    assert( pSlots );
+    assert( nCount );
 
     const SfxSlot *pSlot = GetSlot(nSlotId);
     if ( !pSlot )
     {
         if(pGenoType)
             return pGenoType->GetRealSlot(nSlotId);
-        OSL_FAIL("unknown Slot");
+        SAL_WARN( "sfx2.control", "unknown Slot" );
         return 0;
     }
 
@@ -378,6 +386,7 @@ const SfxSlot* SfxInterface::GetRealSlot( sal_uInt16 nSlotId ) const
 void SfxInterface::RegisterPopupMenu( const ResId& rResId )
 {
     DBG_CHKTHIS(SfxInterface, 0);
+
     pImpData->aPopupRes = rResId;
 }
 
@@ -436,10 +445,8 @@ const ResId& SfxInterface::GetObjectBarResId( sal_uInt16 nNo ) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nObjBarCount = pImpData->aObjectBars.size();
-    DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" );
-#endif
+    assert( nNo<pImpData->aObjectBars.size() );
+
     return pImpData->aObjectBars[nNo]->aResId;
 }
 
@@ -460,10 +467,8 @@ sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nObjBarCount = pImpData->aObjectBars.size();
-    DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" );
-#endif
+    assert( nNo<pImpData->aObjectBars.size() );
+
     return pImpData->aObjectBars[nNo]->nPos;
 }
 
@@ -510,10 +515,8 @@ sal_uInt32 SfxInterface::GetChildWindowId (sal_uInt16 nNo) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nCWCount = pImpData->aChildWindows.size();
-    DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" );
-#endif
+    assert( nNo<pImpData->aChildWindows.size() );
+
     sal_uInt32 nRet = pImpData->aChildWindows[nNo]->aResId.GetId();
     if ( pImpData->aChildWindows[nNo]->bContext )
         nRet += sal_uInt32( nClassId ) << 16;
@@ -533,10 +536,8 @@ sal_uInt32 SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nCWCount = pImpData->aChildWindows.size();
-    DBG_ASSERT( nNo<nCWCount,"ChildWindow is unknown!" );
-#endif
+    assert( nNo<pImpData->aChildWindows.size() );
+
     return pImpData->aChildWindows[nNo]->nFeature;
 }
 
@@ -582,10 +583,8 @@ const OUString* SfxInterface::GetObjectBarName ( sal_uInt16 nNo ) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nObjBarCount = pImpData->aObjectBars.size();
-    DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" );
-#endif
+    assert( nNo<pImpData->aObjectBars.size() );
+
     return pImpData->aObjectBars[nNo]->pName;
 }
 
@@ -603,10 +602,8 @@ sal_uInt32 SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nObjBarCount = pImpData->aObjectBars.size();
-    DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" );
-#endif
+    assert( nNo<pImpData->aObjectBars.size() );
+
     return pImpData->aObjectBars[nNo]->nFeature;
 }
 
@@ -624,16 +621,15 @@ sal_Bool SfxInterface::IsObjectBarVisible(sal_uInt16 nNo) const
             nNo = nNo - nBaseCount;
     }
 
-#ifdef DBG_UTIL
-    sal_uInt16 nObjBarCount = pImpData->aObjectBars.size();
-    DBG_ASSERT( nNo<nObjBarCount,"Objectbar is unknown!" );
-#endif
+    assert( nNo<pImpData->aObjectBars.size() );
+
     return pImpData->aObjectBars[nNo]->bVisible;
 }
 
 const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealSlot ) const
 {
-    DBG_ASSERT( pImpData->bRegistered, "Interface not registered!" );
+    assert( pImpData->bRegistered );
+
     const SfxInterface* pInterface = this;
 
     // The slot could also originate from the interface of a shell base class.


More information about the Libreoffice-commits mailing list