Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Hi,

LibreO should compile with the attached changes.

Regards,

Jacek
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 2377fef..4676f13 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -206,7 +206,7 @@ void SwModule::StateOther(SfxItemSet &rSet)
                                             IsInsTblFormatNum( bWebView )));
             break;
             default:
-                DBG_ERROR("::StateOther: default");
+                OSL_ENSURE(false, "::StateOther: default");
         }
         nWhich = aIter.NextWhich();
     }
@@ -306,7 +306,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs
 {
     if ( m_pView )
     {
-        DBG_ERROR( "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the 
wizard!" );
+        OSL_ENSURE(false, "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing 
the wizard!" );
         return;
     }
 
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index c63d490..68172fd 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -828,7 +828,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
         {
             if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
             {
-                DBG_ERROR( "Copying of objects didn't work!" );
+                OSL_ENSURE(false, "Copying of objects didn't work!" );
             }
         }
 
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 3250151..02a8639 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1304,7 +1304,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                         }
                         catch(Exception& )
                         {
-                            DBG_ERROR("control acces failed");
+                            OSL_ENSURE(false, "control acces failed");
                         }
 
                         xFP->setTitle( SW_RESSTR( nStrId ));
@@ -1425,7 +1425,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
             }
         break;
 
-        default: DBG_ERROR("falscher Dispatcher");
+        default: OSL_ENSURE(false, "wrong Dispatcher");
     }
 }
 
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 9cc11af..a3d7276 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -692,7 +692,7 @@ sal_Bool  SwDocShell::LoadFrom( SfxMedium& rMedium )
         }
         else
         {
-            DBG_ERROR("Code removed!");
+            OSL_ENSURE(false, "Code removed!");
         }
 
         SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 3152a0a..2fbb55b 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -257,7 +257,7 @@ void  SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
                 break;
 
             default:
-                DBG_ERROR( "Invalid SlotId");
+                OSL_ENSURE(false, "Invalid SlotId");
         }
         nWhich = aIter.NextWhich();
     }
@@ -485,7 +485,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
                     break;
 
                     default:
-                        DBG_ERROR( "Invalid SlotId");
+                        OSL_ENSURE(false, "Invalid SlotId");
                 }
 
                 rReq.Done();
@@ -893,7 +893,7 @@ USHORT SwDocShell::ApplyStyles(const String &rName, USHORT nFamily,
             break;
         }
         default:
-            DBG_ERROR("Unknown family");
+            OSL_ENSURE(false, "Unknown family");
     }
     pSh->EndAllAction();
 
@@ -948,7 +948,7 @@ USHORT SwDocShell::DoWaterCan(const String &rName, USHORT nFamily)
                 break;
 
             default:
-                DBG_ERROR( "Unknown family");
+                OSL_ENSURE(false, "Unknown family");
         }
     }
     else
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 8d7ac28..cbcef9a 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -404,7 +404,7 @@ void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, BOOL /*bOnlyIfAva
             xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence()));
         }
         else {
-            DBG_ERROR("no selection supplier in the beamer!");
+            OSL_ENSURE(false, "no selection supplier in the beamer!");
         }
     }
 }
diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx
index b92b9f4..8c8ef22 100644
--- a/sw/source/ui/config/barcfg.cxx
+++ b/sw/source/ui/config/barcfg.cxx
@@ -30,7 +30,7 @@
 #include "precompiled_sw.hxx"
 
 
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <wrtsh.hxx>
@@ -58,7 +58,7 @@ SwToolbarConfigItem::SwToolbarConfigItem( BOOL bWeb ) :
     Sequence<OUString> aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
-    DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
     if(aValues.getLength() == aNames.getLength())
     {
         for(int nProp = 0; nProp < aNames.getLength(); nProp++)
diff --git a/sw/source/ui/config/dbconfig.cxx b/sw/source/ui/config/dbconfig.cxx
index 4161b7a..c49f457 100644
--- a/sw/source/ui/config/dbconfig.cxx
+++ b/sw/source/ui/config/dbconfig.cxx
@@ -31,7 +31,7 @@
 
 
 #include <dbconfig.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <swdbdata.hxx>
diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx
index 86bdbfb..bb84277 100644
--- a/sw/source/ui/config/modcfg.cxx
+++ b/sw/source/ui/config/modcfg.cxx
@@ -37,7 +37,7 @@
 #include <svl/mailenum.hxx>
 #include <svx/svxids.hrc>
 #include <editeng/svxenum.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 
 #include <tools/globname.hxx>
 #include <swtypes.hxx>
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 2f07abb..899ad9c 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -586,7 +586,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
     }
     else
     {
-        DBG_ERRORFILE( "Couldn't get PRODUCTNAME variable" );
+        OSL_ENSURE(false, "Couldn't get PRODUCTNAME variable" );
     }
 
     SvObjectServerList aObjS;
diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx
index 038c8a2..55a2f05 100644
--- a/sw/source/ui/config/prtopt.cxx
+++ b/sw/source/ui/config/prtopt.cxx
@@ -33,7 +33,7 @@
 #include <unotools/configmgr.hxx>
 #include <prtopt.hxx>
 #include <swprtopt.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index f9ad296..a1695c1 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -159,7 +159,7 @@ int SwBaseNumRules::Load(SvStream &rStream)
     // gleiche VERSION_40A wie das SP2 #55402#
     if(VERSION_40A == nVersion)
     {
-        DBG_ERROR("Version 364 ist nicht eindeutig #55402#");
+        OSL_ENSURE(false, "Version 364 is not clear #55402#");
     }
     else if( VERSION_30B == nVersion || VERSION_31B == nVersion ||
              ACT_NUM_VERSION >= nVersion )
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index c2dbe91..6b73704 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -317,7 +317,7 @@ SwTransferable::~SwTransferable()
 static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
 {
     SwDoc *const pDoc = rDocFac.GetDoc();
-    ASSERT( pDoc, "Document not found" );
+    OSL_ENSURE( pDoc, "Document not found" );
     if (pDoc)
     {
         pDoc->SetClipBoard( true );
@@ -622,7 +622,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
             const SvxFontHeightItem& rDefaultFontHeight = (const 
SvxFontHeightItem&)rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT);
 
             // SW should have no MasterPages
-            DBG_ASSERT(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
+            OSL_ENSURE(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
 
             for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++)
             {
@@ -1253,11 +1253,11 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
         switch( nClearedAction )
         {
         case EXCHG_OUT_ACTION_INSERT_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: was soll hier passieren?" );
+            OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: what should happen here?" );
             break;
 
         case EXCHG_OUT_ACTION_MOVE_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
+            OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: what should happen here?" )
             break;
 
 
@@ -1371,7 +1371,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
                 break;
 
             default:
-                ASSERT( pPt, "unbekanntes Format" );
+                OSL_ENSURE( pPt, "unknown format" );
             }
             break;
 
@@ -1447,7 +1447,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
                                                 nActionFlags, bMsg );
                 break;
             default:
-                ASSERT( FALSE, "unbekanntes Format" );
+                OSL_ENSURE( false, "unknown format" );
             }
 
             break;
@@ -1486,7 +1486,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
             break;
 
         default:
-            ASSERT( FALSE, "unbekannte Action" );
+            OSL_ENSURE(false, "unknown action" );
         }
     }
 
@@ -1762,7 +1762,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
         {
             if ( !rData.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, 
aObjDesc ) )
             {
-                DBG_ASSERT( !xStrm.is(), "An object without descriptor in clipboard!");
+                OSL_ENSURE( !xStrm.is(), "An object without descriptor in clipboard!");
             }
         }
         else
@@ -2029,7 +2029,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
         SotStorageStreamRef xStrm;
         if( !rData.GetSotStorageStream( SOT_FORMATSTR_ID_LINK, xStrm ))
         {
-            ASSERT( !&rWrtShell, "DDE Data not found." );
+            OSL_ENSURE( !&rWrtShell, "DDE Data not found." );
             return 0;
         }      //sinnvollen Fehler melden!!
 
@@ -2696,7 +2696,7 @@ BOOL SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData,
             String sExt( rFileName.Copy( nLen - 3 ));
             if( sExt.EqualsIgnoreCaseAscii( "url" ))
             {
-ASSERT( !&rFileName, "how do we read today .URL - Files?" );
+                OSL_ENSURE( !&rFileName, "how do we read today .URL - Files?" );
             }
         }
     }
@@ -3139,7 +3139,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
 {
     // erst den SelectionType erfragen, dann Action-Klammerung !!!!
     // (sonst wird nicht in eine TabellenSelektion gepastet!!!)
-    ASSERT( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
+    OSL_ENSURE( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
     if ( !pClpDocFac )
         return sal_False; // the return value of the SwFEShell::Paste also is BOOL!
 
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index a8f89b3..26ffa20 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -264,7 +264,7 @@ SvxLanguageItem SwAnnotationWin::GetLanguage(void)
         case SCRIPTTYPE_LATIN :    nLangWhichId = EE_CHAR_LANGUAGE ; break;
         case SCRIPTTYPE_ASIAN :    nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
         case SCRIPTTYPE_COMPLEX :  nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
-        default: DBG_ERROR("GetLanguage: wrong script tye");
+        default: OSL_ENSURE(false, "GetLanguage: wrong script type");
     }
     return SvxLanguageItem(mpFld->GetLanguage(),nLangWhichId);
 }
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e640f4a..93fb75b 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -240,7 +240,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
     if (pItem->ISA(SwRedline))
         mvPostItFlds.push_back(new SwRedCommentItem( static_cast<SwRedline*>(pItem), true, 
bFocus)) ;
     */
-    DBG_ASSERT(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new 
stuff was added");
+    OSL_ENSURE(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new 
stuff was added");
     StartListening(*pItem);
 }
 
@@ -316,7 +316,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
                 if ( mpView->GetDocShell() != &rBC )
                 {
                     // field to be removed is the broadcaster
-                    DBG_ERROR("Notification for removed SwFmtFld was not sent!");
+                    OSL_ENSURE(false, "Notification for removed SwFmtFld was not sent!");
                     RemoveItem(&rBC);
                 }
                 break;
@@ -375,7 +375,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
                 }
                 else
                 {
-                    DBG_ERROR( "Inserted field not in document!" );
+                    OSL_ENSURE(false, "Inserted field not in document!" );
                         }
                 break;
             }
@@ -491,7 +491,7 @@ bool SwPostItMgr::CalcRects()
             SwSidebarItem* pItem = (*i);
             if ( !pItem->UseElement() )
             {
-                DBG_ERROR("PostIt is not in doc or other wrong use");
+                OSL_ENSURE(false, "PostIt is not in doc or other wrong use");
                 bRepair = true;
                 continue;
             }
@@ -774,7 +774,7 @@ void SwPostItMgr::LayoutPostIts()
                                         (*i)->ShowAnchorOnly(Point(mPages[n]->mPageRect.Right(),
                                                                    mPages[n]->mPageRect.Bottom()));
                                 }
-                                DBG_ASSERT(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): 
note overlaps, but bScrollbar is not true");
+                                OSL_ENSURE(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): 
note overlaps, but bScrollbar is not true");
                             }
                         }
 
@@ -814,7 +814,7 @@ void SwPostItMgr::LayoutPostIts()
                     SwSidebarItem* pItem = (*i);
                     if ( !pItem->UseElement() )
                     {
-                        DBG_ERROR("PostIt is not in doc!");
+                        OSL_ENSURE(false, "PostIt is not in doc!");
                         bRepair = true;
                         continue;
                     }
@@ -847,13 +847,13 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
 {
     if ( mPages[aPage-1]->mList->empty() )
     {
-        DBG_ERROR("Notes SidePane painted but no rects and page lists calculated!");
+        OSL_ENSURE(false, "Notes SidePane painted but no rects and page lists calculated!");
         return false;
     }
 
     SwSidebarItem_iterator aItem = mPages[aPage-1]->mList->end();
     --aItem;
-    DBG_ASSERT ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
+    OSL_ENSURE ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
     if ((*aItem)->pPostIt)
     {
         const long aSidebarheight = mPages[aPage-1]->bScrollbar ? 
mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
@@ -866,7 +866,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
 
 void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
 {
-    DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
+    OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
     // do not scroll more than neccessary up or down
     if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && 
(lScroll<0)) )
         return;
@@ -1145,7 +1145,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> 
&aVisiblePostItList,cons
             // security check so we don't loop forever
             if (loop>MAX_LOOP_COUNT)
             {
-                DBG_ERROR("PostItMgr::Layout(): We are looping forever");
+                OSL_ENSURE(false, "PostItMgr::Layout(): We are looping forever");
                 break;
             }
         }
@@ -1444,7 +1444,7 @@ long SwPostItMgr::GetNextBorder()
         }
     }
 
-    DBG_ERROR("SwPostItMgr::GetNextBorder(): We have to find a next border here");
+    OSL_ENSURE(false, "SwPostItMgr::GetNextBorder(): We have to find a next border here");
     return -1;
 }
 
@@ -1534,7 +1534,7 @@ bool SwPostItMgr::IsHit(const Point &aPointPixel)
         if( nPageNum )
         {
             Rectangle aRect;
-            DBG_ASSERT(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
+            OSL_ENSURE(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
             aRect = mPages[nPageNum-1]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT
                     ? 
Rectangle(Point(aPageFrm.Left()-GetSidebarWidth()-GetSidebarBorderWidth(),aPageFrm.Top()),Size(GetSidebarWidth(),aPageFrm.Height()))
                     : Rectangle( Point(aPageFrm.Right()+GetSidebarBorderWidth(),aPageFrm.Top()) , 
Size(GetSidebarWidth(),aPageFrm.Height()));
@@ -1765,7 +1765,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/  )
     mnEventId = 0;
     if ( mbLayouting )
     {
-        DBG_ERROR("Reentrance problem in Layout Manager!");
+        OSL_ENSURE(false, "Reentrance problem in Layout Manager!");
         mbWaitingForCalcRects = false;
         return 0;
     }
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index 51c991c..72a9da5 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -493,7 +493,7 @@ void SwSidebarWin::SetPosAndSize()
             }
             break;
             default:
-                ASSERT( false,
+                OSL_ENSURE( false,
                         "<SwSidebarWin::SetPosAndSize()> - unexpected position of sidebar" );
             break;
         }
@@ -1258,7 +1258,7 @@ void SwSidebarWin::ChangeSidebarItem( SwSidebarItem& rSidebarItem )
     {
         SidebarWinAccessible* pAcc =
                         static_cast<SidebarWinAccessible*>( GetWindowPeer() );
-        ASSERT( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
+        OSL_ENSURE( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
                 "<SwSidebarWin::ChangeSidebarItem(..)> - unexpected type of window peer -> crash 
possible!" );
         pAcc->ChangeSidebarItem( mrSidebarItem );
     }
diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index f534194..ede176b 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -326,7 +326,7 @@ USHORT SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj )
         case OBJCNT_URLBUTTON: nDropDestination = EXCHG_DEST_DOC_URLBUTTON; break;
         case OBJCNT_GROUPOBJ:  nDropDestination = EXCHG_DEST_DOC_GROUPOBJ;             break;
 
-        default: ASSERT( !this, "new ObjectType?" );
+        default: OSL_ENSURE( !this, "new ObjectType?" );
         }
     }
     if ( !nDropDestination )
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index eff7432..49338b4 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -141,6 +141,7 @@
 #include <PostItMgr.hxx>
 
 //JP 11.10.2001: enable test code for bug fix 91313
+//TODO: This one could most probably be removed 
 #if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1)
 //#define TEST_FOR_BUG91313
 #endif
@@ -849,7 +850,7 @@ void SwEditWin::FlushInBuffer()
             // as well, we now expand the selection accordingly.
             SwPaM &rCrsr = *rSh.GetCrsr();
             xub_StrLen nCrsrStartPos = rCrsr.Start()->nContent.GetIndex();
-            DBG_ASSERT( nCrsrStartPos >= nExpandSelection, "cannot expand selection as 
specified!!" );
+            OSL_ENSURE( nCrsrStartPos >= nExpandSelection, "cannot expand selection as 
specified!!" );
             if (nExpandSelection && nCrsrStartPos >= nExpandSelection)
             {
                 if (!rCrsr.HasMark())
@@ -1038,7 +1039,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb )
             case MOVE_DOWN_SMALL: if( aTmp.Height() < aSnap.Height() + MINFLY ) break;
                     nDown = aSnap.Height(); // kein break
             case MOVE_DOWN_BIG: aTmp.Top( aTmp.Top() + nDown ); break;
-            default: ASSERT( TRUE, "ChangeFly: Unknown direction." );
+            default: OSL_ENSURE(true, "ChangeFly: Unknown direction." );
         }
         BOOL bSet = FALSE;
         if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
@@ -1529,7 +1530,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
         case KS_CheckKey:
             eKeyState = KS_KeyToView;       // default weiter zur View
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
             // JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly
             //              Bereichen
@@ -4250,7 +4251,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
                             }
                             else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos )
                             {
-                                ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field 
ptr???");
+                                OSL_ENSURE( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field 
ptr???");
                                 if ( aCntntAtPos.aFnd.pFldmark != NULL)
                                 {
                                     IFieldmark *fieldBM = const_cast< IFieldmark* > ( 
aCntntAtPos.aFnd.pFldmark );
@@ -4940,9 +4941,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                                     }
                                     break;
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
                     default:
-                        ASSERT( !this, "unknown speech command." );
+                        OSL_ENSURE( !this, "unknown speech command." );
 #endif
                 }
                 if ( nSlotId )
@@ -5208,9 +5209,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             }
         }
         break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         default:
-            ASSERT( !this, "unknown command." );
+            OSL_ENSURE( !this, "unknown command." );
 #endif
     }
     if (bCallBase)
@@ -5535,7 +5536,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > 
SwEditWin::Create
     vos::OGuard aGuard(Application::GetSolarMutex());   // this should have
                                                         // happend already!!!
     SwWrtShell *pSh = rView.GetWrtShellPtr();
-    ASSERT( pSh, "no writer shell, no accessible object" );
+    OSL_ENSURE( pSh, "no writer shell, no accessible object" );
     uno::Reference<
         ::com::sun::star::accessibility::XAccessible > xAcc;
     if( pSh )
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 06ea4d2..aa9d890 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -32,7 +32,7 @@
 #include <hintids.hxx>
 
 #include <doc.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 #include <stdio.h>
 #endif
 
@@ -144,7 +144,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
                                     SwContentAtPos::SW_TOXMARK |
                                     SwContentAtPos::SW_REFMARK |
                                     SwContentAtPos::SW_SMARTTAG |
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
                                     SwContentAtPos::SW_TABLEBOXVALUE |
                         ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
 #endif
@@ -158,7 +158,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
                 sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
                 sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula();
                 break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
             case SwContentAtPos::SW_TABLEBOXVALUE:
             {
                 sTxt = UniString(
@@ -360,7 +360,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
                         {
                             // --> OD 2008-01-09 #i85090#
                             const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) 
);
-                            ASSERT( pRefFld,
+                            OSL_ENSURE( pRefFld,
                                     "<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
                             if ( pRefFld )
                             {
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 80224a3..a089a21 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -169,8 +169,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
                     {
                         //was war das denn?
 #if OSL_DEBUG_LEVEL > 1
-                        DBG_ERROR("Token nicht erkannt!");
-                        DBG_ERROR(ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer());
+                        OSL_ENSURE(false, "Token not recognised!");
+                        OSL_ENSURE(false, ByteString(sToken, 
gsl_getSystemTextEncoding()).GetBuffer());
 #endif
                     }
 
@@ -614,7 +614,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)
 IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
 {
     Time aSyntaxCheckStart;
-    DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
+    OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
     // pTextEngine->SetUpdateMode( FALSE );
 
     bHighlighting = TRUE;
@@ -763,13 +763,13 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
         // optimiert das die TextEngine.
         USHORT nLastEnd = 0;
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         USHORT nLine = aPortionList[0].nLine;
 #endif
         for ( USHORT i = 0; i < nCount; i++ )
         {
             SwTextPortion& r = aPortionList[i];
-            DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" );
+            OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" );
             if ( r.nStart > r.nEnd )   // Nur bis Bug von MD behoeben
                 continue;
 
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 92a787b..a4d78ca 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -131,7 +131,7 @@ void SwChangeDBDlg::FillDBPopup()
         Reference<XInterface> xInstance = xMgr->createInstance( C2U( 
"com.sun.star.sdb.DatabaseContext" ));
         xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ;
     }
-    DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
+    OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
 
     const SwDBData& rDBData = pSh->GetDBData();
     String sDBName(rDBData.sDataSource);
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 8405048..5e697ec 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -351,12 +351,12 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG )
     }
     aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, nEditPos));
     SwAbstractDialogFactory* pFact = swui::GetFactory();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
     SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aSet, 
         pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(),
         RC_DLG_ADDR );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if(RET_OK == pDlg->Execute())
     {
         pSh->UpdateFlds( *pCurFld );
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index b9a1954..cfcccef 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -257,7 +257,7 @@ static SwWrtShell* lcl_GetShell()
     SwView* pView;
     if ( 0 != (pView = ::GetActiveView()) )
         return pView->GetWrtShellPtr();
-    DBG_ERROR("no current shell found!");
+    OSL_ENSURE(false, "no current shell found!");
     return 0;
 }
 
@@ -454,14 +454,14 @@ USHORT SwFldMgr::GetGroup(BOOL bHtmlMode, USHORT nTypeId, USHORT nSubType) 
const
 
 USHORT SwFldMgr::GetTypeId(USHORT nPos)
 {
-    ASSERT(nPos < ::GetPackCount(), "unzulaessige Pos");
+    OSL_ENSURE(nPos < ::GetPackCount(), "forbidden Pos");
     return aSwFlds[ nPos ].nTypeId;
 }
 
 
 const String& SwFldMgr::GetTypeStr(USHORT nPos)
 {
-    ASSERT(nPos < ::GetPackCount(), "unzulaessige TypeId");
+    OSL_ENSURE(nPos < ::GetPackCount(), "forbidden TypeId");
 
     USHORT nFldWh = aSwFlds[ nPos ].nTypeId;
 
@@ -619,7 +619,7 @@ BOOL SwFldMgr::GetSubTypes(USHORT nTypeId, SvStringsDtor& rToFill)
 
 USHORT SwFldMgr::GetFormatCount(USHORT nTypeId, BOOL bIsText, BOOL bHtmlMode) const
 {
-    ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+    OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
 
     {
         const USHORT nPos = GetPos(nTypeId);
@@ -677,7 +677,7 @@ USHORT SwFldMgr::GetFormatCount(USHORT nTypeId, BOOL bIsText, BOOL bHtmlMode) co
 String SwFldMgr::GetFormatStr(USHORT nTypeId, ULONG nFormatId) const
 {
     String aRet;
-    ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+    OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
 
     const USHORT nPos = GetPos(nTypeId);
 
@@ -1377,11 +1377,11 @@ BOOL SwFldMgr::InsertFld(  const SwInsertFld_Data& rData )
         }
         break;
         default:
-        {      ASSERT(!this, "Falscher Feldtyp");
+        {      OSL_ENSURE(!this, "wrong field type");
             return FALSE;
         }
     }
-    ASSERT(pFld, "Feld nicht vorhanden");
+    OSL_ENSURE(pFld, "field not available");
 
 
      //the auto language flag has to be set prior to the language!
@@ -1426,7 +1426,7 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat,
                             SwField * _pTmpFld) // #111840#
 {
     // Format aendern
-    ASSERT(pCurFld, "kein Feld an der CursorPos");
+    OSL_ENSURE(pCurFld, "no field at CursorPos");
 
     bool bDelete = false;
     SwField *pTmpFld;          // mb: fixed memory leak
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index cdbcecd..7240f98 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -940,7 +940,7 @@ BOOL SwFldRefPage::FillItemSet(SfxItemSet& )
         else if ( nTypeId == REFFLDFLAG_HEADING )
         {
             SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
-            ASSERT( pEntry,
+            OSL_ENSURE( pEntry,
                     "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip 
listbox!" );
             if ( pEntry )
             {
@@ -960,7 +960,7 @@ BOOL SwFldRefPage::FillItemSet(SfxItemSet& )
         else if ( nTypeId == REFFLDFLAG_NUMITEM )
         {
             SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
-            ASSERT( pEntry,
+            OSL_ENSURE( pEntry,
                     "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip 
listbox!" );
             if ( pEntry )
             {
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 438320a..db2e9b6 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -303,7 +303,7 @@ void SwFldDlg::EnableInsert(BOOL bEnable)
     if( bEnable )
     {
         SwView* pView = ::GetActiveView();
-        DBG_ASSERT(pView, "no view found");
+        OSL_ENSURE(pView, "no view found");
         if( !pView ||
                 (pView->GetWrtShell().IsReadOnlyAvailable() &&
                     pView->GetWrtShell().HasReadonlySel()) )
diff --git a/sw/source/ui/fldui/fldwrap.cxx b/sw/source/ui/fldui/fldwrap.cxx
index 2c45028..abe6b86 100644
--- a/sw/source/ui/fldui/fldwrap.cxx
+++ b/sw/source/ui/fldui/fldwrap.cxx
@@ -99,10 +99,10 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, USHORT nId,
     : SwChildWinWrapper( _pParent, nId )
 {
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
             
     AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     pDlgInterface = pDlg;
     pWindow = pDlg->GetWindow();
     pDlg->Start();
@@ -146,10 +146,10 @@ SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, USHORT 
nId,
     : SwChildWinWrapper( _pParent, nId )
 {
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
             
     AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     pDlgInterface = pDlg; 
     
     pWindow = pDlg->GetWindow();
diff --git a/sw/source/ui/fldui/xfldui.cxx b/sw/source/ui/fldui/xfldui.cxx
index 7c791c1..5395a11 100644
--- a/sw/source/ui/fldui/xfldui.cxx
+++ b/sw/source/ui/fldui/xfldui.cxx
@@ -30,7 +30,7 @@
 #include "precompiled_sw.hxx"
 
 
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/sdbc/XDataSource.hpp>
@@ -89,7 +89,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
         if(xTSupplier.is())
         {
             Reference<XNameAccess> xTbls = xTSupplier->getTables();
-            DBG_ASSERT(xTbls->hasByName(rTblQryName), "table not available anymore?");
+            OSL_ENSURE(xTbls->hasByName(rTblQryName), "table not available anymore?");
             try
             {
                 Any aTable = xTbls->getByName(rTblQryName);
@@ -106,7 +106,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
         if(xQSupplier.is())
         {
             Reference<XNameAccess> xQueries = xQSupplier->getQueries();
-            DBG_ASSERT(xQueries->hasByName(rTblQryName), "table not available anymore?");
+            OSL_ENSURE(xQueries->hasByName(rTblQryName), "table not available anymore?");
             try
             {
                 Any aQuery = xQueries->getByName(rTblQryName);
@@ -127,7 +127,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
         }
         catch(Exception& )
         {
-            DBG_ERROR("Exception in getColumns()");
+            OSL_ENSURE(false, "Exception in getColumns()");
         }
         if(xCols.is() && xCols->hasByName(rFldName))
         {
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 9896375..266d8cf 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -329,7 +329,7 @@ SwTemplateDlg::SwTemplateDlg(Window*                        pParent,
         break;
 
         default:
-            ASSERT(!this, "Falsche Familie");
+            OSL_ENSURE(!this, "wrong family");
 
     }
 }
@@ -400,7 +400,7 @@ void SwTemplateDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
     {
         case TP_CHAR_STD:
             {
-                ASSERT(::GetActiveView(), "keine View aktiv");
+                OSL_ENSURE(::GetActiveView(), "no active view");
 
                 SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()->
                     GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx
index 31daff1..6ea6307 100644
--- a/sw/source/ui/frmdlg/colmgr.cxx
+++ b/sw/source/ui/frmdlg/colmgr.cxx
@@ -72,7 +72,7 @@ USHORT SwColMgr::GetGutterWidth( USHORT nPos ) const
         nRet = GetCount() > 1 ? aFmtCol.GetGutterWidth() : DEF_GUTTER_WIDTH;
     else
     {
-        DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+        OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
         const SwColumns& rCols = aFmtCol.GetColumns();
         nRet = rCols.GetObject(nPos)->GetRight() + rCols.GetObject(nPos + 1)->GetLeft();
     }
@@ -85,7 +85,7 @@ void SwColMgr::SetGutterWidth(USHORT nGutterWidth, USHORT nPos )
         aFmtCol.SetGutterWidth(nGutterWidth, nWidth);
     else
     {
-        DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+        OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
         SwColumns& rCols = aFmtCol.GetColumns();
         USHORT nGutterWidth2 = nGutterWidth / 2;
         rCols.GetObject(nPos)->SetRight(nGutterWidth2);
@@ -103,7 +103,7 @@ short SwColMgr::GetLineHeightPercent() const
 
 void SwColMgr::SetLineHeightPercent(short nPercent)
 {
-    ASSERT(nPercent <= 100, LineHeight darf nur bis 100 % gross  sein);
+    OSL_ENSURE(nPercent <= 100, "line height may only be 100 \%");
     aFmtCol.SetLineHeight((BYTE)nPercent);
 }
 
@@ -112,13 +112,13 @@ void SwColMgr::SetLineHeightPercent(short nPercent)
 ------------------------------------------------------------------------*/
 USHORT SwColMgr::GetColWidth(USHORT nIdx) const
 {
-    ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+    OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
     return aFmtCol.CalcPrtColWidth(nIdx, nWidth);
 }
 
 void SwColMgr::SetColWidth(USHORT nIdx, USHORT nWd)
 {
-    ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+    OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
     aFmtCol.GetColumns()[nIdx]->SetWishWidth(nWd);
 
 }
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index c0ca792..87069fc 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -202,8 +202,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
     else
         aApplyToLB.RemoveEntry( nPagePos );
 
-
-    ASSERT( pColPgSet, "" );
+    OSL_ENSURE( pColPgSet, "" );
     // TabPage erzeugen
     SwColumnPage* pPage = (SwColumnPage*) SwColumnPage::Create( this,
                                                                 *pColPgSet );
@@ -919,7 +918,7 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
     if(aAutoWidthBox.IsChecked())
     {
         USHORT nMaxGap = pColMgr->GetActualSize() - nCols * MINLAY;
-        DBG_ASSERT(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
+        OSL_ENSURE(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
         nMaxGap /= nCols - 1;
         if(nActValue > nMaxGap)
         {
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index 7789491..2fdf235 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -101,7 +101,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame*       pViewFrame,
         AddTabPage(TP_COLUMN,  SwColumnPage::Create,    0);
     }
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
     AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
     AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index ce66d39..321f772 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -142,8 +142,8 @@ void SwFlyFrmAttrMgr::_UpdateFlyFrm()
  --------------------------------------------------------------------*/
 void SwFlyFrmAttrMgr::UpdateFlyFrm()
 {
-    ASSERT( pOwnSh->IsFrmSelected(),
-        "Kein Rahmen selektiert oder keine Shell, Update nicht moeglich");
+    OSL_ENSURE( pOwnSh->IsFrmSelected(),
+        "no frame selected or no shell, update not possible");
 
     if( pOwnSh->IsFrmSelected() )
     {
@@ -201,7 +201,7 @@ void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds        eAnchorType,
                                    const Size  &rSize,
                                    BOOL bAbs )
 {
-    ASSERT( eAnchorType == FLY_AT_PAGE ||
+    OSL_ENSURE( eAnchorType == FLY_AT_PAGE ||
             eAnchorType == FLY_AT_PARA ||
             eAnchorType == FLY_AT_CHAR ||
             eAnchorType == FLY_AT_FLY  ||
@@ -542,7 +542,7 @@ void SwFlyFrmAttrMgr::DelAttr( USHORT nId )
 
 void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
 {
-    ASSERT( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
+    OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
 
     SvxLRSpaceItem aTmp( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
     if( LONG_MAX != nLeft )
@@ -554,7 +554,7 @@ void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
 
 void SwFlyFrmAttrMgr::SetULSpace( long nTop, long nBottom )
 {
-    ASSERT(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
+    OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
 
     SvxULSpaceItem aTmp( (SvxULSpaceItem&)aSet.Get( RES_UL_SPACE ) );
     if( LONG_MAX != nTop )
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 6b10ee9..099e6ba 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -795,7 +795,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
 
     if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE )
     {
-        ASSERT(pSh , "shell not found");
+        OSL_ENSURE(pSh , "shell not found");
         const SfxPoolItem* pItem;
         //OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften
         if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, FALSE, &pItem))
@@ -939,7 +939,7 @@ BOOL SwFrmPage::FillItemSet(SfxItemSet &rSet)
     BOOL bRet = FALSE;
     SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
                         : ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
-    ASSERT( pSh , "shell not found");
+    OSL_ENSURE( pSh , "shell not found");
     const SfxItemSet& rOldSet = GetItemSet();
     const SfxPoolItem* pOldItem = 0;
 
@@ -1658,7 +1658,7 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
 
     SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
                         :((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
-    ASSERT(pSh , "shell not found");
+    OSL_ENSURE(pSh , "shell not found");
     SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() );
     SvxSwFrameValidation        aVal;
 
@@ -2788,7 +2788,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
             aTmpName1 = ((const SfxStringItem*)pItem)->GetValue();
         }
 
-        DBG_ASSERT(pWrtSh, "keine Shell?");
+        OSL_ENSURE(pWrtSh, "keine Shell?");
         if( bNew || !aTmpName1.Len() )
 
             switch( nDlgType )
diff --git a/sw/source/ui/frmdlg/pattern.cxx b/sw/source/ui/frmdlg/pattern.cxx
index 5cd5a7b..b9ca694 100644
--- a/sw/source/ui/frmdlg/pattern.cxx
+++ b/sw/source/ui/frmdlg/pattern.cxx
@@ -55,7 +55,7 @@ SwBackgroundDlg::SwBackgroundDlg(Window* pParent, const SfxItemSet& rSet) :
 {
     SetText(SW_RESSTR(STR_FRMUI_PATTERN));
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
     if ( fnCreatePage )
     {
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
index 8507907..9ef5297 100644
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -57,7 +57,7 @@ SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, USHORT nType) :
 
     // TabPage erzeugen
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER );
     if ( fnCreatePage )
     {
diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx
index 8c8a55b..5ce83a9 100644
--- a/sw/source/ui/inc/cfgitems.hxx
+++ b/sw/source/ui/inc/cfgitems.hxx
@@ -37,7 +37,7 @@
 
 class SwWriterApp;
 class SwModule;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 class SwTestTabPage;
 #endif
 class SwAddPrinterTabPage;
diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx
index 0eb08e9..7ffbe2e 100644
--- a/sw/source/ui/inc/fontcfg.hxx
+++ b/sw/source/ui/inc/fontcfg.hxx
@@ -31,7 +31,7 @@
 #include <unotools/configitem.hxx>
 #include <tools/string.hxx>
 #include <i18npool/lang.h>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include "swdllapi.h"
 
 #define FONT_STANDARD       0
diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx
index f67cae0..2301193 100644
--- a/sw/source/ui/inc/uinums.hxx
+++ b/sw/source/ui/inc/uinums.hxx
@@ -124,7 +124,7 @@ public:
 // INLINE METHODE --------------------------------------------------------
 inline const SwNumRulesWithName *SwBaseNumRules::GetRules(USHORT nIdx) const
 {
-    ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.);
+    OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert.");
     return pNumRules[nIdx];
 }
 
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index 374925e..f4157fa 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -179,7 +179,7 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
     }
     catch(Exception&)
     {
-        DBG_ERROR("::CreateExample() - exception caught");
+        OSL_ENSURE(false, "::CreateExample() - exception caught");
     }
     return 0;
 }
@@ -203,7 +203,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
 
     try
     {
-        DBG_ASSERT(pxIndexSectionsArr[nTOXIndex] &&
+        OSL_ENSURE(pxIndexSectionsArr[nTOXIndex] &&
                         pxIndexSectionsArr[nTOXIndex]->xContainerSection.is(),
                             "Section not created");
          uno::Reference< frame::XModel > & xModel = pExampleFrame->GetModel();
@@ -428,7 +428,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
                     aSequPropVals.realloc(nTokenIndex);
 
                     uno::Any aFormatAccess = 
xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)));
-                    DBG_ASSERT(aFormatAccess.getValueType() == 
::getCppuType((uno::Reference<container::XIndexReplace>*)0),
+                    OSL_ENSURE(aFormatAccess.getValueType() == 
::getCppuType((uno::Reference<container::XIndexReplace>*)0),
                         "wrong property type");
 
 
@@ -473,7 +473,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
     }
     catch(Exception&)
     {
-        DBG_ERROR("::CreateExample() - exception caught");
+        OSL_ENSURE(false, "::CreateExample() - exception caught");
     }
 }
 
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index f2a61a6..ed51110 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -328,7 +328,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
         }
     }
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     AddTabPage(TP_TOX_SELECT, SwTOXSelectTabPage::Create, 0);
     AddTabPage(TP_TOX_STYLES, SwTOXStylesTabPage::Create, 0);
     AddTabPage(TP_COLUMN,      SwColumnPage::Create,    0);
@@ -1070,7 +1070,7 @@ CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
         case TO_OBJECT                 : eRet.eType = TOX_OBJECTS;     break;
         case TO_TABLE          : eRet.eType = TOX_TABLES;      break;
         case TO_AUTHORITIES    : eRet.eType = TOX_AUTHORITIES; break;
-        default: DBG_ERROR("what a type?");
+        default: OSL_ENSURE(false, "what a type?");
     }
     return eRet;
 }
@@ -1181,7 +1181,7 @@ void      SwTOXSelectTabPage::ApplyTOXDescription()
     for( long nCnt = 0; nCnt < aSortAlgorithmLB.GetEntryCount(); ++nCnt )
     {
         const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData( (USHORT)nCnt );
-        DBG_ASSERT(pEntryData, "no entry data available");
+        OSL_ENSURE(pEntryData, "no entry data available");
         if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm())
         {
             aSortAlgorithmLB.SelectEntryPos( (USHORT)nCnt );
@@ -1296,7 +1296,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
     rDesc.SetLanguage(aLanguageLB.GetSelectLanguage());
     const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData(
                                             aSortAlgorithmLB.GetSelectEntryPos() );
-    DBG_ASSERT(pEntryData, "no entry data available");
+    OSL_ENSURE(pEntryData, "no entry data available");
     if(pEntryData)
         rDesc.SetSortAlgorithm(*pEntryData);
 }
@@ -1554,7 +1554,7 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox)
 
 IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl,      ListBox*, pBox)
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
     switch((long)pBox->GetEntryData( pBox->GetSelectEntryPos() ))
     {
         case AREA_DOCUMENT  : break;
@@ -1808,7 +1808,7 @@ public:
 
     void SetLinkEnd()
         {
-            DBG_ASSERT(TOKEN_LINK_START == aFormToken.eTokenType,
+            OSL_ENSURE(TOKEN_LINK_START == aFormToken.eTokenType,
                                     "call SetLinkEnd for link start only!");
             aFormToken.eTokenType = TOKEN_LINK_END;
             aFormToken.sText.AssignAscii(SwForm::aFormLinkEnd);
@@ -1816,7 +1816,7 @@ public:
         }
     void SetLinkStart()
         {
-            DBG_ASSERT(TOKEN_LINK_END == aFormToken.eTokenType,
+            OSL_ENSURE(TOKEN_LINK_END == aFormToken.eTokenType,
                                     "call SetLinkStart for link start only!");
             aFormToken.eTokenType = TOKEN_LINK_START;
             aFormToken.sText.AssignAscii(SwForm::aFormLinkStt);
@@ -2431,7 +2431,7 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton)
     else
     {
         Control* pCtrl = aTokenWIN.GetActiveControl();
-        DBG_ASSERT(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
+        OSL_ENSURE(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
         if( WINDOW_EDIT != pCtrl->GetType() )
         {
             //fill it into the ListBox
@@ -2569,7 +2569,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
             {
                 sal_uInt32 nSearch = aToken.nAuthorityField;
                 sal_uInt16     nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*) nSearch );
-                DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
+                OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
                 aAuthFieldsLB.RemoveEntry(nLstBoxPos);
             }
 
@@ -2743,7 +2743,7 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
     if(sEntry == sNoCharStyle)
         sEntry.Erase();
     Control* pCtrl = aTokenWIN.GetActiveControl();
-    DBG_ASSERT(pCtrl, "no active control?");
+    OSL_ENSURE(pCtrl, "no active control?");
     if(pCtrl)
     {
         if(WINDOW_EDIT == pCtrl->GetType())
@@ -2762,7 +2762,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox)
     if(LISTBOX_ENTRY_NOTFOUND != nPos)
     {
         Control* pCtrl = aTokenWIN.GetActiveControl();
-        DBG_ASSERT(pCtrl, "no active control?");
+        OSL_ENSURE(pCtrl, "no active control?");
         if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
             ((SwTOXButton*)pCtrl)->SetChapterInfo(nPos);
 
@@ -2776,7 +2776,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField)
     const sal_uInt16 nLevel = static_cast<BYTE>(pField->GetValue());
 
     Control* pCtrl = aTokenWIN.GetActiveControl();
-    DBG_ASSERT(pCtrl, "no active control?");
+    OSL_ENSURE(pCtrl, "no active control?");
     if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
         ((SwTOXButton*)pCtrl)->SetOutlineLevel(nLevel);
 
@@ -2791,7 +2791,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
     if(LISTBOX_ENTRY_NOTFOUND != nPos)
     {
         Control* pCtrl = aTokenWIN.GetActiveControl();
-        DBG_ASSERT(pCtrl, "no active control?");
+        OSL_ENSURE(pCtrl, "no active control?");
         if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
         {
            ((SwTOXButton*)pCtrl)->SetEntryNumberFormat(nPos);//i89791
@@ -2804,7 +2804,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
 IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
 {
     Control* pCtrl = aTokenWIN.GetActiveControl();
-    DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+    OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
         TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
                 "no active style::TabStop control?");
     if( pCtrl && WINDOW_EDIT != pCtrl->GetType() )
@@ -2819,7 +2819,7 @@ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
 IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox)
 {
     Control* pCtrl = aTokenWIN.GetActiveControl();
-    DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+    OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
         TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
                 "no active style::TabStop control?");
     if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
@@ -2839,7 +2839,7 @@ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox)
 {
     //the most right style::TabStop is usually right aligned
     Control* pCurCtrl = aTokenWIN.GetActiveControl();
-    DBG_ASSERT(WINDOW_EDIT != pCurCtrl->GetType() &&
+    OSL_ENSURE(WINDOW_EDIT != pCurCtrl->GetType() &&
             ((SwTOXButton*)pCurCtrl)->GetFormToken().eTokenType == TOKEN_TAB_STOP,
             "no style::TabStop selected!");
 
@@ -2974,7 +2974,7 @@ void      SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
 
             if(TOKEN_TEXT == aToken.eTokenType)
             {
-                DBG_ASSERT(!bLastWasText, "text following text is invalid");
+                OSL_ENSURE(!bLastWasText, "text following text is invalid");
                 Control* pCtrl = InsertItem(aToken.sText, aToken);
                 bLastWasText = sal_True;
                 if(!GetActiveControl())
@@ -3104,7 +3104,7 @@ void      SwTokenWindow::InsertAtSelection(
             const String& rText,
             const SwFormToken& rToken)
 {
-    DBG_ASSERT(pActiveCtrl, "no active control!");
+    OSL_ENSURE(pActiveCtrl, "no active control!");
     if(!pActiveCtrl)
         return;
     SwFormToken aToInsertToken(rToken);
@@ -3191,7 +3191,7 @@ void      SwTokenWindow::InsertAtSelection(
 
         if(bPostLinkStartFound)
         {
-            DBG_ASSERT(pExchange, "no control to exchange?");
+            OSL_ENSURE(pExchange, "no control to exchange?");
             if(pExchange)
             {
                 ((SwTOXButton*)pExchange)->SetLinkEnd();
@@ -3201,7 +3201,7 @@ void      SwTokenWindow::InsertAtSelection(
 
         if(bPreEndLinkFound)
         {
-            DBG_ASSERT(pExchange, "no control to exchange?");
+            OSL_ENSURE(pExchange, "no control to exchange?");
             if(pExchange)
             {
                 ((SwTOXButton*)pExchange)->SetLinkStart();
@@ -3278,10 +3278,10 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall 
)
         m_pParent->PreTokenButtonRemoved(pDel->GetFormToken());
 
     sal_uInt32 nActivePos = aControlList.GetPos(pDel);
-    DBG_ASSERT(nActivePos != 0xffffffff, "Control does not exist!");
+    OSL_ENSURE(nActivePos != 0xffffffff, "Control does not exist!");
     // the two neighbours of the box must be merged
     // the properties of the right one will be lost
-    DBG_ASSERT(nActivePos && nActivePos < aControlList.Count() - 1,
+    OSL_ENSURE(nActivePos && nActivePos < aControlList.Count() - 1,
         "Button at first or last position?");
     aControlList.Seek(nActivePos - 1);
     Control* pLeftEdit = aControlList.GetCurObject();
diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx
index b7b1158..66a407d 100644
--- a/sw/source/ui/index/idxmrk.cxx
+++ b/sw/source/ui/index/idxmrk.cxx
@@ -77,9 +77,9 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper(       Window *pParentWindow,
         SfxChildWindow(pParentWindow, nId)
 {
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
     pAbstDlg = pFact->CreateIndexMarkFloatDlg( DLG_INSIDXMARK , pBindings, this, pParentWindow, 
pInfo );
-    DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
     pWindow = pAbstDlg->GetWindow();
     pWindow->Show();   // at this point,because before pSh has to be initialized in ReInitDlg()
                         // -> Show() will invoke StateChanged() and save pos
@@ -107,9 +107,9 @@ SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper(   Window *pParentWindow,
         SfxChildWindow(pParentWindow, nId)
 {
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
     pAbstDlg = pFact->CreateAuthMarkFloatDlg( DLG_INSAUTHMARK, pBindings, this, pParentWindow, 
pInfo );
-    DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
     pWindow = pAbstDlg->GetWindow();
 
     eChildAlignment = SFX_ALIGN_NOALIGNMENT;
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index d63ca24..e6ec8db 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -241,10 +241,10 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
  --------------------------------------------------------------------*/
 void SwIndexMarkDlg::InitControls()
 {
-    DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
+    OSL_ENSURE(pSh && pTOXMgr, "no shell?");
     // Inhalts-Verzeichnis
     const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0);
-    ASSERT(pType, "Kein Verzeichnistyp !!");
+    OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
     String sTmpTypeSelection;
     if(aTypeDCB.GetSelectEntryCount())
         sTmpTypeSelection = aTypeDCB.GetSelectEntry();
@@ -253,7 +253,7 @@ void SwIndexMarkDlg::InitControls()
 
     // Stichwort-Verzeichnis
     pType = pTOXMgr->GetTOXType(TOX_INDEX, 0);
-    ASSERT(pType, "Kein Verzeichnistyp !!");
+    OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
     aTypeDCB.InsertEntry(pType->GetTypeName());
 
     // Benutzerverzeichnisse
@@ -368,19 +368,19 @@ void      SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading()
     //get the current language
     if(!bNewMark) //if dialog is opened to iterate existing marks
     {
-        ASSERT(pTOXMgr, "need TOXMgr")
+        OSL_ENSURE(pTOXMgr, "need TOXMgr")
         if(!pTOXMgr)
             return;
         SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
-        ASSERT(pMark, "need current SwTOXMark");
+        OSL_ENSURE(pMark, "need current SwTOXMark");
         if(!pMark)
             return;
         SwTxtTOXMark* pTxtTOXMark = pMark->GetTxtTOXMark();
-        ASSERT(pTxtTOXMark, "need current SwTxtTOXMark");
+        OSL_ENSURE(pTxtTOXMark, "need current SwTxtTOXMark");
         if(!pTxtTOXMark)
             return;
         const SwTxtNode* pTxtNode = pTxtTOXMark->GetpTxtNd();
-        ASSERT(pTxtNode, "need current SwTxtNode");
+        OSL_ENSURE(pTxtNode, "need current SwTxtNode");
         if(!pTxtNode)
             return;
         xub_StrLen nTextIndex = *pTxtTOXMark->GetStart();
@@ -866,9 +866,9 @@ IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG )
  --------------------------------------------------------------------*/
 void SwIndexMarkDlg::UpdateDialog()
 {
-    DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
+    OSL_ENSURE(pSh && pTOXMgr, "no shell?");
     SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
-    ASSERT(pMark, "Keine aktuelle Markierung");
+    OSL_ENSURE(pMark, "no current marker");
     if(!pMark)
         return;
 
@@ -1351,8 +1351,8 @@ IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG )
     if(pSh)
     {
         sal_Bool bDifferent = sal_False;
-        DBG_ASSERT(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
-        DBG_ASSERT(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
+        OSL_ENSURE(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
+        OSL_ENSURE(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
         //check if the entry already exists with different content
         const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
                                         pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
@@ -1431,7 +1431,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton)
         }
         if(bCreate)
         {
-            DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND ==
+            OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND ==
                         aEntryLB.GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]),
                         "entry exists!");
             aEntryLB.InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]);
@@ -1547,9 +1547,9 @@ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit)
 
 void SwAuthMarkDlg::InitControls()
 {
-    DBG_ASSERT(pSh, "Shell nicht da?");
+    OSL_ENSURE(pSh, "no shell?");
     SwField* pField = pSh->GetCurFld();
-    ASSERT(bNewEntry || pField, "Keine aktuelle Markierung");
+    OSL_ENSURE(bNewEntry || pField, "no current marker");
     if(bNewEntry)
     {
         ChangeSourceHdl(aFromComponentRB.IsChecked() ? &aFromComponentRB : &aFromDocContentRB);
@@ -1564,7 +1564,7 @@ void SwAuthMarkDlg::InitControls()
     const SwAuthEntry* pEntry = ((SwAuthorityFieldType*)pField->GetTyp())->
             GetEntryByHandle(((SwAuthorityField*)pField)->GetHandle());
 
-    DBG_ASSERT(pEntry, "No authority entry found");
+    OSL_ENSURE(pEntry, "No authority entry found");
     if(!pEntry)
         return;
     for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
@@ -1749,12 +1749,12 @@ String  SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) 
const
     String sRet;
     if( AUTH_FIELD_AUTHORITY_TYPE == eField )
     {
-        DBG_ASSERT(pTypeListBox, "No ListBox");
+        OSL_ENSURE(pTypeListBox, "No ListBox");
         sRet = String::CreateFromInt32(pTypeListBox->GetSelectEntryPos());
     }
     else if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode)
     {
-        DBG_ASSERT(pIdentifierBox, "No ComboBox");
+        OSL_ENSURE(pIdentifierBox, "No ComboBox");
         sRet = pIdentifierBox->GetText();
     }
     else
@@ -1826,7 +1826,7 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
     FreeResource();
     Initialize(pInfo);
     SwWrtShell* pWrtShell = ::GetActiveWrtShell();
-    DBG_ASSERT(pWrtShell, "No shell?");
+    OSL_ENSURE(pWrtShell, "No shell?");
     aDlg.ReInitDlg(*pWrtShell);
 }
 
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 9db17b1..4d45c19 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -92,8 +92,8 @@ void  SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
     {
         case  TOX_CONTENT:
         {
-            ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
-                                            ungueltiger Level InsertTOCMark);
+            OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+                       "invalid InsertTOCMark level");
             pMark = new SwTOXMark(pSh->GetTOXType(TOX_CONTENT, 0));
             pMark->SetLevel( static_cast< USHORT >(rDesc.GetLevel()) );
 
@@ -127,8 +127,8 @@ void        SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
         break;
         case  TOX_USER:
         {
-            ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
-                                            ungueltiger Level InsertTOCMark);
+            OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+                       "invalid InsertTOCMark level");
             USHORT nId = rDesc.GetTOUName() ?
                 GetUserTypeID(*rDesc.GetTOUName()) : 0;
             pMark = new SwTOXMark(pSh->GetTOXType(TOX_USER, nId));
@@ -151,7 +151,7 @@ void        SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
 
 void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
 {
-    ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+    OSL_ENSURE(pCurTOXMark, "no current TOXMark");
 
     pSh->StartAllAction();
     if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
@@ -249,7 +249,7 @@ USHORT SwTOXMgr::GetUserTypeID(const String& rStr)
 
 void SwTOXMgr::NextTOXMark(BOOL bSame)
 {
-    ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+    OSL_ENSURE(pCurTOXMark, "no current TOXMark");
     if( pCurTOXMark )
     {
         SwTOXSearch eDir = bSame ? TOX_SAME_NXT : TOX_NXT;
@@ -260,7 +260,7 @@ void SwTOXMgr::NextTOXMark(BOOL bSame)
 
 void SwTOXMgr::PrevTOXMark(BOOL bSame)
 {
-    ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+    OSL_ENSURE(pCurTOXMark, "no current TOXMark");
     if( pCurTOXMark )
     {
         SwTOXSearch eDir = bSame ? TOX_SAME_PRV : TOX_PRV;
@@ -408,7 +408,7 @@ BOOL SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
     }
 
 
-    DBG_ASSERT(pNewTOX, "no TOXBase created!" );
+    OSL_ENSURE(pNewTOX, "no TOXBase created!" );
     if(!pNewTOX)
         return FALSE;
 
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index d7ae94e..775651c 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -237,7 +237,7 @@ void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 nUnitEnd
 void SwHHCWrapper::HandleNewUnit(
         const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd )
 {
-    DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+    OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
     if (!(0 <= nUnitStart && nUnitStart <= nUnitEnd))
         return;
 
@@ -260,7 +260,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
     //!! please see also TextConvWrapper::ChangeText with is a modified
     //!! copy of this code
 
-    DBG_ASSERT( rNewText.Len() != 0, "unexpected empty string" );
+    OSL_ENSURE( rNewText.Len() != 0, "unexpected empty string" );
     if (rNewText.Len() == 0)
         return;
 
@@ -286,7 +286,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
         // different length. Negative values allowed!
         long nCorrectionOffset = 0;
 
-        DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen,
+        OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen,
                 "mismatch between string length and sequence length!" );
 
         // find all substrings that need to be replaced (and only those)
@@ -317,7 +317,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
 
                     // set selection to sub string to be replaced in original text
                     xub_StrLen nChgInNodeStartIndex = static_cast< xub_StrLen >( nStartIndex + 
nCorrectionOffset + nChgPos );
-                    DBG_ASSERT( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing 
selected)" );
+                    OSL_ENSURE( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing 
selected)" );
                     rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, 
nChgInNodeStartIndex );
                     rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, 
nChgInNodeStartIndex + nChgLen );
 #ifdef DEBUG
@@ -418,7 +418,7 @@ void SwHHCWrapper::ReplaceUnit(
     static OUString aBracketedStart( C2U( "(" ) );
     static OUString aBracketedEnd( C2U( ")" ) );
 
-    DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+    OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
     if (!(nUnitStart >= 0 && nUnitEnd >= nUnitStart))
         return;
 
@@ -432,7 +432,7 @@ void SwHHCWrapper::ReplaceUnit(
 
     OUString aOrigTxt( rWrtShell.GetSelTxt() );
     OUString aNewTxt( rReplaceWith );
-    DBG_ASSERT( aOrigTxt == rOrigText, "!! text mismatch !!" );
+    OSL_ENSURE( aOrigTxt == rOrigText, "!! text mismatch !!" );
     SwFmtRuby *pRuby = 0;
     sal_Bool bRubyBelow = sal_False;
     String  aNewOrigText;
@@ -475,7 +475,7 @@ void SwHHCWrapper::ReplaceUnit(
         }
         break;
         default:
-            DBG_ERROR( "unexpected case" );
+            OSL_ENSURE(false, "unexpected case" );
     }
     nUnitOffset += nUnitStart + aNewTxt.getLength();
 
@@ -532,7 +532,7 @@ void SwHHCWrapper::ReplaceUnit(
             rWrtShell.SetMark();
             rWrtShell.GetCrsr()->GetMark()->nContent -= (xub_StrLen) aNewTxt.getLength();
 
-            DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() 
== LANGUAGE_CHINESE_TRADITIONAL,
+            OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() 
== LANGUAGE_CHINESE_TRADITIONAL,
                     "SwHHCWrapper::ReplaceUnit : unexpected target language" );
 
             sal_uInt16 aRanges[] = {
@@ -543,13 +543,13 @@ void SwHHCWrapper::ReplaceUnit(
             SfxItemSet aSet( rWrtShell.GetAttrPool(), aRanges );
             if (pNewUnitLanguage)
             {
-                //DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
+                //OSL_ENSURE(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
                 //             "similar language should not be changed!");
                 aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) );
             }
 
             const Font *pTargetFont = GetTargetFont();
-            DBG_ASSERT( pTargetFont, "target font missing?" );
+            OSL_ENSURE( pTargetFont, "target font missing?" );
             if (pTargetFont && pNewUnitLanguage)
             {
                 SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
@@ -581,7 +581,7 @@ sal_Bool SwHHCWrapper::HasRubySupport() const
 
 void SwHHCWrapper::Convert()
 {
-    DBG_ASSERT( pConvArgs == 0, "NULL pointer expected" );
+    OSL_ENSURE( pConvArgs == 0, "NULL pointer expected" );
     {
         SwPaM *pCrsr = pView->GetWrtShell().GetCrsr();
         SwPosition* pSttPos = pCrsr->Start();
@@ -611,13 +611,13 @@ void SwHHCWrapper::Convert()
                             pTxtNode, pSttPos->nContent,
                             pTxtNode, pSttPos->nContent );
         }
-        DBG_ASSERT( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
+        OSL_ENSURE( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
                 "failed to get proper start text node" );
-        DBG_ASSERT( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
+        OSL_ENSURE( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
                 "failed to get proper end text node" );
 
         // chinese conversion specific settings
-        DBG_ASSERT( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
+        OSL_ENSURE( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
                 "source and target language mismatch?" );
         if (IsChinese( GetTargetLanguage() ))
         {
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index c42e41c..6aa2341 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -310,7 +310,7 @@ void SwSpellPopup::fillLangPopupMenu(
             aEntryTxt != sAsterix &&
             aEntryTxt != sEmpty)
         {
-            DBG_ASSERT( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + 
MN_MAX_NUM_LANG,
+            OSL_ENSURE( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + 
MN_MAX_NUM_LANG,
                     "nItemId outside of expected range!" );
             pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
             if (aEntryTxt == aCurLang)
@@ -398,7 +398,7 @@ pSh( pWrtSh ),
 xSpellAlt(xAlt),
 bGrammarResults(false)
 {
-    DBG_ASSERT(xSpellAlt.is(), "no spelling alternatives available");
+    OSL_ENSURE(xSpellAlt.is(), "no spelling alternatives available");
 
 //    CreateAutoMnemonics();
     SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
@@ -738,7 +738,7 @@ void SwSpellPopup::Execute( USHORT nId )
     {
         sal_Int32 nAltIdx = (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ?
                 nId - MN_SUGGESTION_START : nId - MN_AUTOCORR_START;
-        DBG_ASSERT( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
+        OSL_ENSURE( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
         if (0 <= nAltIdx && nAltIdx < aSuggestions.getLength() && (bGrammarResults || 
xSpellAlt.is()))
         {
             sal_Bool bOldIns = pSh->IsInsMode();
@@ -825,7 +825,7 @@ void SwSpellPopup::Execute( USHORT nId )
     else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
     {
             OUString aWord( xSpellAlt->getWord() );
-//            DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" );
+//            OSL_ENSURE( nDicIdx < aDics.getLength(), "dictionary index out of range" );
             
             PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC);
             String aDicName ( pMenu->GetItemText(nId) );
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index a5e576c..95d8863 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -106,7 +106,7 @@ SdrHHCWrapper::~SdrHHCWrapper()
     if (pTextObj)
     {
         SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
-        ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+        OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
         pSdrView->SdrEndTextEdit( sal_True );
         SetUpdateMode(sal_False);
         pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -132,7 +132,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
     if ( pTextObj )
     {
         SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
-        ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+        OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
         pSdrView->SdrEndTextEdit( sal_True );
         SetUpdateMode(sal_False);
         pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -204,7 +204,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
                 if (HasConvertibleTextPortion( nSourceLang ))
                 {
                     SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
-                    ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+                    OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
                     SdrPageView* pPV = pSdrView->GetSdrPageView();
                     nDocIndex = n;
                     bNextDoc = sal_True;
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index fa59c10..b35e10f 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -242,7 +242,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
         aParaTemplBox.SelectEntry( sStr );             // Default
     else
     {
-        ASSERT(!pColl->IsDefault(), "Defaultvorlage fuer Fussnoten ist falsch.");
+        OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong");
         const USHORT nPos = aParaTemplBox.GetEntryPos(pColl->GetName());
         if( LISTBOX_ENTRY_NOTFOUND != nPos )
             aParaTemplBox.SelectEntryPos( nPos );
@@ -298,9 +298,9 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum)
         case FTNNUM_CHAPTER:
             sSelect = aNumChapter;
         break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         default:
-            DBG_ERROR("Which numbering type?");
+            OSL_ENSURE(false, "Which numbering type?");
 #endif
     }
     aNumCountBox.SelectEntry(sSelect);
@@ -440,7 +440,7 @@ BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
     {
         const String aFmtName( aParaTemplBox.GetSelectEntry() );
         SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY);
-        ASSERT(pColl, "Absatzvorlage nicht gefunden.");
+        OSL_ENSURE(pColl, "paragraph style not found");
         pInf->SetFtnTxtColl(*pColl);
     }
 
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 117f43f..7498785 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -268,7 +268,7 @@ IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG )
 //     sGroup.ToLower();
     sGroup += GLOS_DELIM;
     sGroup += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
-    DBG_ASSERT(!pGlosHdl->FindGroupName(sGroup), "Gruppe bereits vorhanden!");
+    OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!");
     if(!pInsertedArr)
         pInsertedArr = new SvStrings;
     pInsertedArr->Insert(new String(sGroup), pInsertedArr->Count());
@@ -366,7 +366,7 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
 
     sNewName += GLOS_DELIM;
     sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
-    DBG_ASSERT(!pGlosHdl->FindGroupName(sNewName), "Gruppe bereits vorhanden!");
+    OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!");
 
     // befindet sich der umzubenennende Name unter den
     // den neuen - dann austauschen
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index afefcce..d508837 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -41,7 +41,7 @@
 #ifndef __RSC //autogen
 #include <tools/errinf.hxx>
 #endif
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <svl/urihelper.hxx>
 #include <svl/fstathelper.hxx>
 #include <unotools/pathoptions.hxx>
@@ -160,7 +160,7 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup)
 
 String SwGlossaries::GetGroupName(sal_uInt16 nGroupId)
 {
-    ASSERT(nGroupId < m_pGlosArr->Count(), Textbausteinarray ueberindiziert);
+    OSL_ENSURE(nGroupId < m_pGlosArr->Count(), "Textbausteinarray ueberindiziert");
     return *(*m_pGlosArr)[nGroupId];
 }
 
@@ -253,7 +253,7 @@ sal_Bool    SwGlossaries::RenameGroupDoc(
         sOldFileURL += rOldGroup.GetToken(0, GLOS_DELIM);
         sOldFileURL += SwGlossaries::GetExtension();
         BOOL bExist = FStatHelper::IsDocument( sOldFileURL );
-        DBG_ASSERT(bExist, "Gruppe existiert nicht!");
+        OSL_ENSURE(bExist, "group doesn't exist!");
         if(bExist)
         {
             sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.GetToken(1, GLOS_DELIM).ToInt32();
@@ -269,7 +269,7 @@ sal_Bool    SwGlossaries::RenameGroupDoc(
                 sTempNewFilePath += INET_PATH_TOKEN;
                 sTempNewFilePath += sNewFileName ;
                 bExist = FStatHelper::IsDocument( sTempNewFilePath );
-                DBG_ASSERT(!bExist, "Gruppe existiert bereits!");
+                OSL_ENSURE(!bExist, "group already exists!");
                 if(!bExist)
                 {
                     BOOL bCopyCompleted = SWUnoHelper::UCB_CopyFile(
@@ -322,7 +322,7 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
         // der Textbausteinbereiche entfernt werden
     // Kein && wegen CFfront
     BOOL bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL );
-    DBG_ASSERT(bRemoved, "file has not been removed");
+    OSL_ENSURE(bRemoved, "file has not been removed");
     RemoveFileFromList( aName );
     return bRemoved;
 }
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index cba958f..e945333 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -564,7 +564,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
                 if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName))
                 {
                     SvLBoxEntry* pChild = DoesBlockExist(aTitle, aShortName);
-                    DBG_ASSERT(pChild, "Eintrag nicht gefunden!");
+                    OSL_ENSURE(pChild, "entry not found!");
                     SvLBoxEntry* pParent = aCategoryBox.GetParent(pChild);
                     aCategoryBox.Select(pParent);
 
@@ -1116,7 +1116,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn )
     if(pFact)
     {
         AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn );
-        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pDlg, "Dialogdiet fail!");
         SvtPathOptions aPathOpt;
         String sGlosPath( aPathOpt.GetAutoTextPath() );
         pDlg->SetPath(sGlosPath);
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index b8b3438..f93b95b 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -513,7 +513,7 @@ void SwNumPositionTabPage::InitPosAndSpaceMode()
 {
     if ( pActNum == 0 )
     {
-        DBG_ASSERT( false,
+        OSL_ENSURE( false,
                 "<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> 
has to be already set!" );
         return;
     }
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx
index c141fb9..7ccb7eb 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -55,7 +55,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResI
     uno::Reference < uno::XInterface > xI = xMSF->createInstance(
         ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
     uno::Reference<text::XDefaultNumberingProvider> xDefNum(xI, uno::UNO_QUERY);
-    DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
+    OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
 
     pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY);
     Reload(nTypeFlags);
@@ -147,9 +147,9 @@ sal_Int16   SwNumberingTypeListBox::GetSelectedNumberingType()
     USHORT nSelPos = GetSelectEntryPos();
     if(LISTBOX_ENTRY_NOTFOUND != nSelPos)
         nRet = (sal_Int16)(ULONG)GetEntryData(nSelPos);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
     else
-        DBG_ERROR("SwNumberingTypeListBox not selected");
+        OSL_ENSURE(false, "SwNumberingTypeListBox not selected");
 #endif
     return nRet;
 }
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 84bfd6e..26932fc 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -69,9 +69,7 @@
 #include <unomid.h>
 
 #include <IDocumentOutlineNodes.hxx>
-// --> OD 2008-04-14 #outlinelevel#
 #include <app.hrc>
-// <--
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index 214da30..ad3988b 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -817,7 +817,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( BOOL bSelect, BOOL bAccept )
     ListBoxEntries_t aRedlines;
 
     // don't activate
-    DBG_ASSERT( bInhibitActivate == false,
+    OSL_ENSURE( bInhibitActivate == false,
                 "recursive call of CallAcceptReject?");
     bInhibitActivate = true;
 
@@ -1127,9 +1127,9 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
 
                         sComment = rRedline.GetComment();
                         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                        DBG_ASSERT(pFact, "Dialogdiet fail!");
+                        OSL_ENSURE(pFact, "Dialogdiet fail!");
                         ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( 
RID_SVXDLG_POSTIT );
-                        DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
+                        OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()");
                         SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() );
 
                         aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), 
SID_ATTR_POSTIT_TEXT));
@@ -1140,7 +1140,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
                                     SID_ATTR_POSTIT_DATE ));
 
                         AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, 
aSet, FALSE );
-                        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                        OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
                         pDlg->HideAuthor();
 
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index 9d04ea6..604786a 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -190,7 +190,7 @@ void SwInputWindow::ShowWin()
         pView->GetHLineal().SetActive( FALSE );
         pView->GetVLineal().SetActive( FALSE );
 
-        DBG_ASSERT(pWrtShell, "Keine WrtShell!");
+        OSL_ENSURE(pWrtShell, "no WrtShell!");
         // Cursor in Tabelle
         bIsTable = pWrtShell->IsCrsrInTbl() ? TRUE : FALSE;
 
@@ -211,7 +211,7 @@ void SwInputWindow::ShowWin()
             aPos.SetText(SW_RESSTR(STR_TBL_FORMULA));
 
         // Aktuelles Feld bearbeiten
-        ASSERT(pMgr == 0, FieldManager nicht geloescht.);
+        OSL_ENSURE(pMgr == 0, "FieldManager not deleted");
         pMgr = new SwFldMgr;
 
         // JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier
@@ -568,7 +568,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
         aStr += cClose;
         SetText(aStr);
         USHORT nPos = aStr.Search( cClose );
-        ASSERT(nPos < aStr.Len(), Delimiter nicht gefunden.);
+        OSL_ENSURE(nPos < aStr.Len(), "delimiter not found");
         ++nPos;
         SetSelection( Selection( nPos, nPos ));
     }
diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx
index 6f8e0aa..0f9278b 100644
--- a/sw/source/ui/ribbar/tbxanchr.cxx
+++ b/sw/source/ui/ribbar/tbxanchr.cxx
@@ -140,7 +140,7 @@ void  SwTbxAnchor::Click()
     }
     if(!pActiveView)
     {
-        DBG_ERROR("No active view could be found");
+        OSL_ENSURE(false, "No active view found");
         return;
     }
     SwWrtShell* pWrtShell = pActiveView->GetWrtShellPtr();
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 6855ae1..772342b 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -382,7 +382,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
 
         SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl();
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "Dialogdiet fail!");
+        OSL_ENSURE(pFact, "Dialogdiet fail!");
         ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
         if ( fnSetActGroup )
             (*fnSetActGroup)( sGroup );
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 5299709..4731302 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -168,7 +168,7 @@ SfxUndoManager* SwAnnotationShell::GetUndoManager()
     if ( !pPostItMgr ||
          !pPostItMgr->HasActiveSidebarWin() )
     {
-        DBG_ASSERT(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
+        OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
         return 0;
     }
     return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager();
@@ -373,10 +373,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
         case FN_FORMAT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), 
rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -385,10 +385,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
         {
             SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
                                                         rView.GetWindow(), &aTmp, 
rView.GetWrtShell());
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -424,7 +424,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
             }
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() 
);
             pDialog->SetValues(aCurr, aDocStat );
             pDialog->Execute();
@@ -450,10 +450,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
                 aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, 
aDlgAttr, DLG_CHAR,0, sal_True );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 USHORT nRet = pDlg->Execute();
                 if(RET_OK == nRet )
                 {
@@ -498,10 +498,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
 
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, 
aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 USHORT nRet = pDlg->Execute();
                 if(RET_OK == nRet)
                 {
@@ -1354,7 +1354,7 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
                 break;
 
             default:
-                ASSERT(!this, "falscher Dispatcher");
+                OSL_ENSURE(!this, "wrong dispatcher");
         }
 
         if( nMode )
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 6eb7d31..71a212c 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -250,7 +250,7 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
             rSh.DelLeft();
             break;
         default:
-            DBG_ERROR("falscher Dispatcher");
+            OSL_ENSURE(false, "wrong Dispatcher");
             return;
     }
     rReq.Done();
@@ -414,7 +414,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
             }
             break;
         default:
-            DBG_ERROR("falscher Dispatcher");
+            OSL_ENSURE(false, "wrong Dispatcher");
             return;
     }
     if(!bIgnore)
@@ -511,7 +511,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
             rSh.Do( SwWrtShell::REPEAT );
             break;
         default:
-            DBG_ERROR("falscher Dispatcher");
+            OSL_ENSURE(false, "wrong Dispatcher");
     }
 
     if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); }
@@ -859,11 +859,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
             else
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 AbstractSwConvertTableDlg* pDlg = pFact->CreateSwConvertTableDlg(
                             GetView(),DLG_CONV_TEXT_TABLE , bToTable);
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if( RET_OK == pDlg->Execute() )
                 {
                     pDlg->GetValues( cDelim, aInsTblOpts, pTAFmt );
@@ -1158,7 +1158,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
                     static_cast<const SfxBoolItem*>( pItem )->GetValue();
 
                 // set form design mode
-                DBG_ASSERT( GetView().GetFormShell() != NULL, "form shell?" );
+                OSL_ENSURE( GetView().GetFormShell() != NULL, "form shell?" );
                 SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE );
                 aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
                 GetView().GetFormShell()->Execute( aReq );
@@ -1217,7 +1217,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
         case FN_PAGE_STYLE_SET_PAPER_SIZE:
         case FN_PAGE_STYLE_SET_PAPER_BIN:
         {
-            DBG_ERROR("not implemented");
+            OSL_ENSURE(false, "not implemented");
         }
         break;
 
@@ -1244,7 +1244,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
         }
         break;
         default:
-                DBG_ERROR("falscher Dispatcher");
+                OSL_ENSURE(false, "wrong Dispatcher");
         }
 
     }
@@ -2310,7 +2310,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
         default:
 //                     bMsgOk = FALSE;
             rReq.Ignore();
-            DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" );
+            OSL_ENSURE(false, "unknown message in ExecuteAttr!" );
             return;
     }
 
@@ -2433,10 +2433,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 ::PrepareBoxInfo( aSet, rSh );
                 rSh.GetTabBorders( aSet );
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, 
RC_DLG_SWBORDERDLG );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
@@ -2450,10 +2450,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 aSet.Put( aMgr.GetAttrSet() );
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, 
RC_DLG_SWBORDERDLG );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
@@ -2468,10 +2468,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 ::PrepareBoxInfo( aSet, rSh );
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, 
RC_DLG_SWBORDERDLG );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     rSh.SetAttr( *pDlg->GetOutputItemSet() );
@@ -2493,7 +2493,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
 
             SfxAbstractDialog * pDlg = 0;
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
 
             // Tabellenzelle(n) selektiert?
@@ -2505,7 +2505,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 pDlg = pFact->CreateSfxDialog( pMDI, aSet,
                     rView.GetViewFrame()->GetFrame().GetFrameInterface(),
                     RC_SWDLG_BACKGROUND );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 aSet.Put( aBrush );
                 if ( pDlg->Execute() == RET_OK )
                 {
@@ -2524,7 +2524,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 pDlg = pFact->CreateSfxDialog( pMDI, aSet,
                     rView.GetViewFrame()->GetFrame().GetFrameInterface(),
                     RC_SWDLG_BACKGROUND );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     rSh.SetFlyFrmAttr((SfxItemSet &) *pDlg->GetOutputItemSet() );
@@ -2539,7 +2539,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
                 pDlg = pFact->CreateSfxDialog( pMDI, aSet,
                     rView.GetViewFrame()->GetFrame().GetFrameInterface(),
                     RC_SWDLG_BACKGROUND );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     rSh.SetAttr( *pDlg->GetOutputItemSet() );
@@ -2555,7 +2555,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
 
         }
         break;
-        default:DBG_ERROR("falscher Dispatcher (basesh.cxx)");
+        default:OSL_ENSURE(false, "wrong Dispatcher (basesh.cxx)");
     }
     if(!bDone)
         rReq.Done();
@@ -2649,9 +2649,9 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
             if( !nCols || !nRows )
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 AbstractInsTableDlg* pDlg = pFact->CreateInsTableDlg( DLG_INSERT_TABLE, rTempView 
);
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if( RET_OK == pDlg->Execute() )
                 {
                     pDlg->GetValues( aTableName, nRows, nCols, aInsTblOpts, aAutoName, pTAFmt );
@@ -2855,16 +2855,16 @@ void SwBaseShell::ExecField( SfxRequest& rReq )
         case FN_CHANGE_DBFIELD:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
         }
         break;
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong dispatcher");
     }
 }
 
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index 0242bc1..6caa02e 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -93,12 +93,12 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
             BOOL bHasMarked = pView->AreObjectsMarked();
 
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
+            OSL_ENSURE(pFact, "Dialogdiet Factory fail!");
             AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL,
                                                                             &aNewAttr,
                                                                             pDoc,
                                                                             pView);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
                                     GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
             if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
@@ -135,13 +135,13 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
                 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
+            OSL_ENSURE(pFact, "Dialogdiet Factory fail!");
             SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( NULL,
                     &aNewAttr,
                 pDoc,
                 pObj,
                 bHasMarked);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             if (pDlg->Execute() == RET_OK)
             {
                 pSh->StartAction();
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 1661da9..9a1e083 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -193,10 +193,10 @@ void SwDrawShell::Execute(SfxRequest &rReq)
         case FN_FORMAT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), 
GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -205,10 +205,10 @@ void SwDrawShell::Execute(SfxRequest &rReq)
         {
             SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
                                                         GetView().GetWindow(), &aTmp, 
GetView().GetWrtShell());
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -243,7 +243,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
             }
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( 
GetView().GetWindow() );
             pDialog->SetValues(aCurr, aDocStat );
             pDialog->Execute();
@@ -285,7 +285,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
             break;
 
         default:
-            DBG_ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
     if (pSdrView->GetModel()->IsChanged())
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx
index 513ed50..afd4585 100644
--- a/sw/source/ui/shells/drformsh.cxx
+++ b/sw/source/ui/shells/drformsh.cxx
@@ -120,7 +120,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
                     {
                         uno::Reference< awt::XControlModel >  xControlModel = 
pUnoCtrl->GetUnoControlModel();
 
-                        ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+                        OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
                         if( !xControlModel.is() )
                             return;
 
@@ -170,7 +170,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
         break;
 
         default:
-            DBG_ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
@@ -197,7 +197,7 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet)
                     {
                         uno::Reference< awt::XControlModel >  xControlModel = 
pUnoCtrl->GetUnoControlModel();
 
-                        ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+                        OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
                         if( !xControlModel.is() )
                             return;
 
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 96b81ab..e7d461b 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -123,7 +123,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
     //Sonderfall Align per Menue
     if(pItem && nSlotId == SID_OBJECT_ALIGN)
     {
-        DBG_ASSERT(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem erwartet");
+        OSL_ENSURE(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem expected");
         nSlotId = nSlotId + ((const SfxEnumItem*)pItem)->GetValue();
         nSlotId++;
     }
@@ -160,10 +160,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
 
                         pSh->GetObjAttr(aSet);
                         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                         SfxAbstractDialog* pDlg = pFact->CreateSwWrapDlg( GetView().GetWindow(), 
aSet, pSh, TRUE, RC_DLG_SWWRAPDLG );
-                        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                        OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
                         if (pDlg->Execute() == RET_OK)
                         {
@@ -222,7 +222,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
                                         pFact->CreateCaptionDialog( NULL, pSdrView, 
nAllowedAnchors );
                                 pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, 
ValidatePosition) );
                                 pDlg = pCaptionDlg;
-                                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                             }
                         }
                         else
@@ -235,7 +235,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
                                             pFact->CreateSvxTransformTabDialog( NULL, NULL, 
pSdrView, nAllowedAnchors );
                                 pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, 
ValidatePosition) );
                                 pDlg = pTransform;
-                                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                             }
                         }
                         SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
@@ -601,7 +601,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
         }
 
         default:
-            DBG_ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong Dispatcher");
             return;
     }
     if(!bDone)
@@ -626,7 +626,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
     SwWrtShell          &rSh = GetShell();
     SdrView *pSdrView = rSh.GetDrawView();
     const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
-    DBG_ASSERT(rMarkList.GetMarkCount() == 1, "wrong draw selection");
+    OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection");
     SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     const String sCurrentName = pObj->GetName();
     String sNewName;
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index c71dc50..47e3c70 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -314,10 +314,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
                 aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( pView->GetWindow(), *pView, 
aDlgAttr, DLG_CHAR,0, sal_True );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 USHORT nRet = pDlg->Execute();
                 if(RET_OK == nRet )
                 {
@@ -335,10 +335,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
         case FN_FORMAT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), 
rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -347,10 +347,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
         {
             SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
                                                         GetView().GetWindow(), &aTmp, 
GetView().GetWrtShell());
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -385,7 +385,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
             }
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( 
GetView().GetWindow() );
             pDialog->SetValues(aCurr, aDocStat );
             pDialog->Execute();
@@ -422,10 +422,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
                 aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(), 
GetView(), aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 USHORT nRet = pDlg->Execute();
                 if(RET_OK == nRet)
                 {
@@ -552,7 +552,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
         }
         return;
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
     if(nEEWhich && pNewAttrs)
@@ -885,7 +885,7 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq)
             break;
 
         default:
-            DBG_ERROR("falscher Dispatcher");
+            OSL_ENSURE(false, "wrong dispatcher");
             return;
     }
 }
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index f6b7fea..c04f3eb 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -413,7 +413,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
             break;
 
         default:
-            ASSERT(!this, "unexpected slot-id");
+            OSL_ENSURE(!this, "unexpected slot-id");
         }
     }
 }
@@ -526,7 +526,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
             break;
 
         default:
-            ASSERT(!this, "unexpected slot-id");
+            OSL_ENSURE(!this, "unexpected slot-id");
             return;
     }
 
@@ -680,7 +680,7 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq )
             break;
 
         default:
-            ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong dispatcher");
         }
 
         if( nMode )
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 62235ef..a77e760 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -238,10 +238,10 @@ void SwFrameShell::Execute(SfxRequest &rReq)
         case FN_FORMAT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), 
GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -250,10 +250,10 @@ void SwFrameShell::Execute(SfxRequest &rReq)
         {
             SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
                                                         GetView().GetWindow(), &aTmp, 
GetView().GetWrtShell());
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -288,7 +288,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
             }
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( 
GetView().GetWindow() );
             pDialog->SetValues(aCurr, aDocStat );
             pDialog->Execute();
@@ -452,7 +452,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
                 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric) ));
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
                                                         GetView().GetViewFrame(),
                                                         GetView().GetWindow(),
@@ -462,7 +462,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                                                                                         
DLG_FRM_STD,
                                                         FALSE,
                                                         nDefPage);
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
                 if ( pDlg->Execute() )
                 {
@@ -534,7 +534,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                                 //needs cast - no non-const method available
                                 SwFrmFmt* pPrevFmt = (SwFrmFmt*)
                                     lcl_GetFrmFmtByName(rSh, sPrevName);
-                                DBG_ASSERT(pPrevFmt, "No frame found!");
+                                OSL_ENSURE(pPrevFmt, "No frame found!");
                                 if(pPrevFmt)
                                 {
                                     rSh.Chain(*pPrevFmt, *pCurrFlyFmt);
@@ -568,7 +568,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                                 //needs cast - no non-const method available
                                 SwFrmFmt* pNextFmt = (SwFrmFmt*)
                                     lcl_GetFrmFmtByName(rSh, sNextName);
-                                DBG_ASSERT(pNextFmt, "No frame found!");
+                                OSL_ENSURE(pNextFmt, "No frame found!");
                                 if(pNextFmt)
                                 {
                                     rSh.Chain(*(SwFrmFmt*)
@@ -631,7 +631,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
         break;
         // <--
         default:
-            ASSERT( !this, "falscher Dispatcher" );
+            OSL_ENSURE( !this, "wrong dispatcher" );
             return;
     }
     // Vorlagen-AutoUpdate
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 83de701..bb6481c 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -227,12 +227,12 @@ void SwGrfShell::Execute(SfxRequest &rReq)
             aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame()));
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_GRF,
                                                     GetView().GetViewFrame(),
                                                     GetView().GetWindow(),
                                                     aSet, FALSE, DLG_FRM_GRF);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             if( pDlg->Execute() )
             {
                 rSh.StartAllAction();
@@ -359,7 +359,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
@@ -503,7 +503,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
             break;
 
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
         }
         if( aGrfSet.Count() )
             GetShell().SetAttr( aGrfSet );
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 6589619..4385146 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -256,7 +256,7 @@ namespace SwLangHelper
             USHORT nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang );
             
             EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
-            DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
+            OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
 
             //get ScriptType
             USHORT nLangWhichId = 0;
@@ -268,7 +268,7 @@ namespace SwLangHelper
                 case SCRIPTTYPE_COMPLEX :  nLangWhichId = pEditEngine ? EE_CHAR_LANGUAGE_CTL : 
RES_CHRATR_CTL_LANGUAGE; break;
                 default: 
                     bIsSingleScriptType = false;
-                    DBG_ERROR( "unexpected case" );
+                    OSL_ENSURE(false, "unexpected case" );
             }
             if (bIsSingleScriptType)
             {
@@ -341,7 +341,7 @@ namespace SwLangHelper
             // whole paragraph)
 
             EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
-            DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
+            OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
             if (pEditEngine)
             {
                 for (sal_uInt16 i = 0; i < 3; ++i)
@@ -439,7 +439,7 @@ namespace SwLangHelper
             // there is more than one language...
             nLang = LANGUAGE_DONTKNOW;
         }
-        DBG_ASSERT( nLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+        OSL_ENSURE( nLang != LANGUAGE_SYSTEM, "failed to get the language?" );
 
         return nLang;
     }
@@ -490,7 +490,7 @@ namespace SwLangHelper
                 }
             }
         }
-        DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+        OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
 
         return nCurrentLang;
     }
@@ -538,7 +538,7 @@ namespace SwLangHelper
                 }    
             }
         }
-        DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
+        OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" );
 
         return nCurrentLang;
     }
diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx
index fffcd12..6f8980b 100644
--- a/sw/source/ui/shells/listsh.cxx
+++ b/sw/source/ui/shells/listsh.cxx
@@ -155,7 +155,7 @@ void SwListShell::Execute(SfxRequest &rReq)
 
     // --> FME 2005-01-04 #i35572#
     const SwNumRule* pCurRule = rSh.GetCurNumRule();
-    ASSERT( pCurRule, "SwListShell::Execute without NumRule" )
+    OSL_ENSURE( pCurRule, "SwListShell::Execute without NumRule" )
     bool bOutline = pCurRule && pCurRule->IsOutlineRule();
     // <--
 
@@ -243,7 +243,7 @@ void SwListShell::Execute(SfxRequest &rReq)
         }
         break;
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 8189f10..7af7f77 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -534,7 +534,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                     aBox.SetDistance( Max(rCoreBox.GetDistance(),(USHORT)MIN_BORDER_DIST)  );
             }
             else
-                {ASSERT( !this, "Wo ist das Box-Item?" )}
+                {OSL_ENSURE( !this, "where is BoxItem?" )}
 
             //since the drawing layer also supports borders the which id might be a different one
             SvxBoxInfoItem aInfo( SID_ATTR_BORDER_INNER );
@@ -625,10 +625,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
             if ( bUseDialog )
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 pDlg = pFact->CreateSwTableTabDlg( GetView().GetWindow(), GetPool(), &aCoreSet, 
&rSh, DLG_FORMAT_TABLE );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
             }
             aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
             rSh.GetTblAttr(aCoreSet);
@@ -702,12 +702,12 @@ void SwTableShell::Execute(SfxRequest &rReq)
                                     sCurText, SID_ATTR_NUMBERFORMAT_INFO ));
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet,
                     pView->GetViewFrame()->GetFrame().GetFrameInterface(),
                     RC_DLG_SWNUMFMTDLG );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
                 if (RET_OK == pDlg->Execute())
                 {
@@ -797,7 +797,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
                         aInfoBox.Execute();
                         break;
                     }
-                    default: ASSERT( !this, "unbekannter Returnwert MergeTab.");
+                    default: OSL_ENSURE( !this, "unknown return value MergeTab.");
                 }
         break;
         case FN_TABLE_ADJUST_CELLS:
@@ -850,10 +850,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
         case SID_AUTOFORMAT:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             AbstractSwAutoFormatDlg* pDlg = 
pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh , DLG_AUTOFMT_TABLE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
         }
@@ -861,17 +861,17 @@ void SwTableShell::Execute(SfxRequest &rReq)
         case FN_TABLE_SET_ROW_HEIGHT:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, 
DLG_ROW_HEIGHT );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
         }
         break;
         case FN_NUMBER_BULLETS:
         case FN_NUM_BULLET_ON:
-            ASSERT( !this, "Funktion darf zur Zeit nicht gerufen werden." );
+            OSL_ENSURE( !this, "function may not be called now." );
         break;
 
         case FN_TABLE_INSERT_COL:
@@ -1019,10 +1019,10 @@ void SwTableShell::Execute(SfxRequest &rReq)
             else
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 AbstractSplitTableDialog* pDlg = pFact->CreateSplitTblDialog( 
GetView().GetWindow(), rSh );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 pDlg->Execute();
                 rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) );
                 delete pDlg;
@@ -1039,9 +1039,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
             if( bPrev && bNext )
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
                 VclAbstractDialog* pDlg = pFact->CreateSwVclDialog( DLG_MERGE_TABLE, 
GetView().GetWindow(), bPrev );
-                DBG_ASSERT(pDlg, "dialogdiet pDlg fail!");
+                OSL_ENSURE(pDlg, "dialogdiet pDlg fail!");
                 if( RET_OK != pDlg->Execute())
                     bPrev = bNext = FALSE;
                 delete pDlg;
@@ -1212,7 +1212,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT( !this, "falscher Dispatcher" );
+            OSL_ENSURE( !this, "wrong Dispatcher" );
             return;
     }
     if(bCallDone)
@@ -1539,7 +1539,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
         break;
 
     default:
-        ASSERT(FALSE, falscher Dispatcher);
+        OSL_ENSURE(false, "wrong dispatcher");
         return;
     }
 
diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx
index 02d847f..9aba16d 100644
--- a/sw/source/ui/shells/textdrw.cxx
+++ b/sw/source/ui/shells/textdrw.cxx
@@ -87,7 +87,7 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con
             SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
             uno::Reference< awt::XControlModel >  xControlModel = pUnoCtrl->GetUnoControlModel();
 
-            ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+            OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
             if( !xControlModel.is() )
                 return;
 
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index bf0ecc7..22d16b2 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -149,10 +149,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     default:
                     {
                         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                         SfxAbstractDialog* pDlg = pFact->CreateSwFldEditDlg( 
GetView(),RC_DLG_SWFLDEDITDLG );
-                        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                        OSL_ENSURE(pDlg, "Dialogdiet fail!");
                         pDlg->Execute();
                         delete pDlg;
                     }
@@ -240,7 +240,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     if( SFX_ITEM_SET == pArgs->GetItemState(
                                         FN_PARAM_FIELD_FORMAT, FALSE, &pItem ))
                         nFormat = ((SfxUInt32Item *)pItem)->GetValue();
-                    DBG_WARNING("Command is not yet used");
+                    OSL_ENSURE(false, "Command is not yet used");
                     sal_Unicode cSeparator = ' ';
                     SwInsertFld_Data aData(nType, 0, aPar1, aPar2, nFormat, GetShellPtr(), 
cSeparator );
                     bRes = aFldMgr.InsertFld(aData);
@@ -418,9 +418,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     BOOL bTravel = FALSE;
 
                     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                    DBG_ASSERT(pFact, "Dialogdiet fail!");
+                    OSL_ENSURE(pFact, "Dialogdiet fail!");
                     ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( 
RID_SVXDLG_POSTIT );
-                    DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
+                    OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()");
                     SfxItemSet aSet(GetPool(), fnGetRange());
                     aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT));
                     aSet.Put(SvxPostItAuthorItem(pRedline->GetAuthorString(), 
SID_ATTR_POSTIT_AUTHOR));
@@ -463,9 +463,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     bTravel |= bNext|bPrev;
 
                     SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create();
-                    DBG_ASSERT(pFact2, "Dialogdiet fail!");
+                    OSL_ENSURE(pFact2, "Dialogdiet fail!");
                     AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, 
bTravel, TRUE );
-                    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                    OSL_ENSURE(pDlg, "Dialogdiet fail!");
                     pDlg->HideAuthor();
 
                     String sTitle(SW_RES(STR_REDLINE_COMMENT));
@@ -524,10 +524,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                 else
                 {
                     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                    DBG_ASSERT(pFact, "Dialogdiet fail!");
+                    OSL_ENSURE(pFact, "Dialogdiet fail!");
                     AbstractJavaEditDialog* pDlg = pFact->CreateJavaEditDialog( DLG_JAVAEDIT,
                                                             pMDI, &rSh);
-                    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                    OSL_ENSURE(pDlg, "Dialogdiet fail!");
                     if ( pDlg->Execute() )
                     {
                         aType = pDlg->GetType();
@@ -603,7 +603,7 @@ FIELD_INSERT:
             }
             break;
             default:
-                ASSERT(FALSE, falscher Dispatcher);
+                OSL_ENSURE(false, "wrong dispatcher");
                 return;
         }
     }
diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx
index 5fcef9a..b91d04b 100644
--- a/sw/source/ui/shells/textglos.cxx
+++ b/sw/source/ui/shells/textglos.cxx
@@ -88,7 +88,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
                     aShortName = (( const SfxStringItem *)pItem)->GetValue();
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( 
DLG_RENAME_GLOS );
                 if ( fnSetActGroup )
                     (*fnSetActGroup)( aGroup );
@@ -104,7 +104,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
             {
                 String aGroup = (( const SfxStringItem *)pItem)->GetValue();
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( 
DLG_RENAME_GLOS );
                 if ( fnSetActGroup )
                     (*fnSetActGroup)( aGroup );
@@ -120,7 +120,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
                 if(SFX_ITEM_SET ==  pArgs->GetItemState(FN_PARAM_1, FALSE, &pItem ))
                     aName = (( const SfxStringItem *)pItem)->GetValue();
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( 
DLG_RENAME_GLOS );
                 if ( fnSetActGroup )
                     (*fnSetActGroup)( aGroup );
@@ -131,7 +131,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq)
         }
         break;
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong dispatcher");
             return;
     }
     if(bUpdateList)
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index caa6d51..941f2db 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -69,9 +69,9 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
         case FN_EDIT_AUTH_ENTRY_DLG :
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( pMDI, GetShell(), 
DLG_EDIT_AUTHMARK);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
         }
@@ -97,19 +97,19 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
             {  // Mehrere Marken, welche solls denn sein ?
                 //
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK,
                                                         pMDI, aMgr);
-                DBG_ASSERT(pMultDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pMultDlg, "Dialogdiet fail!");
                 nRet = pMultDlg->Execute();
                 delete pMultDlg;
             }
             if(        nRet == RET_OK)
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg( DLG_EDIT_IDXMARK, pMDI, 
GetShell(), aMgr.GetCurTOXMark() );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 pDlg->Execute();
                 delete pDlg;
             }
@@ -154,11 +154,11 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
                     aSet.Put(*pSet);
             }
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX,
                                                         pMDI, aSet, rSh, (SwTOXBase* )pCurTOX,
                                                         USHRT_MAX, bGlobal);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
         }
@@ -167,13 +167,13 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
         {
             SwWrtShell& rSh = GetShell();
             const SwTOXBase* pBase = rSh.GetCurTOX();
-            DBG_ASSERT(pBase, "no TOXBase to remove");
+            OSL_ENSURE(pBase, "no TOXBase to remove");
             if( pBase )
                 rSh.DeleteTOX(*pBase, TRUE);
         }
         break;
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 511eb86..47bdcab 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -146,8 +146,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
 {
     SwWrtShell &rSh = GetShell();
 
-    ASSERT( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
-            "Falsche Shell auf dem Dispatcher" );
+    OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
+            "wrong shell on dispatcher" );
 
     const SfxItemSet *pArgs = rReq.GetArgs();
     const SfxPoolItem* pItem = 0;
@@ -364,7 +364,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
         }
         else
         {
-            DBG_ASSERT( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
+            OSL_ENSURE( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
             rSh.InsertObject( xObj, pName, TRUE, nSlot);
             rReq.Done();
         }
@@ -640,10 +640,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, 
GetView().GetDocShell()));
             SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric)));
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
                                                     GetView().GetViewFrame(), 
&GetView().GetViewFrame()->GetWindow(), aSet, TRUE);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             if(pDlg->Execute() && pDlg->GetOutputItemSet())
             {
                 GetShell().LockPaint();
@@ -704,10 +704,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
         else
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER,
                                                         pParent );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             // MessageBox fuer fehlende Grafiken
             if(!pDlg->HasImages())
                 InfoBox( pParent, SW_RES(MSG_NO_RULER)).Execute();
@@ -759,16 +759,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
     case FN_FORMAT_COLUMN :
     {
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "Dialogdiet fail!");
+        OSL_ENSURE(pFact, "Dialogdiet fail!");
         VclAbstractDialog* pColDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, 
DLG_COLUMN);
-        DBG_ASSERT(pColDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pColDlg, "Dialogdiet fail!");
         pColDlg->Execute();
         delete pColDlg;
     }
     break;
 
     default:
-        ASSERT( !this, "falscher Dispatcher" );
+        OSL_ENSURE(!this, "wrong  dispatcher");
         return;
     }
 }
@@ -992,7 +992,7 @@ void  SwTextShell::ExecDelete(SfxRequest &rReq)
             rSh.DelLine();
             break;
         default:
-            ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
     rReq.Done();
@@ -1037,7 +1037,7 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq )
             break;
 
         default:
-            ASSERT(!this, "falscher Dispatcher");
+            OSL_ENSURE(!this, "wrong dispatcher");
         }
 
         if( nMode )
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 3a67953..4cff3a2 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -182,10 +182,10 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, BOOL bUseDialog, USHORT nSlot,const 
Sfx
     if ( bUseDialog && GetActiveView() )
     {
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
         pDlg = pFact->CreateSwCharDlg( rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, 
DLG_CHAR );
-        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pDlg, "Dialogdiet fail!");
         if( FN_INSERT_HYPERLINK == nSlot )
             pDlg->SetCurPageId(TP_CHAR_URL);
     }
@@ -453,10 +453,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
         case FN_INSERT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE,
                                                         GetView().GetWindow(), rWrtSh, FALSE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->SetHelpId(nSlot);
             if ( pDlg->Execute() == RET_OK )
             {
@@ -477,10 +477,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
         case FN_FORMAT_FOOTNOTE_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), 
rWrtSh, DLG_DOC_FOOTNOTE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -540,10 +540,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
             else
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 AbstractSwBreakDlg* pDlg = pFact->CreateSwBreakDlg( GetView().GetWindow(), rWrtSh, 
DLG_BREAK );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if ( pDlg->Execute() == RET_OK )
                 {
                     nKind = pDlg->GetKind();
@@ -588,10 +588,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
             else
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 VclAbstractDialog* pDlg = pFact->CreateSwInsertBookmarkDlg( GetView().GetWindow(), 
rWrtSh, rReq, DLG_INSERT_BOOKMARK );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 pDlg->Execute();
                 delete pDlg;
             }
@@ -621,10 +621,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
                 pVFrame->ToggleChildWindow(FN_REDLINE_ACCEPT);
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             AbstractSwModalRedlineAcceptDlg* pDlg = pFact->CreateSwModalRedlineAcceptDlg( 
&GetView().GetEditWin(), DLG_MOD_REDLINE_ACCEPT );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
             switch (lcl_AskRedlineMode(&GetView().GetEditWin()))
             {
@@ -686,10 +686,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
         case FN_SORTING_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), 
rWrtSh, DLG_SORTING );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -699,10 +699,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
         {
             SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
                                                         GetView().GetWindow(), &aTmp, rWrtSh);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             rReq.Done();
@@ -946,10 +946,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
             if ( bUseDialog && GetActiveView() )
             {
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet,DLG_STD, 
DLG_PARA,NULL, FALSE, nDefPage );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
             }
             SfxItemSet* pSet = NULL;
             if ( !bUseDialog )
@@ -1332,7 +1332,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
         }
 
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "Dialogdiet fail!");
+        OSL_ENSURE(pFact, "Dialogdiet fail!");
         AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() 
);
         pDialog->SetValues(aCurr, aDocStat );
         pDialog->Execute();
@@ -1340,7 +1340,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
     }
     break;
     default:
-        ASSERT(!this, falscher Dispatcher);
+        OSL_ENSURE(!this, "wrong dispatcher");
         return;
     }
 }
diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx
index 45318f2..632cea5 100644
--- a/sw/source/ui/shells/textsh2.cxx
+++ b/sw/source/ui/shells/textsh2.cxx
@@ -251,7 +251,7 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
             break;
 
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
@@ -284,7 +284,7 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct )
         {
             SwDBData aDBData = pDBStruct->aDBData;
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
             ::std::auto_ptr<AbstractSwInsertDBColAutoPilot>pDlg 
(pFact->CreateSwInsertDBColAutoPilot( pThis->GetView(),
                                                                                                 
xSource,
                                                                                                 
xColSupp,
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 52deac5..71571fd 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -180,7 +180,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
                 rSh.DontExpandFmt();
         break;
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong  dispatcher");
             return;
     }
 }
@@ -280,7 +280,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong  dispatcher");
             return;
     }
 }
@@ -326,7 +326,7 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq)
     case FN_SET_LINE_SPACE_2:  lcl_SetLineSpace(200,aSet);     break;
 
     default:
-        DBG_ERROR("SwTextShell::ExecParaAttr falscher Dispatcher");
+        OSL_ENSURE(false, "SwTextShell::ExecParaAttr wrong Dispatcher");
         return;
     }
     SwWrtShell& rWrtSh = GetShell();
@@ -490,7 +490,7 @@ SET_LINESPACE:
         break;
 
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong  dispatcher");
             return;
     }
     SwWrtShell& rWrtSh = GetShell();
@@ -547,11 +547,11 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
                                            HINT_END, HINT_END, 0);
                 rSh.GetCurAttr(aSet);
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
                 SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aSet, 
                     rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS );
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if (pDlg->Execute() == RET_OK)
                 {
                     rSh.StartAction();
@@ -593,7 +593,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong  dispatcher");
             return;
     }
 }
diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx
index 94cdf68..3cf887b 100644
--- a/sw/source/ui/shells/txtcrsr.cxx
+++ b/sw/source/ui/shells/txtcrsr.cxx
@@ -97,7 +97,7 @@ void SwTextShell::ExecBasicMove(SfxRequest &rReq)
         case FN_CHAR_RIGHT: rSh.Right( CRSR_SKIP_CELLS, bSelect, 1, FALSE, TRUE ); break;
         case FN_LINE_UP:    rSh.Up   ( bSelect, 1 ); break;
         case FN_LINE_DOWN:  rSh.Down ( bSelect, 1 ); break;
-        default:            ASSERT(FALSE, falscher Dispatcher); return;
+        default: OSL_ENSURE(false, "wrong Dispatcher"); return;
         }
     }
 
@@ -134,7 +134,7 @@ void SwTextShell::ExecMove(SfxRequest &rReq)
         case FN_SELECT_WORD:                   bRet = rSh.SelNearestWrd();     break;
 
         case SID_SELECTALL:             bRet = 0 != rSh.SelAll();   break;
-        default:                                       ASSERT(FALSE, falscher Dispatcher); return;
+        default: OSL_ENSURE(false, "wrong dispatcher"); return;
     }
 
     if ( bRet )
@@ -171,7 +171,7 @@ void SwTextShell::ExecMovePage(SfxRequest &rReq)
 
         case FN_END_OF_PAGE_SEL:
         case FN_END_OF_PAGE:        rSh.EndPg  ( FN_END_OF_PAGE_SEL == nSlot ); break;
-        default:                                       ASSERT(FALSE, falscher Dispatcher); return;
+        default: OSL_ENSURE(false, "wrong dispatcher"); return;
     }
     rReq.Done();
 }
@@ -188,7 +188,7 @@ void SwTextShell::ExecMoveCol(SfxRequest &rReq)
         case FN_END_OF_NEXT_COLUMN:      rSh.EndOfNextColumn  ( FALSE ); break;
         case FN_START_OF_PREV_COLUMN: rSh.StartOfPrevColumn( FALSE ); break;
         case FN_END_OF_PREV_COLUMN:      rSh.EndOfPrevColumn  ( FALSE ); break;
-        default:                                         ASSERT(FALSE, falscher Dispatcher); 
return;
+        default: OSL_ENSURE(false, "wrong dispatcher"); return;
     }
     rReq.Done();
 }
@@ -231,7 +231,7 @@ void SwTextShell::ExecMoveLingu(SfxRequest &rReq)
 
         case FN_PREV_PARA:      bRet = rSh.BwdPara    ( FALSE );
         break;
-        default:                ASSERT(FALSE, falscher Dispatcher); return;
+        default: OSL_ENSURE(false, "wrong dispatcher"); return;
     }
     rReq.Done();
 }
@@ -349,7 +349,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
             break;
 
         default:
-            ASSERT(FALSE, falscher Dispatcher);
+            OSL_ENSURE(false, "wrong dispatcher");
             return;
     }
 
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index 26b6593..d3ac0e3 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -130,7 +130,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
 
             aSet.Put(SvxNumBulletItem(aRule));
             // --> OD 2008-02-29 #refactorlists# - removed <bHasChild>
-            ASSERT( GetShell().GetNumLevel() < MAXLEVEL,
+            OSL_ENSURE( GetShell().GetNumLevel() < MAXLEVEL,
                     "<SwTextShell::ExecEnterNum()> - numbered node without valid list level. 
Serious defect -> please inform OD." );
             USHORT nLevel = GetShell().GetNumLevel();
             // <--
@@ -182,10 +182,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
         pDocSh->PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(pDocSh)));
 
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "Dialogdiet fail!");
+        OSL_ENSURE(pFact, "Dialogdiet fail!");
         SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET,
                                                         GetView().GetWindow(), &aSet, GetShell());
-        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pDlg, "Dialogdiet fail!");
         USHORT nRet = pDlg->Execute();
         const SfxPoolItem* pItem;
         if( RET_OK == nRet )
@@ -242,7 +242,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
     }
     break;
     default:
-        ASSERT(FALSE,  falscher Dispatcher);
+        OSL_ENSURE(false, "wrong dispatcher");
         return;
     }
 }
diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx
index 5c6b834..d3e4929 100644
--- a/sw/source/ui/table/chartins.cxx
+++ b/sw/source/ui/table/chartins.cxx
@@ -83,7 +83,7 @@ Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize, co
 
     Point aRet;
 
-    DBG_ASSERT( pParentWin, "Window not found" );
+    OSL_ENSURE( pParentWin, "Window not found" );
     if (pParentWin)
     {
         Rectangle aObjPixel = pParentWin->LogicToPixel( rLogicChart, pParentWin->GetMapMode() );
@@ -250,7 +250,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
                     }
                     catch( uno::Exception& )
                     {
-                        DBG_ERROR( "Chart wizard couldn't be positioned automatically\n" );
+                        OSL_ENSURE(false, "Chart wizard couldn't be positioned automatically\n" );
                     }
                 }
 
@@ -262,7 +262,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
                 }
                 else
                 {
-                    DBG_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
+                    OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK,
                         "dialog execution failed" );
                 }
             }
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 095e059..9e3d723 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -232,10 +232,10 @@ SwConvertTableDlg::       ~SwConvertTableDlg()
 IMPL_LINK( SwConvertTableDlg, AutoFmtHdl, PushButton*, pButton )
 {
     SwAbstractDialogFactory* pFact = swui::GetFactory();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
     AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pShell, 
DLG_AUTOFMT_TABLE, FALSE, pTAutoFmt);
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if( RET_OK == pDlg->Execute())
         pDlg->FillAutoFmtOfIndex( pTAutoFmt );
     delete pDlg;
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 39fb562..d262222 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -221,10 +221,10 @@ IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField )
 IMPL_LINK( SwInsTableDlg, AutoFmtHdl, PushButton*, pButton )
 {
     SwAbstractDialogFactory* pFact = swui::GetFactory();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
     AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,pShell, 
DLG_AUTOFMT_TABLE, FALSE, pTAutoFmt );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if( RET_OK == pDlg->Execute())
         pDlg->FillAutoFmtOfIndex( pTAutoFmt );
     delete pDlg;
diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx
index 022ba1f..27af46c 100644
--- a/sw/source/ui/table/swtablerep.cxx
+++ b/sw/source/ui/table/swtablerep.cxx
@@ -77,7 +77,7 @@ void DbgTColumn(TColumn* pTColumn, USHORT nCount)
         String sMsg(i);
         sMsg += pTColumn[i].bVisible ? " v " : " h ";
         sMsg += pTColumn[i].nWidth;
-        DBG_ERROR(sMsg)
+        OSL_ENSURE(false, sMsg)
     }
 }
 #endif
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 8df9da1..5427995 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -78,12 +78,11 @@
 
 using namespace ::com::sun::star;
 
-
 #ifdef DEBUG_TBLDLG
 void DbgTblRep(SwTableRep* pRep)
 {
-    DBG_ERROR(String(pRep->GetColCount()))
-    DBG_ERROR(String(pRep->GetAllColCount()))
+    OSL_ENSURE(false, String(pRep->GetColCount()))
+    OSL_ENSURE(false, String(pRep->GetAllColCount()))
     SwTwips nSum = 0;
     for(USHORT i = 0; i < pRep->GetAllColCount(); i++)
     {
@@ -91,23 +90,23 @@ void DbgTblRep(SwTableRep* pRep)
         sMsg += pRep->GetColumns()[i].bVisible ? " v " : " h ";
         sMsg += pRep->GetColumns()[i].nWidth;
         nSum +=pRep->GetColumns()[i].nWidth;
-        DBG_ERROR(sMsg)
+        OSL_ENSURE(false, sMsg)
     }
-    String sMsg("Spaltensumme: ");
+    String sMsg("Column sum: ");
     sMsg += nSum;
-    sMsg += " Tblbreite: ";
+    sMsg += " table width: ";
     sMsg += pRep->GetWidth();
-    DBG_ERROR(sMsg)
+    OSL_ENSURE(false, sMsg)
     sMsg = "Gesamt/Links/Rechts: ";
     sMsg += pRep->GetSpace();
     sMsg += '/';
     sMsg += pRep->GetLeftSpace();
     sMsg += '/';
     sMsg += pRep->GetRightSpace();
-    DBG_ERROR(sMsg)
+    OSL_ENSURE(false, sMsg)
     sMsg = "Align: ";
     sMsg += pRep->GetAlign();
-    DBG_ERROR(sMsg)
+    OSL_ENSURE(false, sMsg)
 
 };
 
@@ -212,7 +211,7 @@ void  SwFormatTablePage::Init()
 
 IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, CheckBox *, pBtn )
 {
-    DBG_ASSERT(pTblData, "Tabellendaten nicht da?");
+    OSL_ENSURE(pTblData, "table data not available?");
     BOOL bIsChecked = pBtn->IsChecked();
     sal_Int64 nLeft  = aLeftMF.DenormalizePercent(aLeftMF.GetValue(FUNIT_TWIP ));
     sal_Int64 nRight = aRightMF.DenormalizePercent(aRightMF.GetValue(FUNIT_TWIP ));
@@ -658,7 +657,7 @@ void  SwFormatTablePage::Reset( const SfxItemSet& )
 ------------------------------------------------------------------------*/
 void   SwFormatTablePage::ActivatePage( const SfxItemSet& rSet )
 {
-    DBG_ASSERT(pTblData, "Tabellendaten nicht da?");
+    OSL_ENSURE(pTblData, "table data not available?");
     if(SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_REP ))
     {
         SwTwips nCurWidth = text::HoriOrientation::FULL != pTblData->GetAlign() ?
@@ -1115,7 +1114,7 @@ void   SwTableColumnPage::UpdateCols( USHORT nAktPos )
                     nDiff = 0;
                     SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
                 }
-                DBG_ASSERT(nDiff >= 0, "nDiff < 0 kann hier nicht sein!");
+                OSL_ENSURE(nDiff >= 0, "nDiff < 0 cannot be here!");
             }
         }
     }
@@ -1123,7 +1122,7 @@ void   SwTableColumnPage::UpdateCols( USHORT nAktPos )
     {
 //             Differenz wird ueber die Tabellenbreite ausgeglichen,
 //             andere Spalten bleiben unveraendert
-        DBG_ASSERT(nDiff <= pTblData->GetSpace() - nTableWidth, "Maximum falsch eingestellt" );
+        OSL_ENSURE(nDiff <= pTblData->GetSpace() - nTableWidth, "wrong maximum" );
         SwTwips nActSpace = pTblData->GetSpace() - nTableWidth;
         if(nDiff > nActSpace)
         {
@@ -1139,7 +1138,7 @@ void   SwTableColumnPage::UpdateCols( USHORT nAktPos )
     {
 //             Alle Spalten werden proportional mitveraendert, die Tabellenbreite wird
 //     entsprechend angepasst
-        DBG_ASSERT(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "Maximum falsch 
eingestellt" );
+        OSL_ENSURE(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "wrong maximum" 
);
         long nAdd = nDiff;
         if(nDiff * nNoOfVisibleCols > pTblData->GetSpace() - nTableWidth)
         {
@@ -1336,7 +1335,7 @@ SwTwips  SwTableColumnPage::GetVisibleWidth(USHORT nPos)
         i++;
     }
     SwTwips nReturn = pTblData->GetColumns()[i].nWidth;
-    DBG_ASSERT(i < nNoOfCols, "Array index out of range");
+    OSL_ENSURE(i < nNoOfCols, "Array index out of range");
     while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols)
         nReturn += pTblData->GetColumns()[++i].nWidth;
 
@@ -1355,7 +1354,7 @@ void SwTableColumnPage::SetVisibleWidth(USHORT nPos, SwTwips nNewWidth)
             nPos--;
         i++;
     }
-    DBG_ASSERT(i < nNoOfCols, "Array index out of range");
+    OSL_ENSURE(i < nNoOfCols, "Array index out of range");
     pTblData->GetColumns()[i].nWidth = nNewWidth;
     while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols)
         pTblData->GetColumns()[++i].nWidth = 0;
@@ -1372,7 +1371,7 @@ SwTableTabDlg::SwTableTabDlg(Window* pParent, SfxItemPool& ,
 {
     FreeResource();
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     AddTabPage(TP_FORMAT_TABLE, &SwFormatTablePage::Create, 0 );
     AddTabPage(TP_TABLE_TEXTFLOW, &SwTextFlowPage::Create, 0 );
     AddTabPage(TP_TABLE_COLUMN, &SwTableColumnPage::Create, 0 );
diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx
index 5506424..d011d1c 100644
--- a/sw/source/ui/table/tablemgr.cxx
+++ b/sw/source/ui/table/tablemgr.cxx
@@ -67,10 +67,10 @@ void SwTableFUNC::ColWidthDlg( Window *pParent )
 {
     InitTabCols();
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
     VclAbstractDialog* pDlg = pFact->CreateSwTableWidthDlg( pParent, *this ,DLG_COL_WIDTH );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     pDlg->Execute();
     delete pDlg;
 }
@@ -114,7 +114,7 @@ SwTwips SwTableFUNC::GetColWidth(USHORT nNum) const
 
 SwTwips SwTableFUNC::GetMaxColWidth( USHORT nNum ) const
 {
-    ASSERT(nNum <= aCols.Count(), "Index out of Area");
+    OSL_ENSURE(nNum <= aCols.Count(), "Index out of Area");
 
     if ( GetColCount() > 0 )
     {
@@ -176,7 +176,7 @@ void SwTableFUNC::SetColWidth(USHORT nNum, SwTwips nNewWidth )
 
 void SwTableFUNC::InitTabCols()
 {
-    ASSERT(pSh, keine Shell);
+    OSL_ENSURE(pSh, "no Shell");
 
     if( pFmt && pSh)
         pSh->GetTabCols( aCols );
@@ -315,7 +315,7 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart(
             else if (nColLen > 1)
                 eDataRowSource = chart::ChartDataRowSource_COLUMNS;
             else {
-                DBG_ERROR( "unexpected state" );
+                OSL_ENSURE(false, "unexpected state" );
             }
         }
 
@@ -368,7 +368,7 @@ USHORT      SwTableFUNC::GetColCount() const
 
 int SwTableFUNC::GetRightSeparator(int nNum) const
 {
-    DBG_ASSERT( nNum < (int)GetColCount() ,"Index out of range");
+    OSL_ENSURE( nNum < (int)GetColCount() ,"Index out of range");
     int i = 0;
     while( nNum >= 0 )
     {
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 060605e..ebf1850 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -599,7 +599,7 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell*
     else
         mbRTL = pWrtShell->IsTableRightToLeft();
     
-    DBG_ASSERT( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
+    OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
     if ( m_xMSF.is() )
     {
         m_xBreak = uno::Reference< i18n::XBreakIterator >(
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 3ee09ff..0fc0e8c 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -812,7 +812,7 @@ void  SwPagePreView::Execute( SfxRequest &rReq )
                 if(pFact)
                 {
                     pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet);
-                    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                    OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 }
 
                 pDlg->SetLimits( MINZOOM, MAXZOOM );
@@ -982,7 +982,7 @@ MOVEPAGE:
         }
         break;
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 
@@ -995,7 +995,7 @@ void  SwPagePreView::GetState( SfxItemSet& rSet )
     SfxWhichIter aIter(rSet);
     BYTE nRow = 1;
     USHORT nWhich = aIter.FirstWhich();
-    ASSERT(nWhich, leeres Set);
+    OSL_ENSURE(nWhich, "empty set");
     SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
     //#106746# zoom has to be disabled if Accessibility support is switched on
     // MT 2010/01, see #110498# 
@@ -1333,7 +1333,7 @@ int SwPagePreView::_CreateScrollbar( BOOL bHori )
     Window *pMDI = &GetViewFrame()->GetWindow();
     SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
 
-    ASSERT( !*ppScrollbar, "vorher abpruefen!" )
+    OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" )
 
     if( !bHori )
     {
@@ -1778,11 +1778,11 @@ USHORT  SwPagePreView::SetPrinter( SfxPrinter *pNew, USHORT nDiffFlags, 
bool )
             SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
             SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
         };
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
     {
         const USHORT* pPtr = aInval + 1;
         do {
-            ASSERT( *(pPtr - 1) < *pPtr, "falsche Sortierung!" );
+            OSL_ENSURE( *(pPtr - 1) < *pPtr, "wrong sorting!" );
         } while( *++pPtr );
     }
 #endif
@@ -1809,7 +1809,7 @@ PrintDialog*  SwPagePreView::CreatePrintDialog( Window *pParent )
 // OD 18.12.2002 #103492# - no longer needed ??
 Size  SwPagePreView::GetOptimalSizePixel() const
 {
-    ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
+    OSL_ENSURE( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed 
??" )
     return Size( -1, -1 );
 /*
     //JP 09.06.99: was wird hier errechnet ?????
@@ -1951,7 +1951,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible >
     vos::OGuard aGuard(Application::GetSolarMutex());  // this should have
                                                         // happend already!!!
 
-    DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
+    OSL_ENSURE( GetViewShell() != NULL, "We need a view shell" );
     return GetViewShell()->CreateAccessiblePreview();
 }
 
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index 8476f59..bea2434 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -242,7 +242,7 @@ SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
 SwSrcView::~SwSrcView()
 {
     SwDocShell* pDocShell = GetDocShell();
-    DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+    OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
     const TextSelection&  rSel = aEditWin.GetTextView()->GetSelection();
     ((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< USHORT >( rSel.GetStart().GetPara() ) 
);
 
@@ -382,7 +382,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
             const SfxItemSet* pTmpArgs = rReq.GetArgs();
 
             USHORT nWhich = pTmpArgs->GetWhichByPos( 0 );
-            DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" );
+            OSL_ENSURE( nWhich, "Wich fuer SearchItem ?" );
             const SfxPoolItem& rItem = pTmpArgs->Get( nWhich );
             SetSearchItem( (const SvxSearchItem&)rItem);
             StartSearchAndReplace( (const SvxSearchItem&)rItem, FALSE, rReq.IsAPI() );
@@ -757,7 +757,7 @@ sal_Int32 SwSrcView::PrintSource(
     
     pOutDev->Pop();
 
-    DBG_ASSERT( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" );
+    OSL_ENSURE( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" );
     return nCurPage;
 }
 
@@ -866,7 +866,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
         pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt
     // AutoLoad abschalten
     pDocShell->SetAutoLoad(INetURLObject(), 0, FALSE);
-    DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+    OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
     USHORT nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
     aEditWin.SetStartLine(nLine);
     aEditWin.GetTextEngine()->ResetUndo();
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index b96c507..4bff425 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -799,7 +799,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
     BOOL bOldModifyFlag = pDocSh->IsEnableSetModified();
     if(bOldModifyFlag)
         pDocSh->EnableSetModified( sal_False );
-    ASSERT( pDocSh, "View ohne DocShell." );
+    OSL_ENSURE( pDocSh, "view without DocShell." );
     SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh );
 
     const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell);
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 8b6afc4..f06c991 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -494,7 +494,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT(sal_False, Falsche Request-Methode);
+            OSL_ENSURE(sal_False, "wrong request method");
             return;
     }
 
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 32269ec..c8cf03b 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -321,7 +321,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq )
     }
     catch(Exception& )
     {
-        DBG_ERROR("control acces failed");
+        OSL_ENSURE(false, "control acces failed");
     }
 
     SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC , sal_False );
@@ -352,7 +352,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq )
                 try
                 {
                     Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
-                    DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
+                    OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
                     bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True;
                     Any aTemplateValue = xCtrlAcc->getValue(
                         ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
@@ -363,7 +363,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq )
                 }
                 catch(Exception& )
                 {
-                    DBG_ERROR("control acces failed");
+                    OSL_ENSURE(false, "control acces failed");
                 }
             }
             rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
@@ -387,7 +387,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq )
             else
             {
                 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
-                DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
+                OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
                 bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True;
                 Any aTemplateValue = xCtrlAcc->getValue(
                     ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
@@ -501,9 +501,9 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
         case FN_LINE_NUMBERING_DLG:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             VclAbstractDialog* pDlg = pFact->CreateVclSwViewDialog( DLG_LINE_NUMBERING,    *this);
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
             pDlg->Execute();
             delete pDlg;
             break;
@@ -541,7 +541,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
                 Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword();
                 if( aPasswd.getLength() )
                 {
-                    DBG_ASSERT( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): 
password set an redlining off doesn't match!" );
+                    OSL_ENSURE( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): 
password set an redlining off doesn't match!" );
                     // xmlsec05:       new password dialog
                     Window* pParent;
                     const SfxPoolItem* pParentItem;
@@ -1037,10 +1037,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
                 SfxViewFrame* pTmpFrame = GetViewFrame();
                 SfxHelp::OpenHelpAgent( &pTmpFrame->GetFrame(), HID_MAIL_MERGE_SELECT );
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg( 
DLG_MERGE_CREATE,
                                                         &pTmpFrame->GetWindow());
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if(RET_OK == pDlg->Execute())
                     bUseCurrentDocument = pDlg->IsThisDocument();
                 else
@@ -1155,7 +1155,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
 
 
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
     if(!bIgnore)
@@ -1183,7 +1183,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
 
     SfxWhichIter aIter( rSet );
     USHORT nWhich = aIter.FirstWhich();
-    ASSERT( nWhich, "leeres Set");
+    OSL_ENSURE( nWhich, "empty set");
 
     while( nWhich )
     {
@@ -1372,7 +1372,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
                                     sStr = pTOX->GetTOXName();
                                 else
                                 {
-                                    ASSERT( !this,
+                                    OEL_ENSURE( !this,
                                         "was ist das fuer ein Verzeichnis?" );
                                     sStr = pCurrSect->GetSectionName();
                                 }
@@ -1603,7 +1603,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
                     if(pFact)
                     {
                         pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet);
-                        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                        OSL_ENSURE(pDlg, "Dialogdiet fail!");
                     }
 
                     pDlg->SetLimits( MINZOOM, MAXZOOM );
@@ -2048,7 +2048,7 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion 
)
         case SID_INSERTDOC:             bInsert = TRUE;     break;
 
         default:
-            ASSERT( !this, "Unbekannte SlotId!" );
+            OSL_ENSURE( !this, "unknown SlotId!" );
             bInsert = TRUE;
             nSlotId = SID_INSERTDOC;
             break;
@@ -2278,11 +2278,11 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument)
             {
                 //take an existing data source or create a new one?
                     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                    DBG_ASSERT(pFact, "Dialogdiet fail!");
+                    OSL_ENSURE(pFact, "Dialogdiet fail!");
                     AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = 
pFact->CreateMailMergeFieldConnectionsDlg(
                                                         DLG_MERGE_FIELD_CONNECTIONS,
                                                         &GetViewFrame()->GetWindow());
-                    DBG_ASSERT(pConnectionsDlg, "Dialogdiet fail!");
+                    OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!");
                     if(RET_OK == pConnectionsDlg->Execute())
                         bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
                     else
diff --git a/sw/source/ui/uiview/viewcoll.cxx b/sw/source/ui/uiview/viewcoll.cxx
index 679a81c..c5bbdd2 100644
--- a/sw/source/ui/uiview/viewcoll.cxx
+++ b/sw/source/ui/uiview/viewcoll.cxx
@@ -56,7 +56,7 @@ void SwView::ExecColl(SfxRequest &rReq)
     {
         case FN_SET_PAGE:
         {
-            DBG_ASSERT(!this, "Not implemented");
+            OSL_ENSURE(!this, "Not implemented");
         }
         break;
         case FN_SET_PAGE_STYLE:
@@ -90,7 +90,7 @@ void SwView::ExecColl(SfxRequest &rReq)
         }
         break;
         default:
-            ASSERT(FALSE, falscher CommandProcessor fuer Dispatch);
+            OSL_ENSURE(false, "wrong CommandProcessor for Dispatch");
             return;
     }
 }
diff --git a/sw/source/ui/uiview/viewdlg.cxx b/sw/source/ui/uiview/viewdlg.cxx
index cfd80b4..52d0013 100644
--- a/sw/source/ui/uiview/viewdlg.cxx
+++ b/sw/source/ui/uiview/viewdlg.cxx
@@ -84,7 +84,7 @@ void SwView::ExecDlg(SfxRequest &rReq)
         break;
 
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 
diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx
index a87b5c0..1c91d20 100644
--- a/sw/source/ui/uiview/viewdlg2.cxx
+++ b/sw/source/ui/uiview/viewdlg2.cxx
@@ -74,10 +74,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq)
         case FN_INSERT_CAPTION:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+            OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
             VclAbstractDialog* pDialog = pFact->CreateSwCaptionDialog( pMDI, *this, DLG_CAPTION );
-            DBG_ASSERT(pDialog, "Dialogdiet fail!");
+            OSL_ENSURE(pDialog, "Dialogdiet fail!");
             if ( pDialog )
             {
                 pDialog->Execute();
@@ -88,10 +88,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq)
         case  FN_EDIT_FOOTNOTE:
         {
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            DBG_ASSERT(pFact, "Dialogdiet fail!");
+            OSL_ENSURE(pFact, "Dialogdiet fail!");
             AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE,
                                                         pMDI, *pWrtShell, TRUE );
-            DBG_ASSERT(pDlg, "Dialogdiet fail!");
+            OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
             pDlg->SetHelpId(FN_EDIT_FOOTNOTE);
             pDlg->SetText( SW_RESSTR(STR_EDIT_FOOTNOTE) );
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx
index c4c2dc4..bb472c7 100644
--- a/sw/source/ui/uiview/viewdraw.cxx
+++ b/sw/source/ui/uiview/viewdraw.cxx
@@ -146,7 +146,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
         if ( pFormView )
         {
             SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, 
sal_False );
-            DBG_ASSERT( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid 
request args!" );
+            OSL_ENSURE( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid 
request args!" );
             if( pDescriptorItem )
             {
                 ::svx::ODataAccessDescriptor aDescriptor( pDescriptorItem->GetValue() );
@@ -483,7 +483,7 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
     SdrPageView* pPV;
     SwWrtShell *pSh = &GetWrtShell();
     SdrView *pSdrView = pSh->GetDrawView();
-    ASSERT( pSdrView, "EnterDrawTextMode without DrawView?" );
+    OSL_ENSURE( pSdrView, "EnterDrawTextMode without DrawView?" );
 
     sal_Bool bReturn = sal_False;
 
@@ -620,7 +620,7 @@ sal_Bool SwView::IsTextTool() const
     sal_uInt16 nId;
     sal_uInt32 nInvent;
     SdrView *pSdrView = GetWrtShell().GetDrawView();
-    ASSERT( pSdrView, "IsTextTool without DrawView?" );
+    OSL_ENSURE( pSdrView, "IsTextTool without DrawView?" );
 
     if (pSdrView->IsCreateMode())
         pSdrView->SetCreateMode(sal_False);
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index b53b56c..3448d72 100644
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -209,7 +209,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
                             {
                                 SwTxtNode *pTxtNode = aPointNodeIndex.GetNode().GetTxtNode();
                                 // check for unexpected error case
-                                DBG_ASSERT( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex,
+                                OSL_ENSURE( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex,
                                     "text missing: corrupted node?" );
                                 if (!pTxtNode || pTxtNode->GetTxt().Len() < nPointIndex)
                                     nPointIndex = 0;
@@ -232,7 +232,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
             HyphenateDocument();
             break;
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong Dispatcher");
             return;
     }
 }
@@ -339,7 +339,7 @@ void SwView::SpellStart( SvxSpellArea eWhich,
             }
             break;
         default:
-            ASSERT( !this, "SpellStart with unknown Area" );
+            OSL_ENSURE( !this, "SpellStart with unknown Area" );
     }
     pWrtShell->SpellStart( eStart, eEnde, eCurr, pConvArgs );
 }
@@ -434,7 +434,7 @@ void SwView::HyphStart( SvxSpellArea eWhich )
             pWrtShell->HyphStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND );
             break;
         default:
-            ASSERT( !this, "HyphStart with unknown Area" );
+            OSL_ENSURE( !this, "HyphStart with unknown Area" );
     }
 }
 
@@ -715,7 +715,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
                     aParaText = pNode->GetTxt();       // this may include hidden text but that 
should be Ok
                 else 
                 {
-                    DBG_ERROR( "text node expected but not found" );
+                    OSL_ENSURE(false, "text node expected but not found" );
                 }
 
                 bRet = sal_True;
diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx
index 4228a6d..9ce55ac 100644
--- a/sw/source/ui/uiview/viewmdi.cxx
+++ b/sw/source/ui/uiview/viewmdi.cxx
@@ -292,11 +292,11 @@ void SwView::SetViewLayout( USHORT nColumns, bool bBookMode, BOOL bViewOnly )
  */
 IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent )
 {
-    DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+    OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
     if ( pEvent && pEvent->ISA( VclWindowEvent ) )
     {
         VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
-        DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
+        OSL_ENSURE( pVclEvent->GetWindow(), "Window???" );
         Window* pChildWin = static_cast< Window* >( pVclEvent->GetData() );
 
         switch ( pVclEvent->GetId() )
@@ -324,7 +324,7 @@ int SwView::_CreateScrollbar( BOOL bHori )
     Window *pMDI = &GetViewFrame()->GetWindow();
     SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
 
-    ASSERT( !*ppScrollbar, "vorher abpruefen!" )
+    OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" )
 
     if( !bHori )
         CreatePageButtons( !bShowAtResize );
@@ -664,19 +664,19 @@ void SwView::SetImageButtonColor(Color& rColor)
 
 void SwView::ShowHScrollbar(sal_Bool bShow)
 {
-    DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
+    OSL_ENSURE(pHScrollbar, "Scrollbar invalid");
     pHScrollbar->ExtendedShow(bShow);
 }
 
 sal_Bool SwView::IsHScrollbarVisible()const
 {
-    DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
+    OSL_ENSURE(pHScrollbar, "Scrollbar invalid");
     return pHScrollbar->IsVisible( FALSE ) || pHScrollbar->IsAuto();
 }
 
 void SwView::ShowVScrollbar(sal_Bool bShow)
 {
-    DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
+    OSL_ENSURE(pVScrollbar, "Scrollbar invalid");
     pVScrollbar->ExtendedShow(bShow);
     pPageUpBtn->Show(bShow);
     pPageDownBtn->Show(bShow);
@@ -685,7 +685,7 @@ void SwView::ShowVScrollbar(sal_Bool bShow)
 
 sal_Bool SwView::IsVScrollbarVisible()const
 {
-    DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
+    OSL_ENSURE(pVScrollbar, "Scrollbar invalid");
     return pVScrollbar->IsVisible( FALSE );
 }
 
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 6fb06ac..4bdd79d 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -130,7 +130,7 @@ void SwView::InvalidateRulerPos()
 
     GetViewFrame()->GetBindings().Invalidate(aInval);
 
-    DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+    OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?");
     pHRuler->ForceUpdate();
     pVRuler->ForceUpdate();
 }
@@ -832,7 +832,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, BOOL /*bInner*/ )
             rToFill.Left() = nWidth;
     }
 
-    DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+    OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?");
     if ( pHRuler->IsVisible() )
         rToFill.Top() = pHRuler->GetSizePixel().Height();
 
@@ -1157,7 +1157,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
         //nicht mehr zum aktuell sichtbaren Bereich passen
         pWrtShell->ResetCursorStack();
 
-        ASSERT( !GetEditWin().IsVisible() ||
+        OSL_ENSURE( !GetEditWin().IsVisible() ||
                     (( aEditSz.Width() > 0 && aEditSz.Height() > 0 )
                         || !aVisArea.IsEmpty()), "Small world, isn't it?" );
 
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index f1e8066..878cb0f 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -295,7 +295,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
             return;
         }
         default:
-            ASSERT(!this, falscher Dispatcher);
+            OSL_ENSURE(!this, "wrong dispatcher");
             return;
     }
 }
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 97e4ac3..dc11424 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -198,14 +198,14 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
 
             if (nSlot == FN_REPEAT_SEARCH)
             {
-                ASSERT(pSrchItem, "Search-Item fehlt");
+                OSL_ENSURE(pSrchItem, "SearchItem missing");
                 if( !pSrchItem )
                     pSrchItem = new SvxSearchItem(SID_SEARCH_ITEM);
             }
             else
             {
                 // SearchItem aus Request besorgen
-                ASSERT(pArgs, "Args fehlen");
+                OSL_ENSURE(pArgs, "Args missing");
                 if ( pArgs )
                 {
                     delete pSrchItem;
@@ -415,13 +415,13 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
         }
         break;
         default:
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
             if(nSlot)
             {
                 ByteString sStr( "nSlot: " );
                 sStr += ByteString::CreateFromInt32( nSlot );
-                sStr += " falscher Dispatcher (viewsrch.cxx)";
-                DBG_ERROR( sStr.GetBuffer() );
+                sStr += " wrong Dispatcher (viewsrch.cxx)";
+                OSL_ENSURE(false, sStr.GetBuffer() );
             }
 #endif
             return;
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 2a464c4..2ac3c40 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -128,7 +128,7 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem,
                           USHORT nTotalWidth,
                           SwFmtCol& rCols)
 {
-    ASSERT( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
+    OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" );
     // #126939# ruler executes that change the columns shortly after the selection has changed
     // can result in a crash
     if(rCols.GetNumCols() != rColItem.Count())
@@ -142,7 +142,7 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem,
     // Tabcols der Reihe nach
     for( USHORT i=0; i < rColItem.Count()-1; ++i )
     {
-        DBG_ASSERT(rColItem[i+1].nStart >= rColItem[i].nEnd,"\201berlappende Spalten" );
+        OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" );
         USHORT nStart = static_cast< USHORT >(rColItem[i+1].nStart);
         USHORT nEnd = static_cast< USHORT >(rColItem[i].nEnd);
         if(nStart < nEnd)
@@ -685,7 +685,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
 
         if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()))
         {
-            ASSERT(aColItem.Count(), "ColDesc ist leer!!");
+            OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
 
             const BOOL bSingleLine = ((const SfxBoolItem&)rReq.
                             GetArgs()->Get(SID_RULER_ACT_LINE_ONLY)).GetValue();
@@ -762,7 +762,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
                 if(bSect)
                 {
                     const SwSection *pSect = rSh.GetAnySection();
-                    ASSERT( pSect, "Welcher Bereich?");
+                    OSL_ENSURE( pSect, "Which section?");
                     pSectFmt = pSect->GetFmt();
                 }
                 else
@@ -817,7 +817,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
 
         if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
         {
-            ASSERT(aColItem.Count(), "ColDesc ist leer!!");
+            OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
 
             SwTabCols aTabCols;
             if ( bSetTabRowFromDoc )
@@ -875,7 +875,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
     break;
 
     default:
-        ASSERT( !this, "Falsche SlotId");
+        OSL_ENSURE( !this, "wrong SlotId");
     }
     rSh.EndAllAction();
 
@@ -1077,7 +1077,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
                 const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
                                             rSh.GetDefault(RES_PARATR_TABSTOP);
 
-                DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?");
+                OSL_ENSURE(pHRuler, "why is there no ruler?");
                 long nDefTabDist = ::GetTabDist(rDefTabs);
                 pHRuler->SetDefTabDist( nDefTabDist );
                 pVRuler->SetDefTabDist( nDefTabDist );
@@ -1294,7 +1294,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
                         nNum = aTabCols.Count() - nNum;
                 }
 
-                ASSERT(nNum <= aTabCols.Count(), "TabCol not found");
+                OSL_ENSURE(nNum <= aTabCols.Count(), "TabCol not found");
                 const int nLft = aTabCols.GetLeftMin() + aTabCols.GetLeft();
                 const int nRgt = (USHORT)(bTableVertical ? nPageHeight : nPageWidth) -
                                   (aTabCols.GetLeftMin() +
@@ -1369,7 +1369,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
                      nFrmType & FRMTYPE_COLSECT )
                 {
                     const SwSection *pSect = rSh.GetAnySection(FALSE, pPt);
-                    ASSERT( pSect, "Welcher Bereich?");
+                    OSL_ENSURE( pSect, "Which section?");
                     if( pSect )
                     {
                         SwSectionFmt *pFmt = pSect->GetFmt();
@@ -1510,7 +1510,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
                     rSh.GetTabRows( aTabCols );
                 }
 
-//                ASSERT(nNum <= aTabCols.Count(), "TabCol not found");
                 const int nLft = aTabCols.GetLeftMin();
                 const int nRgt = (USHORT)(bVerticalWriting ? nPageWidth : nPageHeight) -
                                   (aTabCols.GetLeftMin() +
@@ -1720,7 +1719,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
                         eRecType = bSectOutTbl ? RECT_OUTTABSECTION
                                                : RECT_SECTION;
                         const SwSection *pSect = rSh.GetAnySection( bSectOutTbl, pPt );
-                        ASSERT( pSect, "Welcher Bereich?");
+                        OSL_ENSURE( pSect, "Which section?");
                         pFmt = pSect->GetFmt();
                     }
                     else if( bFrame )
@@ -1752,7 +1751,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 
                     if( nNum > rCols.Count() )
                     {
-                        ASSERT( !this, "es wird auf dem falschen FmtCol gearbeitet!" );
+                        OSL_ENSURE( !this, "wrong FmtCol is being edited!" );
                         nNum = rCols.Count();
                     }
 
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index e5632be..babca28 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -128,10 +128,10 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
     {
 
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
         AbstractSwAsciiFilterDlg* pAsciiDlg = pFact->CreateSwAsciiFilterDlg( NULL, 
*pDocShell,pInStream,  DLG_ASCII_FILTER );
-        DBG_ASSERT(pAsciiDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pAsciiDlg, "Dialogdiet fail!");
         if(RET_OK == pAsciiDlg->Execute())
         {
             SwAsciiOptions aOptions;
diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx
index 333400e..c11a0de 100644
--- a/sw/source/ui/uno/dlelstnr.cxx
+++ b/sw/source/ui/uno/dlelstnr.cxx
@@ -87,7 +87,7 @@ SwLinguServiceEventListener::SwLinguServiceEventListener()
         }
         catch (uno::Exception &)
         {
-            DBG_ASSERT(0, "exception caught in SwLinguServiceEventListener c-tor" );
+            OSL_ENSURE(0, "exception caught in SwLinguServiceEventListener c-tor" );
         }
     }
 }
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 0d03f8a..0c496bd 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -237,7 +237,7 @@ SwFilterDetect::~SwFilterDetect()
                 }
                 else
                 {
-                    DBG_ASSERT( xStorage.is(), "At this point storage must exist!" );
+                    OSL_ENSURE( xStorage.is(), "At this point storage must exist!" );
 
                     try
                     {
diff --git a/sw/source/ui/uno/swdetect.hxx b/sw/source/ui/uno/swdetect.hxx
index c4912f3..5d6d323 100644
--- a/sw/source/ui/uno/swdetect.hxx
+++ b/sw/source/ui/uno/swdetect.hxx
@@ -29,7 +29,7 @@
 #define _SW_TYPEDETECT_HXX
 
 #include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
 #include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Reference.h>
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index 7fdb9fe..9b6c757 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -34,7 +34,7 @@
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <vos/mutex.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <vcl/svapp.hxx>
 #include <svl/svstdarr.hxx>
 #include <svtools/unoevent.hxx>
@@ -218,7 +218,7 @@ uno::Reference< text::XAutoTextGroup >  SwXAutoTextContainer::insertNewByName(
     pGlossaries->NewGroupDoc(sGroup, sGroup.GetToken(0, GLOS_DELIM));
 
     uno::Reference< text::XAutoTextGroup > xGroup = pGlossaries->GetAutoTextGroup( sGroup, true );
-    DBG_ASSERT( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How 
this?" );
+    OSL_ENSURE( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How 
this?" );
         // we just inserted the group into the glossaries, so why doesn't it exist?
 
     return xGroup;
@@ -281,7 +281,7 @@ SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName,
     sName(rName),
     m_sGroupName(rName)
 {
-    DBG_ASSERT( -1 != rName.indexOf( GLOS_DELIM ),
+    OSL_ENSURE( -1 != rName.indexOf( GLOS_DELIM ),
         "SwXAutoTextGroup::SwXAutoTextGroup: to be constructed with a complete name only!" );
 }
 
@@ -344,7 +344,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName,
 
 sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextRange* pxRange)
 {
-    ASSERT( pInsDoc, "kein Ins.Dokument"  );
+    OSL_ENSURE( pInsDoc, "no InsDoc");
 
     SwNodes& rNds = pInsDoc->GetNodes();
 
@@ -457,7 +457,7 @@ uno::Reference< text::XAutoTextEntry >  SwXAutoTextGroup::insertNewByName(const
     }
 
     uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, 
sName, sShortName, true );
-    DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" 
);
+    OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" 
);
         // we just inserted the entry into the group, so why doesn't it exist?
 
     return xEntry;
@@ -587,7 +587,7 @@ uno::Any SwXAutoTextGroup::getByName(const OUString& _rName)
 {
     ::vos::OGuard aGuard(Application::GetSolarMutex());
     uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, 
sName, _rName, true );
-    DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" );
+    OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" );
         // we told it to create the object, so why didn't it?
     return makeAny( xEntry );
 }
@@ -844,7 +844,7 @@ void SwXAutoTextEntry::GetBodyText ()
     ::vos::OGuard aGuard(Application::GetSolarMutex());
 
     xDocSh = pGlossaries->EditGroupDoc ( sGroupName, sEntryName, FALSE );
-    DBG_ASSERT( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by 
EditGroupDoc!" );
+    OSL_ENSURE( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by 
EditGroupDoc!" );
 
     // start listening at the document
     StartListening( *&xDocSh );
@@ -1069,16 +1069,16 @@ void SwAutoTextEventDescriptor::replaceByName(
                 lang::WrappedTargetException,
                 uno::RuntimeException)
 {
-    DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(),
+    OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(),
                 "Strangely enough, the AutoText vanished!" );
-    DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
+    OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
                 (nEvent == SW_EVENT_START_INS_GLOSSARY) ,
                 "Unknown event ID" );
 
     const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries();
     SwTextBlocks* pBlocks =
         pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() );
-    DBG_ASSERT( NULL != pBlocks,
+    OSL_ENSURE( NULL != pBlocks,
                 "can't get autotext group; SwAutoTextEntry has illegal name?");
 
     if( pBlocks && !pBlocks->GetError())
@@ -1108,15 +1108,15 @@ void SwAutoTextEventDescriptor::getByName(
                 lang::WrappedTargetException,
                 uno::RuntimeException)
 {
-    DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" );
-    DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
+    OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" );
+    OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) ||
                 (nEvent == SW_EVENT_START_INS_GLOSSARY) ,
                 "Unknown event ID" );
 
     const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries();
     SwTextBlocks* pBlocks =
         pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() );
-    DBG_ASSERT( NULL != pBlocks,
+    OSL_ENSURE( NULL != pBlocks,
                 "can't get autotext group; SwAutoTextEntry has illegal name?");
 
     // return empty macro, unless macro is found
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index c84dd43..6d26eea 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -260,12 +260,12 @@ namespace
                 acquire();
             }
             else {
-                DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: model is no component!" );
+                OSL_ENSURE(false, "DelayedFileDeletion::DelayedFileDeletion: model is no 
component!" );
             }
         }
         catch( const Exception& )
         {
-            DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: could not register as event 
listener at the model!" );
+            OSL_ENSURE(false, "DelayedFileDeletion::DelayedFileDeletion: could not register as 
event listener at the model!" );
         }
         osl_decrementInterlockedCount( &m_refCount );
     }
@@ -298,7 +298,7 @@ namespace
         }
         catch( const Exception& )
         {
-            DBG_ERROR( "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" );
+            OSL_ENSURE(false, "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" 
);
             bSuccess = sal_True;
                 // can't do anything here ...
         }
@@ -322,7 +322,7 @@ namespace
         }
         catch( const Exception & )
         {
-            DBG_ERROR( "DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" );
+            OSL_ENSURE(false, "DelayedFileDeletion::implTakeOwnership: could not revoke the 
listener!" );
         }
 
         m_aDeleteTimer.SetTimeout( 3000 );     // 3 seconds
@@ -346,7 +346,7 @@ namespace
     //--------------------------------------------------------------------
     void SAL_CALL DelayedFileDeletion::notifyClosing( const EventObject&  ) throw 
(RuntimeException)
     {
-        DBG_ERROR( "DelayedFileDeletion::notifyClosing: how this?" );
+        OSL_ENSURE(false, "DelayedFileDeletion::notifyClosing: how this?" );
         // this should not happen:
         // Either, a foreign instance closes the document, then we should veto this, and take the 
ownership
         // Or, we ourself close the document, then we should not be a listener anymore
@@ -355,7 +355,7 @@ namespace
     //------------------------------------------------------
     void SAL_CALL DelayedFileDeletion::disposing( const EventObject&  ) throw (RuntimeException)
     {
-        DBG_ERROR( "DelayedFileDeletion::disposing: how this?" );
+        OSL_ENSURE(false, "DelayedFileDeletion::disposing: how this?" );
         // this should not happen:
         // Either, a foreign instance closes the document, then we should veto this, and take the 
ownership
         // Or, we ourself close the document, then we should not be a listener anymore
@@ -448,7 +448,7 @@ SwXMailMerge::~SwXMailMerge()
         //! because there is no automatism that will do that later.
         //! #120086#
         if ( eVetoed == CloseModelAndDocSh( xModel, xDocSh ) )
-            DBG_WARNING( "owner ship transfered to vetoing object!" );
+            OSL_ENSURE(false, "owner ship transfered to vetoing object!" );
 
         xModel = 0;
         xDocSh = 0; // destroy doc shell
@@ -639,7 +639,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
     {
         if (!aCurDataSourceName.getLength() || !aCurDataCommand.getLength() )
         {
-            DBG_ERROR("PropertyValues missing or unset");
+            OSL_ENSURE(false, "PropertyValues missing or unset");
             throw IllegalArgumentException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Either the 
ResultSet or DataSourceName and DataCommand must be set." ) ), static_cast < cppu::OWeakObject * > 
( this ), 0 );
         }
 
@@ -653,7 +653,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
                     C2U( "com.sun.star.sdb.RowSet" ));
             aRowSetDisposeHelper.reset( xInstance, SharedComponent::TakeOwnership );
             Reference< XPropertySet > xRowSetPropSet( xInstance, UNO_QUERY );
-            DBG_ASSERT( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" );
+            OSL_ENSURE( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" );
             if (xRowSetPropSet.is())
             {
                 if (xCurConnection.is())
@@ -671,7 +671,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
                 if( !xCurConnection.is() )
                     xCurConnection.set( xRowSetPropSet->getPropertyValue( C2U( "ActiveConnection" 
)), UNO_QUERY );
                 xCurResultSet = Reference< sdbc::XResultSet >( xRowSet, UNO_QUERY );
-                DBG_ASSERT( xCurResultSet.is(), "failed to build ResultSet" );
+                OSL_ENSURE( xCurResultSet.is(), "failed to build ResultSet" );
             }
         }
     }
@@ -700,7 +700,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
     SwNewDBMgr* pMgr = rSh.GetNewDBMgr();
     //force layout creation
     rSh.CalcLayout();
-    DBG_ASSERT( pMgr, "database manager missing" );
+    OSL_ENSURE( pMgr, "database manager missing" );
 
     SwMergeDescriptor aMergeDesc( nMergeType, rSh, aDescriptor );
 
@@ -822,7 +822,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
 
     pMgr->SetMergeSilent( TRUE );       // suppress dialogs, message boxes, etc.
     const SwXMailMerge *pOldSrc = pMgr->GetMailMergeEvtSrc();
-    DBG_ASSERT( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
+    OSL_ENSURE( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." );
     pMgr->SetMailMergeEvtSrc( this );   // launch events for listeners
 
     SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, 
SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh));
@@ -935,7 +935,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue(
             case WID_IN_SERVER_PASSWORD:        pData = &sInServerPassword; break;
             case WID_OUT_SERVER_PASSWORD:       pData = &sOutServerPassword; break;
             default :
-                DBG_ERROR("unknown WID");
+                OSL_ENSURE(false, "unknown WID");
         }
         Any aOld( pData, *pType );
 
@@ -1024,9 +1024,9 @@ void SAL_CALL SwXMailMerge::setPropertyValue(
             else if(pData == &sOutServerPassword)
                 bOK = rValue >>= sInServerPassword;
             else {
-                DBG_ERROR( "invalid pointer" );
+                OSL_ENSURE(false, "invalid pointer" );
             }
-            DBG_ASSERT( bOK, "set value failed" );
+            OSL_ENSURE( bOK, "set value failed" );
             bChanged = sal_True;
         }
         if (!bOK)
@@ -1088,7 +1088,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue(
             case WID_IN_SERVER_PASSWORD:        aRet <<= sInServerPassword; break;
             case WID_OUT_SERVER_PASSWORD:       aRet <<= sOutServerPassword; break;
             default :
-                DBG_ERROR("unknown WID");
+                OSL_ENSURE(false, "unknown WID");
         }
     }
 
@@ -1133,7 +1133,7 @@ void SAL_CALL SwXMailMerge::addVetoableChangeListener(
     throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
     // no vetoable property, thus no support for vetoable change listeners
-    DBG_WARNING( "not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SAL_CALL SwXMailMerge::removeVetoableChangeListener(
@@ -1142,7 +1142,7 @@ void SAL_CALL SwXMailMerge::removeVetoableChangeListener(
     throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
     // no vetoable property, thus no support for vetoable change listeners
-    DBG_WARNING( "not implemented");
+    OSL_ENSURE(false,"not implemented");
 }
 
 
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 3dcfccd..8c228da 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -31,7 +31,7 @@
 
 
 #include <swtypes.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <unomod.hxx>
 #include <unomid.h>
 #include <unoprnms.hxx>
@@ -246,7 +246,7 @@ Reference< XPropertySet >  SwXModule::getViewSettings(void) throw( uno::RuntimeE
     if(!pxViewSettings)
     {
         ((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ;
-        DBG_ERROR("Web oder Text?");
+        OSL_ENSURE(false, "Web or Text?");
         *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, 0 
) );
     }
     return *pxViewSettings;
@@ -258,7 +258,7 @@ Reference< XPropertySet >  SwXModule::getPrintSettings(void) throw( uno::Runtime
     if(!pxPrintSettings)
     {
         ((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ;
-        DBG_ERROR("Web oder Text?");
+        OSL_ENSURE(false, "Web or Text?");
         *pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( 
PRINT_SETTINGS_MODULE ) );
     }
     return *pxPrintSettings;
@@ -993,7 +993,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
             bBool = sal_False;
         }
         break;
-        default: DBG_ERROR("Diese Id gibt's nicht!");
+        default: OSL_ENSURE(false, "there is no such ID!");
     }
     if( bBool )
         rValue.setValue(&bBoolVal, ::getBooleanCppuType());
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index ec966af..43d0301 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -198,7 +198,7 @@ SwPrintUIOptions * lcl_GetPrintUIOptions(
 
     // get default values to use in dialog from documents SwPrintData
     const SwPrintData *pPrintData = pDocShell->GetDoc()->getPrintData();
-    DBG_ASSERT( pPrintData, "failed to get SwPrintData from document" );
+    OSL_ENSURE( pPrintData, "failed to get SwPrintData from document" );
 
     return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, *pPrintData );
 }
@@ -446,7 +446,7 @@ void SwXTextDocument::GetNumberFormatter()
                         xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
 
             }
-            DBG_ASSERT(pNumFmt, "No number formatter available");
+            OSL_ENSURE(pNumFmt, "No number formatter available");
             if(!pNumFmt->GetNumberFormatter())
                 pNumFmt->SetNumberFormatter(pDocShell->GetDoc()->GetNumberFormatter( sal_True ));
         }
@@ -1403,7 +1403,7 @@ void SwXTextDocument::Invalidate()
                     xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
             pNumFmt->SetNumberFormatter(0);
         }
-        DBG_ASSERT(pNumFmt, "No number formatter available");
+        OSL_ENSURE(pNumFmt, "No number formatter available");
     }
     InitNewDoc();
     pDocShell = 0;
@@ -1471,7 +1471,7 @@ void      SwXTextDocument::InitNewDoc()
                     xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId()));
 
         }
-        DBG_ASSERT(pNumFmt, "No number formatter available");
+        OSL_ENSURE(pNumFmt, "No number formatter available");
         pNumFmt->SetNumberFormatter(0);
     }
 
@@ -2179,28 +2179,28 @@ void SwXTextDocument::addPropertyChangeListener(const OUString& 
/*PropertyName*/
     const Reference< XPropertyChangeListener > & /*aListener*/)
     throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SwXTextDocument::removePropertyChangeListener(const OUString& /*PropertyName*/,
     const Reference< XPropertyChangeListener > & /*aListener*/)
     throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SwXTextDocument::addVetoableChangeListener(const OUString& /*PropertyName*/,
     const Reference< XVetoableChangeListener > & /*aListener*/)
     throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SwXTextDocument::removeVetoableChangeListener(const OUString& /*PropertyName*/,
                         const Reference< XVetoableChangeListener > & /*aListener*/)
     throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 Reference< XNameAccess >  SwXTextDocument::getLinks(void) throw( RuntimeException )
@@ -2388,7 +2388,7 @@ SfxViewShell * SwXTextDocument::GetRenderView(
         uno::Reference< frame::XController > xController;
         if (aTmp >>= xController)
         {
-            DBG_ASSERT( xController.is(), "controller is empty!" );
+            OSL_ENSURE( xController.is(), "controller is empty!" );
             pView = GuessViewShell( rbIsSwSrcView, xController );
         }
     }
@@ -2416,7 +2416,7 @@ SwDoc * SwXTextDocument::GetRenderDoc(
         pDoc = pDocShell->GetDoc();
     else
     {
-        DBG_ASSERT( !xModel.is(), "unexpected model found" );
+        OSL_ENSURE( !xModel.is(), "unexpected model found" );
 
         if (rSelection.hasValue())     // is anything selected ?
         {
@@ -2428,11 +2428,11 @@ SwDoc * SwXTextDocument::GetRenderDoc(
             {
                 (void) bIsPDFExport;
                 // aside from maybe PDF export the view should always have been provided!
-                DBG_ASSERT( bIsPDFExport, "view is missing, guessing one..." );
+                OSL_ENSURE( bIsPDFExport, "view is missing, guessing one..." );
 
                 rpView = GuessViewShell( bIsSwSrcView );
             }
-            DBG_ASSERT( rpView, "ViewShell missing" );
+            OSL_ENSURE( rpView, "ViewShell missing" );
             // the view shell should be SwView for documents PDF export.
             // for the page preview no selection should be possible
             // (the export dialog does not allow for this option)
@@ -2448,7 +2448,7 @@ SwDoc * SwXTextDocument::GetRenderDoc(
             }
             else
             {
-                DBG_ERROR( "unexpected ViewShell" );
+                OSL_ENSURE(false, "unexpected ViewShell" );
             }
         }
     }
@@ -2510,7 +2510,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
     // const bool bIsSkipEmptyPages    = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
 
     SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
-    DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+    OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
     if (!pDoc || !pView)
         return 0;
 
@@ -2634,7 +2634,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
             nRet = m_pRenderData->GetPagesToPrint().size();
         }
     }
-    DBG_ASSERT( nRet >= 0, "negative number of pages???" );
+    OSL_ENSURE( nRet >= 0, "negative number of pages???" );
 
     return nRet;
 }
@@ -2668,7 +2668,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
     const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", 
false );
 
     SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
-    DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+    OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
     if (!pDoc || !pView)
         return uno::Sequence< beans::PropertyValue >();
 
@@ -2680,7 +2680,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
     sal_Int32 nMaxRenderer = 0;
     if (!bIsSwSrcView && m_pRenderData)
     {
-        DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" );
+        OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" );
         nMaxRenderer = bPrintProspect?
             m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
             m_pRenderData->GetPagesToPrint().size() - 1;
@@ -2815,7 +2815,7 @@ SfxViewShell * SwXTextDocument::GuessViewShell(
         pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell,  sal_False );
     }
 
-    DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" );
+    OSL_ENSURE( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" );
     if (pView)
         rbIsSwSrcView = pSwSrcView != 0;
     return pView;
@@ -2844,8 +2844,8 @@ void SAL_CALL SwXTextDocument::render(
     bool bIsSwSrcView = false;
     SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport );
 
-    DBG_ASSERT( m_pRenderData, "data should have been created already in getRendererCount..." );
-    DBG_ASSERT( m_pPrintUIOptions, "data should have been created already in getRendererCount..." 
);
+    OSL_ENSURE( m_pRenderData, "data should have been created already in getRendererCount..." );
+    OSL_ENSURE( m_pPrintUIOptions, "data should have been created already in getRendererCount..." 
);
     if (!bIsSwSrcView && !m_pRenderData)
         m_pRenderData = new SwRenderData;
     if (!m_pPrintUIOptions)
@@ -2855,13 +2855,13 @@ void SAL_CALL SwXTextDocument::render(
     const bool bLastPage        = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False );
 
     SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
-    DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
+    OSL_ENSURE( pDoc && pView, "doc or view shell missing!" );
     if (pDoc && pView)
     {
         sal_Int32 nMaxRenderer = 0;
         if (!bIsSwSrcView)
         {
-            DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" );
+            OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" );
             nMaxRenderer = bPrintProspect?
                 m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 :
                 m_pRenderData->GetPagesToPrint().size() - 1;
@@ -2881,7 +2881,7 @@ void SAL_CALL SwXTextDocument::render(
                 // the view shell should be SwView for documents PDF export
                 // or SwPagePreView for PDF export of the page preview
                 //!! (check for SwView first as in GuessViewShell) !!
-                DBG_ASSERT( pView, "!! view missing !!" );
+                OSL_ENSURE( pView, "!! view missing !!" );
                 const TypeId aSwViewTypeId = TYPE(SwView);
                 ViewShell* pVwSh = 0;
                 if (pView)
@@ -2900,7 +2900,7 @@ void SAL_CALL SwXTextDocument::render(
                     const bool bFirstPage           = m_pPrintUIOptions->getBoolValue( 
"IsFirstPage", sal_False );
                     bool bIsSkipEmptyPages          = !m_pPrintUIOptions->IsPrintEmptyPages( 
bIsPDFExport );
 
-                    DBG_ASSERT(( pView->IsA(aSwViewTypeId) &&  m_pRenderData->IsViewOptionAdjust())
+                    OSL_ENSURE(( pView->IsA(aSwViewTypeId) &&  m_pRenderData->IsViewOptionAdjust())
                             || (!pView->IsA(aSwViewTypeId) && 
!m_pRenderData->IsViewOptionAdjust()),
                             "SwView / SwViewOptionAdjust_Impl availability mismatch" );
 
@@ -3537,7 +3537,7 @@ sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException )
     sal_Bool bRet = sal_False;
     if(pxDoc)
     {
-        DBG_ERROR("not implemented");
+        OSL_ENSURE(false, "not implemented");
     }
     else
     {
@@ -3796,8 +3796,8 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
                     xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc);
                 xRet = xDrawDefaults;
             break;
-#ifdef DBG_UTIL
-            default: DBG_ERROR("which table?");
+#if OSL_DEBUG_LEVEL > 1
+            default: OSL_ENSURE(false, "which table?");
 #endif
         }
     }
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 6b15b3e..9cca72b 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -525,7 +525,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
             {
                 if(rSh.GetTableCrsr())
                 {
-                    DBG_ASSERT(rSh.GetTableFmt(), "kein Tabellenformat?");
+                    OSL_ENSURE(rSh.GetTableFmt(), "kein Tabellenformat?");
                     uno::Reference< text::XTextTableCursor >  xCrsr = new 
SwXTextTableCursor(*rSh.GetTableFmt(),
                                                     rSh.GetTableCrsr());
                     aRef = uno::Reference< uno::XInterface >  (xCrsr, uno::UNO_QUERY);;
@@ -650,7 +650,7 @@ SdrObject* SwXTextView::GetControl(
     SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
     Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
 
-    DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
+    OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
 
     SdrObject* pControl = NULL;
     if ( pFormShell && pDrawView && pWindow )
@@ -675,7 +675,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo
     FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
     SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
     Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
-    DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" 
);
+    OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" 
);
 
     uno::Reference< form::runtime::XFormController > xController;
     if ( pFormShell && pDrawView && pWindow )
@@ -885,7 +885,7 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/
 
 void SwXTextView::NotifySelChanged()
 {
-    DBG_ASSERT( m_pView, "view is missing" );
+    OSL_ENSURE( m_pView, "view is missing" );
 
     // destroy temporary document with selected text that is used
     // in PDF export of (multi-)selections.
@@ -960,7 +960,7 @@ void SAL_CALL SwXTextView::setPropertyValue(
             }
             break;
             default :
-                DBG_ERROR("unknown WID");
+                OSL_ENSURE(false, "unknown WID");
         }
     }
 }
@@ -1010,7 +1010,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue(
             }
             break;
             default :
-                DBG_ERROR("unknown WID");
+                OSL_ENSURE(false, "unknown WID");
         }
     }
 
@@ -1022,7 +1022,7 @@ void SAL_CALL SwXTextView::addPropertyChangeListener(
         const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SAL_CALL SwXTextView::removePropertyChangeListener(
@@ -1030,7 +1030,7 @@ void SAL_CALL SwXTextView::removePropertyChangeListener(
         const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ )
     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SAL_CALL SwXTextView::addVetoableChangeListener(
@@ -1038,7 +1038,7 @@ void SAL_CALL SwXTextView::addVetoableChangeListener(
         const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 void SAL_CALL SwXTextView::removeVetoableChangeListener(
@@ -1046,7 +1046,7 @@ void SAL_CALL SwXTextView::removeVetoableChangeListener(
         const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ )
     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
 {
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 OUString SwXTextView::getImplementationName(void) throw( RuntimeException )
@@ -1094,7 +1094,7 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const
 {
 
     sal_Bool bRes = sal_False;
-    DBG_ASSERT(m_pView, "m_pView is NULL ???");
+    OSL_ENSURE(m_pView, "m_pView is NULL ???");
     if(m_pView)
     {
         //! m_pView->GetShellMode() will only work after the shell
@@ -1110,14 +1110,14 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const
 sal_Bool SwXTextViewCursor::isVisible(void) throw( uno::RuntimeException )
 {
     ::vos::OGuard aGuard(Application::GetSolarMutex());
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
     return sal_True;
 }
 
 void SwXTextViewCursor::setVisible(sal_Bool /*bVisible*/) throw( uno::RuntimeException )
 {
     ::vos::OGuard aGuard(Application::GetSolarMutex());
-    DBG_WARNING("not implemented");
+    OSL_ENSURE(false, "not implemented");
 }
 
 awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException )
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index d9b5752..b7bd209 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -563,9 +563,8 @@ void        SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
 
         case CONTENT_TYPE_TABLE        :
         {
-            DBG_ASSERT(nMemberCount ==
-                    pWrtShell->GetTblFrmFmtCount(sal_True),
-                    "MemberCount differiert");
+            OSL_ENSURE(nMemberCount == pWrtShell->GetTblFrmFmtCount(sal_True),
+                       "MemberCount differs");
             Point aNullPt;
             nMemberCount =     pWrtShell->GetTblFrmFmtCount(sal_True);
             for(sal_uInt16 i = 0; i < nMemberCount; i++)
@@ -596,8 +595,8 @@ void        SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
                 eType = FLYCNTTYPE_OLE;
             else if(nContentType == CONTENT_TYPE_GRAPHIC)
                 eType = FLYCNTTYPE_GRF;
-            DBG_ASSERT(nMemberCount ==         pWrtShell->GetFlyCount(eType),
-                    "MemberCount differiert");
+            OSL_ENSURE(nMemberCount ==         pWrtShell->GetFlyCount(eType),
+                    "MemberCount differs");
             Point aNullPt;
             nMemberCount = pWrtShell->GetFlyCount(eType);
             for(sal_uInt16 i = 0; i < nMemberCount; i++)
@@ -1226,7 +1225,7 @@ void  SwContentTree::RequestingChilds( SvLBoxEntry* pParent )
     {
         if(!pParent->HasChilds())
         {
-            DBG_ASSERT(pParent->GetUserData(), "keine UserData?");
+            OSL_ENSURE(pParent->GetUserData(), "no UserData?");
             SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
 
             sal_uInt16 nCount = pCntType->GetMemberCount();
@@ -1396,7 +1395,7 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG )
 {
     SvLBoxEntry* pEntry = GetCurEntry();
     // ist es ein Inhaltstyp?
-    DBG_ASSERT(pEntry, "kein aktueller Eintrag!");
+    OSL_ENSURE(pEntry, "no current entry!");
     if(pEntry)
     {
         if(lcl_IsContentType(pEntry) && !pEntry->HasChilds())
@@ -1409,7 +1408,7 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG )
             }
             //Inhaltstyp anspringen:
             SwContent* pCnt = (SwContent*)pEntry->GetUserData();
-            DBG_ASSERT( pCnt, "keine UserData");
+            OSL_ENSURE( pCnt, "no UserData");
             GotoContent(pCnt);
             if(pCnt->GetParent()->GetType()    == CONTENT_TYPE_FRAME)
                 pActiveShell->EnterStdMode();
@@ -1633,7 +1632,7 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
                                             sal_Int8& rDragMode )
 {
     SwWrtShell* pWrtShell = GetWrtShell();
-    DBG_ASSERT(pWrtShell, "keine Shell!");
+    OSL_ENSURE(pWrtShell, "no Shell!");
     SvLBoxEntry* pEntry = GetCurEntry();
     if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell)
         return sal_False;
@@ -1649,8 +1648,8 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
         case CONTENT_TYPE_OUTLINE:
         {
             sal_uInt16 nPos = ((SwOutlineContent*)pCnt)->GetPos();
-            DBG_ASSERT(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(),
-                       "outlinecnt veraendert");
+            OSL_ENSURE(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(),
+                       "outlinecnt changed");
 
             // #100738# make sure outline may actually be copied
             if( pWrtShell->IsOutlineCopyable( nPos ) )
@@ -2377,8 +2376,8 @@ sal_Bool  SwContentTree::NotifyMoving( SvLBoxEntry*  pTarget,
 
         }
 
-        DBG_ASSERT( pEntry &&
-            lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" );
+        OSL_ENSURE( pEntry &&
+            lcl_IsContent(pEntry),"Source == 0 or Source has no Content" );
         GetParentWindow()->MoveOutline( nSourcePos,
                                     nTargetPos,
                                     sal_True);
@@ -2418,8 +2417,8 @@ sal_Bool  SwContentTree::NotifyCopying( SvLBoxEntry*  pTarget,
         }
 
 
-        DBG_ASSERT( pEntry &&
-            lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" );
+        OSL_ENSURE( pEntry &&
+            lcl_IsContent(pEntry),"Source == 0 or Source has no Content" );
         GetParentWindow()->MoveOutline( nSourcePos,    nTargetPos, sal_False);
 
         //TreeListBox wird aus dem Dokument neu geladen
@@ -3026,10 +3025,10 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
         aObj >>= xTmp;
         uno::Reference< container::XNamed >  xNamed(xTmp, uno::UNO_QUERY);
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
         AbstractSwRenameXNamedDlg* pDlg = pFact->CreateSwRenameXNamedDlg( this, xNamed, 
xNameAccess, DLG_RENAME_XNAMED );
-        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pDlg, "Dialogdiet fail!");
         if(xSecond.is())
             pDlg->SetAlternativeAccess( xSecond, xThird);
 
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index ccb1893..90ab5f9 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -851,13 +851,13 @@ void    SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry )
         break;
         case CTX_EDIT:
         {
-            DBG_ASSERT(pCont, "Edit ohne Entry ? " );
+            OSL_ENSURE(pCont, "edit without entry ? " );
             EditContent(pCont);
         }
         break;
         case CTX_EDIT_LINK:
         {
-            DBG_ASSERT(pCont, "Edit ohne Entry ? " );
+            OSL_ENSURE(pCont, "edit without entry ? " );
             SfxStringItem aName(FN_EDIT_REGION,
                     pCont->GetSection()->GetSectionName());
             rDispatch.Execute(FN_EDIT_REGION, SFX_CALLMODE_ASYNCHRON, &aName, 0L);
@@ -904,14 +904,14 @@ void    SwGlobalTree::ExcecuteContextMenuAction( USHORT nSelectedPopupEntry )
                             0);
 
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                DBG_ASSERT(pFact, "Dialogdiet fail!");
+                OSL_ENSURE(pFact, "Dialogdiet fail!");
                 AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX,
                                                         this, aSet,
                                                         *pActiveShell,
                                                         0,
                                                         USHRT_MAX,
                                                         TRUE);
-                DBG_ASSERT(pDlg, "Dialogdiet fail!");
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if(RET_OK == pDlg->Execute())
                 {
                     SwTOXDescription&  rDesc = pDlg->GetTOXDescription(
@@ -1071,7 +1071,7 @@ void      SwGlobalTree::HideTree()
 void   SwGlobalTree::ExecCommand(USHORT nCmd)
 {
     SvLBoxEntry* pEntry = FirstSelected();
-    DBG_ASSERT(pEntry, "gleich knallt's");
+    OSL_ENSURE(pEntry, "gleich knallt's");
     if(FN_GLOBAL_EDIT == nCmd)
     {
         const SwGlblDocContent* pCont = (const SwGlblDocContent*)
@@ -1327,7 +1327,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const 
Sequen
             //update the global document content after each inserted document
             rSh.GetGlobalDocContent(aTempContents);
             SwGlblDocContent* pAnchorContent = 0;
-            DBG_ASSERT(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content 
-> last insertion failed");
+            OSL_ENSURE(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content 
-> last insertion failed");
             if ( aTempContents.Count() > (nAnchorContent + nFile) )
                 pAnchorContent = aTempContents.GetObject(nAnchorContent + (USHORT)nFile);
             else
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index ca893c5..afe8794 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -237,7 +237,7 @@ USHORT      SwGlossaryList::GetGroupCount()
 
 String SwGlossaryList::GetGroupName(USHORT nPos, BOOL bNoPath, String* pTitle)
 {
-    DBG_ASSERT(aGroupArr.Count() > nPos, "Gruppe nicht vorhanden");
+    OSL_ENSURE(aGroupArr.Count() > nPos, "group not available");
     String sRet(aEmptyStr);
     if(nPos < aGroupArr.Count())
     {
@@ -259,7 +259,7 @@ String SwGlossaryList::GetGroupName(USHORT nPos, BOOL bNoPath, String* pTitle)
 
 USHORT         SwGlossaryList::GetBlockCount(USHORT nGroup)
 {
-    DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden");
+    OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available");
     if(nGroup < aGroupArr.Count())
     {
         AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup);
@@ -275,7 +275,7 @@ USHORT      SwGlossaryList::GetBlockCount(USHORT nGroup)
 
 String SwGlossaryList::GetBlockName(USHORT nGroup, USHORT nBlock, String& rShortName)
 {
-    DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden");
+    OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available");
     if(nGroup < aGroupArr.Count())
     {
         AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup);
diff --git a/sw/source/ui/utlui/navicfg.cxx b/sw/source/ui/utlui/navicfg.cxx
index 82befef..cac1ddd 100644
--- a/sw/source/ui/utlui/navicfg.cxx
+++ b/sw/source/ui/utlui/navicfg.cxx
@@ -33,7 +33,7 @@
 #include <swtypes.hxx> // fuer Pathfinder
 #include <navicfg.hxx>
 #include <swcont.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
 
@@ -79,7 +79,7 @@ SwNavigationConfig::SwNavigationConfig() :
     Sequence<Any> aValues = GetProperties(aNames);
 //     EnableNotification(aNames);
     const Any* pValues = aValues.getConstArray();
-    DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+    OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
     if(aValues.getLength() == aNames.getLength())
     {
         for(int nProp = 0; nProp < aNames.getLength(); nProp++)
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index ceddeee..20ef70a 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -1243,7 +1243,7 @@ IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem)
         {
             aContentTree.Clear();
             pContentView = PTR_CAST(SwView, pFrame->GetViewShell());
-            DBG_ASSERT(pContentView, "keine SwView");
+            OSL_ENSURE(pContentView, "no SwView");
             if(pContentView)
                 pContentWrtShell = pContentView->GetWrtShellPtr();
             else
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index 098f388..cfdc2d7 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -149,7 +149,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
         else
         {
             SwView *pView = GetView();
-            DBG_ASSERT(pView, "no view found");
+            OSL_ENSURE(pView, "no view found");
             if(!pView)
                 return;
             SwWrtShell &rSh = pView->GetWrtShell();
@@ -219,7 +219,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
             break;
 
         default:
-            DBG_ERROR("what a format?");
+            OSL_ENSURE(false, "what a format?");
             break;
         }
 
@@ -294,7 +294,7 @@ void NumFormatListBox::SetDefFormat(const ULONG nDefFmt)
     else
     {
         SwView *pView = GetView();
-        DBG_ASSERT(pView, "no view found");
+        OSL_ENSURE(pView, "no view found");
         if(!pView)
             return;
         SwWrtShell &rSh = pView->GetWrtShell();
@@ -411,12 +411,12 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
         aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage));
 
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-        DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+        OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
         SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aCoreSet, 
             GetView()->GetViewFrame()->GetFrame().GetFrameInterface(),
             RC_DLG_SWNUMFMTDLG );
-        DBG_ASSERT(pDlg, "Dialogdiet fail!");
+        OSL_ENSURE(pDlg, "Dialogdiet fail!");
 
         if (RET_OK == pDlg->Execute())
         {
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index d620caf..fed0cb2 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -40,7 +40,7 @@
 #include <utlui.hrc>
 #include <unotools.hrc>
 #include <unoprnms.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <vcl/msgbox.hxx>
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/view/XScreenCursor.hpp>
@@ -104,7 +104,7 @@ IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG)
     }
     catch(uno::RuntimeException&)
     {
-        DBG_ERROR("Name wurde nicht geaendert");
+        OSL_ENSURE(false, "name wasn't changed");
     }
     EndDialog(RET_OK);
     return 0;
diff --git a/sw/source/ui/utlui/uiitems.cxx b/sw/source/ui/utlui/uiitems.cxx
index bc43925..a7199d0 100644
--- a/sw/source/ui/utlui/uiitems.cxx
+++ b/sw/source/ui/utlui/uiitems.cxx
@@ -85,7 +85,7 @@ SfxPoolItem*  SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 int  SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    DBG_ASSERT( Which() == rAttr.Which(), "keine gleichen Attribute" );
+    OSL_ENSURE( Which() == rAttr.Which(), "keine gleichen Attribute" );
     return ( aFtnInfo == ((SwPageFtnInfoItem&)rAttr).GetPageFtnInfo());
 }
 
@@ -237,7 +237,7 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 int SwPtrItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
     const SwPtrItem& rItem = (SwPtrItem&)rAttr;
     return ( pMisc == rItem.pMisc );
 }
@@ -270,7 +270,7 @@ SfxPoolItem*  SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const
 
 int  SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const
 {
-    DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+    OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" );
     return *pRule == *((SwUINumRuleItem&)rAttr).pRule;
 }
 
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 27372ba..55214b9 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -32,6 +32,7 @@
 
 #include <hintids.hxx>
 
+#include <osl/diagnose.h>
 #include <tools/datetime.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/collatorwrapper.hxx>
@@ -216,7 +217,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
             //
             SwFmtHeader aHeaderFmt(rMaster.GetHeader());
             SwFrmFmt *pHeaderFmt = aHeaderFmt.GetHeaderFmt();
-            ASSERT(pHeaderFmt != 0, "kein HeaderFormat");
+            OSL_ENSURE(pHeaderFmt != 0, "no header format");
 
             ::FillHdFt(pHeaderFmt, rHeaderSet);
 
@@ -252,7 +253,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
             //
             SwFmtFooter aFooterFmt(rMaster.GetFooter());
             SwFrmFmt *pFooterFmt = aFooterFmt.GetFooterFmt();
-            ASSERT(pFooterFmt != 0, "kein FooterFormat");
+            OSL_ENSURE(pFooterFmt != 0, "no footer format");
 
             ::FillHdFt(pFooterFmt, rFooterSet);
 
@@ -365,7 +366,7 @@ void PageDescToItemSet(     const SwPageDesc& rPageDesc, SfxItemSet& rSet)
     {
         const SwFmtHeader &rHeaderFmt = rMaster.GetHeader();
         const SwFrmFmt *pHeaderFmt = rHeaderFmt.GetHeaderFmt();
-        ASSERT(pHeaderFmt != 0, kein HeaderFormat.);
+        OSL_ENSURE(pHeaderFmt != 0, "no header format");
 
         // HeaderInfo, Raender, Hintergrund, Umrandung
         //
@@ -411,7 +412,7 @@ void PageDescToItemSet(     const SwPageDesc& rPageDesc, SfxItemSet& rSet)
     {
         const SwFmtFooter &rFooterFmt = rMaster.GetFooter();
         const SwFrmFmt *pFooterFmt = rFooterFmt.GetFooterFmt();
-        ASSERT(pFooterFmt != 0, kein FooterFormat.);
+        OSL_ENSURE(pFooterFmt != 0, "no footer format");
 
         // FooterInfo, Raender, Hintergrund, Umrandung
         //
@@ -689,7 +690,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, USHORT *pPercent,
             }
             else
             {
-                DBG_ERROR("wo soll die Breite denn herkommen?");
+                OSL_ENSURE(false, "where to get the actual width from?");
             }
             const SvxLRSpaceItem& rLRSpace = pFmt->GetLRSpace();
             nWidth -= (rLRSpace.GetRight() + rLRSpace.GetLeft());
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index 9495d01..a61579e 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -37,7 +37,7 @@
 #include <unotools.hrc>
 #include <unotools.hxx>
 #include <unoprnms.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <vcl/msgbox.hxx>
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/view/XScreenCursor.hpp>
diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx
index b63c55b..16ada1f 100644
--- a/sw/source/ui/utlui/viewlayoutctrl.cxx
+++ b/sw/source/ui/utlui/viewlayoutctrl.cxx
@@ -88,7 +88,7 @@ void SwViewLayoutControl::StateChanged( USHORT /*nSID*/, SfxItemState eState, co
         GetStatusBar().SetItemText( GetId(), String() );
     else
     {
-        DBG_ASSERT( pState->ISA( SvxViewLayoutItem ), "invalid item type" );
+        OSL_ENSURE( pState->ISA( SvxViewLayoutItem ), "invalid item type" );
         const USHORT nColumns  = static_cast<const SvxViewLayoutItem*>( pState )->GetValue();
         const bool   bBookMode = static_cast<const SvxViewLayoutItem*>( pState )->IsBookMode();
 
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 08721c9..05e0a8a 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -209,7 +209,7 @@ sal_Int32 SwVbaTableHelper::GetColCount( SwTabCols& rCols ) const
 
 sal_Int32 SwVbaTableHelper::GetRightSeparator( SwTabCols& rCols, sal_Int32 nNum) const
 {
-    DBG_ASSERT( nNum < (sal_Int32)GetColCount( rCols ) ,"Index out of range");
+    OSL_ENSURE( nNum < (sal_Int32)GetColCount( rCols ) ,"Index out of range");
     sal_Int32 i = 0;
     while( nNum >= 0 )
     {
diff --git a/sw/source/ui/web/wdocsh.cxx b/sw/source/ui/web/wdocsh.cxx
index 36634ee..71a4305 100644
--- a/sw/source/ui/web/wdocsh.cxx
+++ b/sw/source/ui/web/wdocsh.cxx
@@ -92,7 +92,7 @@ void SwWebDocShell::FillClass( SvGlobalName * pClassName,
                                    sal_Bool bTemplate /* = sal_False */) const
 {
     (void)bTemplate;
-    DBG_ASSERT( bTemplate == sal_False, "No template for Writer Web" );
+    OSL_ENSURE( bTemplate == sal_False, "No template for Writer Web" );
 
     if (nVersion == SOFFICE_FILEFORMAT_60)
     {
diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx
index e8e226c..c7f3a4e 100644
--- a/sw/source/ui/web/wview.cxx
+++ b/sw/source/ui/web/wview.cxx
@@ -184,7 +184,7 @@ void SwWebView::SelectShell()
                     break;
             }
             pSfxShell = rDispatcher.GetShell( --i );
-            ASSERT( pSfxShell, "My Shell ist lost in space" );
+            OSL_ENSURE( pSfxShell, "My Shell ist lost in space" );
             rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE);
         }
 
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index 7d98db5..2e404d3 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -388,7 +388,7 @@ long SwWrtShell::DelRight()
             LeaveSelFrmMode();
             UnSelectFrm();
             // --> OD 2006-07-06 #134369#
-            ASSERT( !IsFrmSelected(),
+            OSL_ENSURE( !IsFrmSelected(),
                     "<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all 
objects" )
             // <--
             // --> OD 2006-07-10 #134369#
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index d8890ff..415e9a9 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -774,7 +774,7 @@ void SwWrtShell::LeaveSelFrmMode()
 IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt )
 {
     const SwFrmFmt *pFmt = pFlyFmt ? (SwFrmFmt*)pFlyFmt : GetFlyFrmFmt();
-    ASSERT(pFmt, kein FrameFormat.);
+    OSL_ENSURE(pFmt, "no frame format");
     const SvxMacroItem &rFmtMac = pFmt->GetMacro();
 
     if(rFmtMac.HasMacro(SW_EVENT_OBJECT_SELECT))
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 940512d..b98ba83 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -633,7 +633,7 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
          !GetView().GetViewFrame()->GetFrame().IsInPlace() )
     {
         svt::EmbeddedObjectRef& xRef = GetOLEObject();
-        ASSERT( xRef.is(), "OLE not found" );
+        OSL_ENSURE( xRef.is(), "OLE not found" );
         SfxInPlaceClient* pCli=0;
 
         pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
@@ -679,7 +679,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
 {
     //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
     //zwischen der VisArea des Objektes und der ObjArea.
-    ASSERT( xObj.is(), "ObjectRef not  valid" );
+    OSL_ENSURE( xObj.is(), "ObjectRef not  valid" );
 
     sal_Int64 nAspect = xObj.GetViewAspect();
     if ( nAspect == embed::Aspects::MSOLE_ICON )
@@ -778,13 +778,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
     }
     catch( embed::NoVisualAreaSizeException& )
     {
-        DBG_ERROR( "Can't get visual area size!\n" );
+        OSL_ENSURE(false, "Can't get visual area size!\n" );
         // the scaling will not be done
     }
     catch( uno::Exception& )
     {
         // TODO/LATER: handle the error
-        DBG_ERROR( "Can't get visual area size!\n" );
+        OSL_ENSURE(false, "Can't get visual area size!\n" );
         return;
     }
 
@@ -1130,9 +1130,9 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
                     // check, if numbering of the outline level of the pararaph
                     // style is active. If not, activate this outline level.
                     nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
-                    ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),      //<-end,zhaojianwei
+                    OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
                             "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, 
but no outline level" );
-                    if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&               
//<-end,zhaojianwei
+                    if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
                          pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) 
).GetNumberingType()
                             == SVX_NUM_NUMBER_NONE )
                     {
@@ -1178,10 +1178,10 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
             {
                 // check, if numbering of the outline level of the pararaph
                 // style is active. If not, activate this outline level.
-                nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline 
level,zhaojianwei
-                ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
+                nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
+                OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
                         "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but 
no outline level" );
-                if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
+                if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
                      pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
                         == SVX_NUM_NUMBER_NONE )
                 {
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 0430af1..02acea8 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -159,10 +159,10 @@ BOOL SwWrtShell::StartInputFldDlg( SwField* pFld, BOOL bNextButton,
 //     SwFldInputDlg* pDlg = new SwFldInputDlg( GetWin(), *this, pFld );
 
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "Dialogdiet fail!");
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
     AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT,
                                                         pParentWin, *this, pFld, bNextButton);
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if(pWindowState && pWindowState->Len())
         pDlg->SetWindowState(*pWindowState);
     BOOL bRet = RET_CANCEL == pDlg->Execute();
@@ -179,10 +179,10 @@ BOOL SwWrtShell::StartInputFldDlg( SwField* pFld, BOOL bNextButton,
 BOOL SwWrtShell::StartDropDownFldDlg(SwField* pFld, BOOL bNextButton, ByteString* pWindowState)
 {
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+    OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
     AbstractDropDownFieldDialog* pDlg = pFact->CreateDropDownFieldDialog( NULL, *this, pFld, 
DLG_FLD_DROPDOWN ,bNextButton );
-    DBG_ASSERT(pDlg, "Dialogdiet fail!");
+    OSL_ENSURE(pDlg, "Dialogdiet fail!");
     if(pWindowState && pWindowState->Len())
         pDlg->SetWindowState(*pWindowState);
     USHORT nRet = pDlg->Execute();
@@ -383,7 +383,7 @@ BOOL SwWrtShell::ClickToINetGrf( const Point& rDocPt, USHORT nFilter )
 void LoadURL( const String& rURL, ViewShell* pVSh, USHORT nFilter,
               const String *pTargetFrameName )
 {
-    ASSERT( rURL.Len() && pVSh, "was soll hier geladen werden?" );
+    OSL_ENSURE( rURL.Len() && pVSh, "what should be loaded here?" );
     if( !rURL.Len() || !pVSh )
         return ;
 
@@ -398,7 +398,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, USHORT nFilter,
         return;
 
     SwDocShell* pDShell = pSh->GetView().GetDocShell();
-    DBG_ASSERT( pDShell, "No DocShell?!");
+    OSL_ENSURE( pDShell, "No DocShell?!");
     String sTargetFrame;
     if( pTargetFrameName && pTargetFrameName->Len() )
         sTargetFrame = *pTargetFrameName;
diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx
index 048195a..9c3658f 100644
--- a/sw/source/ui/wrtsh/wrtsh3.cxx
+++ b/sw/source/ui/wrtsh/wrtsh3.cxx
@@ -204,7 +204,7 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const
             {
                 uno::Reference< awt::XControlModel >  xControlModel = 
pUnoCtrl->GetUnoControlModel();
 
-                ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
+                OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" );
                 if( !xControlModel.is() )
                     return bRet;
 
diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx
index a4bffb4..ef70e42 100644
--- a/sw/source/ui/wrtsh/wrtundo.cxx
+++ b/sw/source/ui/wrtsh/wrtundo.cxx
@@ -155,7 +155,7 @@ USHORT SwWrtShell::GetDoStrings( DoType eDoType, SfxStringListItem& rStrs ) cons
             sList += *rIdNm.GetUndoStr();
         else
         {
-            ASSERT( !this, "no Undo/Redo Test set" );
+            OSL_ENSURE( !this, "no Undo/Redo Test set" );
         }
         sList += '\n';
     }

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.