[PATCH 1/2] REPLACE DBG_stuff with OSL_ASSERT and OSL_FAIL

Jacek Wolszczak shutdownrunner at gmail.com
Sun May 8 13:14:45 PDT 2011


---
 sw/inc/PostItMgr.hxx                         |    2 +-
 sw/inc/authfld.hxx                           |    4 +-
 sw/inc/bparr.hxx                             |    4 +-
 sw/inc/switerator.hxx                        |    4 +-
 sw/inc/tox.hxx                               |    6 +-
 sw/qa/core/bigpointerarray-new.cxx           |   12 ++--
 sw/source/core/access/acccell.cxx            |   10 ++--
 sw/source/core/access/accdoc.cxx             |    4 +-
 sw/source/core/access/accframebase.cxx       |    6 +-
 sw/source/core/access/accmap.cxx             |   18 +++---
 sw/source/core/access/accpage.cxx            |    6 +-
 sw/source/core/access/accpara.cxx            |   54 +++++++-------
 sw/source/core/access/accportions.cxx        |   96 +++++++++++++-------------
 sw/source/core/access/accselectionhelper.cxx |    6 +-
 sw/source/core/access/acctable.cxx           |   12 ++--
 sw/source/core/access/acctextframe.cxx       |    4 +-
 sw/source/core/attr/calbck.cxx               |    2 +-
 sw/source/core/bastyp/bparr.cxx              |   12 ++--
 sw/source/core/bastyp/breakit.cxx            |    2 +-
 sw/source/core/doc/acmplwrd.cxx              |    2 +-
 sw/source/core/doc/doc.cxx                   |   30 ++++----
 sw/source/core/doc/doccomp.cxx               |    4 +-
 sw/source/core/doc/docftn.cxx                |    4 +-
 sw/source/core/doc/docglbl.cxx               |    4 +-
 sw/source/core/doc/docglos.cxx               |    8 +-
 sw/source/core/doc/doclay.cxx                |    4 +-
 sw/source/core/doc/docredln.cxx              |   22 +++---
 sw/source/core/doc/doctxm.cxx                |    2 +-
 sw/source/core/doc/docxforms.cxx             |   14 ++--
 sw/source/core/docnode/ndcopy.cxx            |    2 +-
 sw/source/core/docnode/nodes.cxx             |    4 +-
 sw/source/core/edit/edlingu.cxx              |   10 ++--
 sw/source/core/edit/edsect.cxx               |    8 +-
 sw/source/core/fields/authfld.cxx            |    6 +-
 sw/source/core/fields/docufld.cxx            |    8 +-
 sw/source/core/fields/expfld.cxx             |    2 +-
 sw/source/core/fields/macrofld.cxx           |    4 +-
 sw/source/core/graphic/grfatr.cxx            |    8 +-
 sw/source/core/graphic/ndgrf.cxx             |    2 +-
 sw/source/core/layout/atrfrm.cxx             |    8 +-
 sw/source/core/layout/pagechg.cxx            |    2 +-
 sw/source/core/ole/ndole.cxx                 |   10 ++--
 sw/source/core/swg/SwXMLTextBlocks.cxx       |    6 +-
 sw/source/core/swg/SwXMLTextBlocks1.cxx      |   12 ++--
 sw/source/core/text/inftxt.cxx               |    2 +-
 sw/source/core/text/wrong.cxx                |    4 +-
 sw/source/core/tox/toxhlp.cxx                |   12 ++--
 sw/source/core/txtnode/txtedt.cxx            |   10 ++--
 sw/source/core/unocore/SwXTextDefaults.cxx   |    8 +-
 sw/source/core/unocore/swunohelper.cxx       |    6 +-
 sw/source/core/unocore/unochart.cxx          |   84 +++++++++++-----------
 sw/source/core/unocore/unocrsrhelper.cxx     |    6 +-
 sw/source/core/unocore/unodraw.cxx           |   28 ++++----
 sw/source/core/unocore/unofield.cxx          |   20 +++---
 sw/source/core/unocore/unoframe.cxx          |   22 +++---
 sw/source/core/unocore/unoftn.cxx            |    6 +-
 sw/source/core/unocore/unoidx.cxx            |    2 +-
 sw/source/core/unocore/unomap.cxx            |    4 +-
 sw/source/core/unocore/unoobj.cxx            |   10 ++--
 sw/source/core/unocore/unoobj2.cxx           |    6 +-
 sw/source/core/unocore/unoparagraph.cxx      |    6 +-
 sw/source/core/unocore/unoport.cxx           |   10 ++--
 sw/source/core/unocore/unoportenum.cxx       |    4 +-
 sw/source/core/unocore/unoprnms.cxx          |    2 +-
 sw/source/core/unocore/unoredline.cxx        |   10 ++--
 sw/source/core/unocore/unosett.cxx           |   28 ++++----
 sw/source/core/unocore/unosrch.cxx           |    8 +-
 sw/source/core/unocore/unostyle.cxx          |   38 +++++-----
 sw/source/core/unocore/unotbl.cxx            |   62 ++++++++--------
 sw/source/core/unocore/unotext.cxx           |    8 +-
 sw/source/core/view/printdata.cxx            |   16 ++--
 sw/source/core/view/viewpg.cxx               |   10 ++--
 sw/source/core/view/viewsh.cxx               |    6 +-
 sw/source/core/view/vprint.cxx               |   10 ++--
 sw/source/filter/basflt/shellio.cxx          |    2 +-
 sw/source/filter/html/htmlatr.cxx            |    2 +-
 sw/source/filter/html/htmlcss1.cxx           |    2 +-
 sw/source/filter/html/htmlfld.cxx            |    4 +-
 sw/source/filter/html/htmlform.cxx           |    8 +-
 sw/source/filter/html/htmlnum.cxx            |    4 +-
 sw/source/filter/html/parcss1.cxx            |   16 ++--
 sw/source/filter/html/svxcss1.cxx            |   60 ++++++++--------
 sw/source/filter/html/swhtml.cxx             |   14 ++--
 sw/source/filter/rtf/swparrtf.cxx            |    2 +-
 sw/source/filter/ww1/w1class.cxx             |   82 +++++++++++-----------
 sw/source/filter/ww1/w1class.hxx             |   20 +++---
 sw/source/filter/ww1/w1filter.cxx            |   72 ++++++++++----------
 sw/source/filter/ww8/needed_cast.hxx         |    2 +-
 sw/source/filter/ww8/styles.cxx              |    2 +-
 sw/source/filter/ww8/writerhelper.cxx        |    2 +-
 sw/source/filter/ww8/wrtww8.cxx              |    8 +-
 sw/source/filter/ww8/wrtww8gr.cxx            |    4 +-
 sw/source/filter/ww8/ww8par.cxx              |    8 +-
 sw/source/filter/ww8/ww8par3.cxx             |    2 +-
 sw/source/filter/ww8/ww8scan.cxx             |    8 +-
 sw/source/filter/xml/swxml.cxx               |   18 +++---
 sw/source/filter/xml/wrtxml.cxx              |   10 ++--
 sw/source/filter/xml/xmlexpit.cxx            |   30 ++++----
 sw/source/filter/xml/xmlfmte.cxx             |    6 +-
 sw/source/filter/xml/xmlimp.cxx              |   10 ++--
 sw/source/filter/xml/xmlimpit.cxx            |   28 ++++----
 sw/source/filter/xml/xmlithlp.cxx            |    4 +-
 sw/source/filter/xml/xmltble.cxx             |    4 +-
 sw/source/filter/xml/xmltbli.cxx             |    4 +-
 sw/source/filter/xml/xmltexte.cxx            |    2 +-
 sw/source/filter/xml/xmltexti.cxx            |    2 +-
 sw/source/ui/misc/pgfnote.cxx                |    4 +-
 107 files changed, 672 insertions(+), 672 deletions(-)

diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index f3e20bc..905dc4f 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -118,7 +118,7 @@ class SwNoteProps: public utl::ConfigItem
             const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames = GetPropertyNames();
                 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aValues = GetProperties(rNames);
                 const ::com::sun::star::uno::Any* pValues = aValues.getConstArray();
-               DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+               OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed");
                 if (aValues.getLength())
                 pValues[0]>>=bIsShowAnchor;
         }
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index ac1b50a..1a1830f 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -183,12 +183,12 @@ public:
 // --- inlines -----------------------------------------------------------
 inline const String& 	SwAuthEntry::GetAuthorField(ToxAuthorityField ePos)const
 {
-    DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index");
+    OSL_ENSURE(AUTH_FIELD_END > ePos, "wrong index");
     return aAuthFields[ePos];
 }
 inline void	SwAuthEntry::SetAuthorField(ToxAuthorityField ePos, const String& rField)
 {
-    DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index");
+    OSL_ENSURE(AUTH_FIELD_END > ePos, "wrong index");
     if(AUTH_FIELD_END > ePos)
         aAuthFields[ePos] = rField;
 }
diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index a9550ae..9cd9f1e 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -30,7 +30,7 @@
 #define _BPARR_HXX
 
 #include <tools/solar.h>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 #include <swdllapi.h>
 
 struct BlockInfo;
@@ -113,7 +113,7 @@ public:
 
 inline sal_uLong BigPtrEntry::GetPos() const
 {
-    DBG_ASSERT( this == pBlock->pData[ nOffset ], "element not in the block" );
+    OSL_ENSURE( this == pBlock->pData[ nOffset ], "element not in the block" );
     return pBlock->nStart + nOffset;
 }
 
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
index cbdc0b5..963a13c 100644
--- a/sw/inc/switerator.hxx
+++ b/sw/inc/switerator.hxx
@@ -28,14 +28,14 @@
 #define _SWITERATOR_HXX
 
 #include <calbck.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
 
 template< class TElementType, class TSource > class SwIterator 
 {
     SwClientIter aClientIter;
 public:
 
-    SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
+    SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { OSL_ENSURE( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
     TElementType* First()     { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
     TElementType* Last()      { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
     TElementType* Next()      { SwClient* p = aClientIter.Next();     return PTR_CAST(TElementType,p); }
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 3dc80c8..246c085 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -543,12 +543,12 @@ public:
 
     const String&			GetStyleNames(sal_uInt16 nLevel) const
                                 {
-                                DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
+                                OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
                                 return aStyleNames[nLevel];
                                 }
     void					SetStyleNames(const String& rSet, sal_uInt16 nLevel)
                                 {
-                                DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
+                                OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
                                 aStyleNames[nLevel] = rSet;
                                 }
     sal_Bool					IsFromChapter() const { return bFromChapter;}
@@ -760,7 +760,7 @@ inline sal_uInt16 SwTOXBase::GetLevel() const
 
 inline void SwTOXBase::SetTemplateName(const String& rName)
 {
-    DBG_WARNING("SwTOXBase::SetTemplateName obsolete");
+    OSL_FAIL("SwTOXBase::SetTemplateName obsolete");
     aStyleNames[0] = rName;
 }
 
diff --git a/sw/qa/core/bigpointerarray-new.cxx b/sw/qa/core/bigpointerarray-new.cxx
index c86c059..b642e7f 100644
--- a/sw/qa/core/bigpointerarray-new.cxx
+++ b/sw/qa/core/bigpointerarray-new.cxx
@@ -44,14 +44,14 @@ sal_uLong BigPtrArray::Count() const
 
 void BigPtrArray::Move(sal_uLong fromPos, sal_uLong toPos)
 {
-    DBG_ASSERT(fromPos < container_.size() && toPos < container_.size(), "BigPtrArray.Move precondition violation");
+    OSL_ENSURE(fromPos < container_.size() && toPos < container_.size(), "BigPtrArray.Move precondition violation");
     Insert(container_[fromPos], toPos);
     Remove(toPos < fromPos ? fromPos + 1 : fromPos, 1);
 }
 
 void BigPtrArray::ForEach(sal_uLong fromPos, sal_uLong toPos, FnForEach fn, void* pArgs)
 {
-    DBG_ASSERT(fromPos < toPos && fromPos < container_.size() && toPos < container_.size(), "BigPtrArray::ForEach precondition violation");
+    OSL_ENSURE(fromPos < toPos && fromPos < container_.size() && toPos < container_.size(), "BigPtrArray::ForEach precondition violation");
     Container_t::const_iterator iter = container_.begin() + fromPos;
     Container_t::const_iterator iter_end = container_.begin() + toPos;
     for (/*no init*/; iter != iter_end; ++iter)
@@ -68,13 +68,13 @@ void BigPtrArray::ForEach(FnForEach fn, void* pArgs)
 
 ElementPtr BigPtrArray::operator[](sal_uLong pos) const
 {
-    DBG_ASSERT(pos < container_.size(), "BigPtrArray::operator[] precondition violation");
+    OSL_ENSURE(pos < container_.size(), "BigPtrArray::operator[] precondition violation");
     return container_[pos];
 }
 
 void BigPtrArray::Insert(const ElementPtr& rElem, sal_uLong pos)
 {    
-    DBG_ASSERT(pos <= container_.size(), "BigPtrArray::Insert precondition violation");
+    OSL_ENSURE(pos <= container_.size(), "BigPtrArray::Insert precondition violation");
     
     rElem->pBigPtrArray_ = this;
     rElem->pos_ = pos;    
@@ -90,14 +90,14 @@ void BigPtrArray::Insert(const ElementPtr& rElem, sal_uLong pos)
 
 void BigPtrArray::Remove( sal_uLong pos, sal_uLong n )
 {
-    DBG_ASSERT((pos < container_.size()) && ((container_.begin() + pos + n) < container_.end()), "BigPtrArray.Remove precondition violation")    
+    OSL_ENSURE((pos < container_.size()) && ((container_.begin() + pos + n) < container_.end()), "BigPtrArray.Remove precondition violation")
     container_.erase(container_.begin() + pos, container_.begin() + pos + n);
     FixElementIndizes(container_.begin(), container_.end());    
 }
 
 void BigPtrArray::Replace(sal_uLong pos, const ElementPtr& rElem)
 {
-    DBG_ASSERT(pos < container_.size(), "BigPtrArray::Replace precondition violation");
+    OSL_ENSURE(pos < container_.size(), "BigPtrArray::Replace precondition violation");
     rElem->pBigPtrArray_ = this;
     rElem->pos_ = pos;
     container_[pos] = rElem;
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index dbd1b51..18e8d4a 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -67,9 +67,9 @@ sal_Bool SwAccessibleCell::IsSelected()
 {
     sal_Bool bRet = sal_False;
 
-    DBG_ASSERT( GetMap(), "no map?" );
+    OSL_ENSURE( GetMap(), "no map?" );
     const ViewShell *pVSh = GetMap()->GetShell();
-    DBG_ASSERT( pVSh, "no shell?" );
+    OSL_ENSURE( pVSh, "no shell?" );
     if( pVSh->ISA( SwCrsrShell ) )
     {
         const SwCrsrShell *pCSh = static_cast< const SwCrsrShell * >( pVSh );
@@ -92,7 +92,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
 
     // SELECTABLE
     const ViewShell *pVSh = GetMap()->GetShell();
-    DBG_ASSERT( pVSh, "no shell?" );
+    OSL_ENSURE( pVSh, "no shell?" );
     if( pVSh->ISA( SwCrsrShell ) )
         rStateSet.AddState( AccessibleStateType::SELECTABLE );
 
@@ -324,8 +324,8 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
 
 SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
 {
-    DBG_ASSERT( GetFrm() != NULL, "no frame?" );
-    DBG_ASSERT( GetFrm()->IsCellFrm(), "no cell frame?" );
+    OSL_ENSURE( GetFrm() != NULL, "no frame?" );
+    OSL_ENSURE( GetFrm()->IsCellFrm(), "no cell frame?" );
 
     const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
     return pCellFrm->GetTabBox()->GetFrmFmt();
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index d60c8ae..40bc84d 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -346,11 +346,11 @@ void SwAccessibleDocument::Dispose( sal_Bool bRecursive )
 
 IMPL_LINK( SwAccessibleDocument, 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???" );
         switch ( pVclEvent->GetId() )
         {
         case VCLEVENT_WINDOW_SHOW:  // send create on show for direct accessible children
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index bd88adb..060af1e 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -55,9 +55,9 @@ sal_Bool SwAccessibleFrameBase::IsSelected()
 {
     sal_Bool bRet = sal_False;
 
-    DBG_ASSERT( GetMap(), "no map?" );
+    OSL_ENSURE( GetMap(), "no map?" );
     const ViewShell *pVSh = GetMap()->GetShell();
-    DBG_ASSERT( pVSh, "no shell?" );
+    OSL_ENSURE( pVSh, "no shell?" );
     if( pVSh->ISA( SwFEShell ) )
     {
         const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
@@ -75,7 +75,7 @@ void SwAccessibleFrameBase::GetStates(
     SwAccessibleContext::GetStates( rStateSet );
 
     const ViewShell *pVSh = GetMap()->GetShell();
-    DBG_ASSERT( pVSh, "no shell?" );
+    OSL_ENSURE( pVSh, "no shell?" );
     sal_Bool bSelectable =  pVSh->ISA( SwFEShell );
 
     // SELECTABLE
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index dd16efc..c552e67 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1412,7 +1412,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
                                     static_cast< const SwTabFrm *>( pFrm ) );
                     break;
                 case FRM_PAGE:
-                    DBG_ASSERT( GetShell()->IsPreView(),
+                    OSL_ENSURE( GetShell()->IsPreView(),
                                 "accessible page frames only in PagePreview" );
                     pAcc = new SwAccessiblePage( this, pFrm );
                     break;
@@ -2210,8 +2210,8 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages
                                      const SwPageFrm* _pSelectedPageFrm,
                                      const Size&      _rPrevwWinSize )
 {
-    DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
-    DBG_ASSERT( mpPreview != NULL, "no preview data?" );
+    OSL_ENSURE( GetShell()->IsPreView(), "no preview?" );
+    OSL_ENSURE( mpPreview != NULL, "no preview data?" );
 
     mpPreview->Update( *this, _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize );
 
@@ -2247,8 +2247,8 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages
 
 void SwAccessibleMap::InvalidatePreViewSelection( sal_uInt16 nSelPage )
 {
-    DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
-    DBG_ASSERT( mpPreview != NULL, "no preview data?" );
+    OSL_ENSURE( GetShell()->IsPreView(), "no preview?" );
+    OSL_ENSURE( mpPreview != NULL, "no preview data?" );
 
     mpPreview->InvalidateSelection( GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
 
@@ -2550,7 +2550,7 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
     MapMode aMapMode = GetShell()->GetWin()->GetMapMode();
     if( GetShell()->IsPreView() )
     {
-        DBG_ASSERT( mpPreview != NULL, "need preview data" );
+        OSL_ENSURE( mpPreview != NULL, "need preview data" );
 
         mpPreview->AdjustMapMode( aMapMode, _rPoint );
     }
@@ -2559,8 +2559,8 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
 
 Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPrevwPageNum ) const
 {
-    DBG_ASSERT( mpVSh->IsPreView(), "no page preview accessible." );
-    DBG_ASSERT( mpVSh->IsPreView() && ( mpPreview != NULL ),
+    OSL_ENSURE( mpVSh->IsPreView(), "no page preview accessible." );
+    OSL_ENSURE( mpVSh->IsPreView() && ( mpPreview != NULL ),
                 "missing accessible preview data at page preview" );
     if ( mpVSh->IsPreView() && ( mpPreview != NULL ) )
     {
@@ -2770,7 +2770,7 @@ void SwAccessibleMap::InvalidateTextSelectionOfAllParas()
 
 const SwRect& SwAccessibleMap::GetVisArea() const
 {
-    DBG_ASSERT( !GetShell()->IsPreView() || (mpPreview != NULL),
+    OSL_ENSURE( !GetShell()->IsPreView() || (mpPreview != NULL),
                 "preview without preview data?" );
 
     return GetShell()->IsPreView()
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index cd1dc8a..76896e6 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -129,9 +129,9 @@ SwAccessiblePage::SwAccessiblePage( SwAccessibleMap* pInitMap,
     : SwAccessibleContext( pInitMap, AccessibleRole::PANEL, pFrame )
     , bIsSelected( sal_False )
 {
-    DBG_ASSERT( pFrame != NULL, "need frame" );
-    DBG_ASSERT( pInitMap != NULL, "need map" );
-    DBG_ASSERT( pFrame->IsPageFrm(), "need page frame" );
+    OSL_ENSURE( pFrame != NULL, "need frame" );
+    OSL_ENSURE( pInitMap != NULL, "need map" );
+    OSL_ENSURE( pFrame->IsPageFrm(), "need page frame" );
 
     SolarMutexGuard aGuard;
 
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index c84fc47..a9db42e 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -110,10 +110,10 @@ const xub_StrLen MAX_DESC_TEXT_LEN = 40;
 const SwTxtNode* SwAccessibleParagraph::GetTxtNode() const
 {
     const SwFrm* pFrm = GetFrm();
-    DBG_ASSERT( pFrm->IsTxtFrm(), "The text frame has mutated!" );
+    OSL_ENSURE( pFrm->IsTxtFrm(), "The text frame has mutated!" );
 
     const SwTxtNode* pNode = static_cast<const SwTxtFrm*>(pFrm)->GetTxtNode();
-    DBG_ASSERT( pNode != NULL, "A text frame without a text node." );
+    OSL_ENSURE( pNode != NULL, "A text frame without a text node." );
 
     return pNode;
 }
@@ -160,8 +160,8 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
                     nRet = GetPortionData().GetAccessiblePosition( nIndex );
                 }
 
-                DBG_ASSERT( nRet >= 0, "invalid cursor?" );
-                DBG_ASSERT( nRet <= GetPortionData().GetAccessibleString().
+                OSL_ENSURE( nRet >= 0, "invalid cursor?" );
+                OSL_ENSURE( nRet <= GetPortionData().GetAccessibleString().
                                               getLength(), "invalid cursor?" );
             }
             // else: in this paragraph, but in different frame
@@ -215,7 +215,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
                     }
                     else
                     {
-                        DBG_ASSERT( nHere == nStartIndex,
+                        OSL_ENSURE( nHere == nStartIndex,
                                     "miscalculated index" );
 
                         // selection starts in this node:
@@ -230,7 +230,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
                         else if( nCoreStart <=
                                  GetPortionData().GetLastValidCorePosition() )
                         {
-                            DBG_ASSERT(
+                            OSL_ENSURE(
                                 GetPortionData().IsValidCorePosition(
                                                                   nCoreStart ),
                                  "problem determining valid core position" );
@@ -252,7 +252,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
                     }
                     else
                     {
-                        DBG_ASSERT( nHere == nEndIndex,
+                        OSL_ENSURE( nHere == nEndIndex,
                                     "miscalculated index" );
 
                         // selection ends in this node: then select everything
@@ -269,7 +269,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
                                  GetPortionData().GetFirstValidCorePosition() )
                         {
                             // selection is inside our part of this para
-                            DBG_ASSERT(
+                            OSL_ENSURE(
                                 GetPortionData().IsValidCorePosition(
                                                                   nCoreEnd ),
                                  "problem determining valid core position" );
@@ -519,8 +519,8 @@ void SwAccessibleParagraph::UpdatePortionData()
     throw( uno::RuntimeException )
 {
     // obtain the text frame
-    DBG_ASSERT( GetFrm() != NULL, "The text frame has vanished!" );
-    DBG_ASSERT( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
+    OSL_ENSURE( GetFrm() != NULL, "The text frame has vanished!" );
+    OSL_ENSURE( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
     const SwTxtFrm* pFrm = static_cast<const SwTxtFrm*>( GetFrm() );
 
     // build new portion data
@@ -529,7 +529,7 @@ void SwAccessibleParagraph::UpdatePortionData()
         pFrm->GetTxtNode(), GetMap()->GetShell()->GetViewOptions() );
     pFrm->VisitPortions( *pPortionData );
 
-    DBG_ASSERT( pPortionData != NULL, "UpdatePortionData() failed" );
+    OSL_ENSURE( pPortionData != NULL, "UpdatePortionData() failed" );
 }
 
 void SwAccessibleParagraph::ClearPortionData()
@@ -544,23 +544,23 @@ void SwAccessibleParagraph::ClearPortionData()
 
 void SwAccessibleParagraph::ExecuteAtViewShell( sal_uInt16 nSlot )
 {
-    DBG_ASSERT( GetMap() != NULL, "no map?" );
+    OSL_ENSURE( GetMap() != NULL, "no map?" );
     ViewShell* pViewShell = GetMap()->GetShell();
 
-    DBG_ASSERT( pViewShell != NULL, "View shell exptected!" );
+    OSL_ENSURE( pViewShell != NULL, "View shell exptected!" );
     SfxViewShell* pSfxShell = pViewShell->GetSfxViewShell();
 
-    DBG_ASSERT( pSfxShell != NULL, "SfxViewShell shell exptected!" );
+    OSL_ENSURE( pSfxShell != NULL, "SfxViewShell shell exptected!" );
     if( !pSfxShell )
         return;
 
     SfxViewFrame *pFrame = pSfxShell->GetViewFrame();
-    DBG_ASSERT( pFrame != NULL, "View frame exptected!" );
+    OSL_ENSURE( pFrame != NULL, "View frame exptected!" );
     if( !pFrame )
         return;
 
     SfxDispatcher *pDispatcher = pFrame->GetDispatcher();
-    DBG_ASSERT( pDispatcher != NULL, "Dispatcher exptected!" );
+    OSL_ENSURE( pDispatcher != NULL, "Dispatcher exptected!" );
     if( !pDispatcher )
         return;
 
@@ -571,7 +571,7 @@ SwXTextPortion* SwAccessibleParagraph::CreateUnoPortion(
     sal_Int32 nStartIndex,
     sal_Int32 nEndIndex )
 {
-    DBG_ASSERT( (IsValidChar(nStartIndex, GetString().getLength()) &&
+    OSL_ENSURE( (IsValidChar(nStartIndex, GetString().getLength()) &&
                  (nEndIndex == -1)) ||
                 IsValidRange(nStartIndex, nEndIndex, GetString().getLength()),
                 "please check parameters before calling this method" );
@@ -644,8 +644,8 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
     sal_Bool bRet = sal_False;
 
     // now ask the Break-Iterator for the word
-    DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
-    DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+    OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+    OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
     if( pBreakIt->GetBreakIter().is() )
     {
         // get locale for this position
@@ -724,8 +724,8 @@ sal_Bool SwAccessibleParagraph::GetGlyphBoundary(
 
     // ask the Break-Iterator for the glyph by moving one cell
     // forward, and then one cell back
-    DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
-    DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+    OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+    OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
     if( pBreakIt->GetBreakIter().is() )
     {
         // get locale for this position
@@ -741,8 +741,8 @@ sal_Bool SwAccessibleParagraph::GetGlyphBoundary(
         rBound.startPos = pBreakIt->GetBreakIter()->previousCharacters(
              rText, rBound.endPos, aLocale, nIterMode, 1, nDone );
 
-        DBG_ASSERT( rBound.startPos <= nPos, "start pos too high" );
-        DBG_ASSERT( rBound.endPos >= nPos, "end pos too low" );
+        OSL_ENSURE( rBound.startPos <= nPos, "start pos too high" );
+        OSL_ENSURE( rBound.endPos >= nPos, "end pos too low" );
     }
     else
     {
@@ -1713,8 +1713,8 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
     }
 
     // ask core for position
-    DBG_ASSERT( GetFrm() != NULL, "The text frame has vanished!" );
-    DBG_ASSERT( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
+    OSL_ENSURE( GetFrm() != NULL, "The text frame has vanished!" );
+    OSL_ENSURE( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
     const SwTxtFrm* pFrm = static_cast<const SwTxtFrm*>( GetFrm() );
     SwCrsrMoveState aMoveState;
     aMoveState.bPosMatchesBounds = sal_True;
@@ -1874,8 +1874,8 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
     i18n::Boundary aBound;
     sal_Bool bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
 
-    DBG_ASSERT( aBound.startPos >= 0,               "illegal boundary" );
-    DBG_ASSERT( aBound.startPos <= aBound.endPos,   "illegal boundary" );
+    OSL_ENSURE( aBound.startPos >= 0,               "illegal boundary" );
+    OSL_ENSURE( aBound.startPos <= aBound.endPos,   "illegal boundary" );
 
     // return word (if present)
     if ( bWord )
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 36cf5a4..efd6c67 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -99,7 +99,7 @@ SwAccessiblePortionData::SwAccessiblePortionData(
     nBeforePortions( 0 ),
     bLastIsSpecial( sal_False )
 {
-    DBG_ASSERT( pTxtNode != NULL, "Text node is needed!" );
+    OSL_ENSURE( pTxtNode != NULL, "Text node is needed!" );
 
     // reserve some space to reduce memory allocations
     aLineBreaks.reserve( 5 );
@@ -117,10 +117,10 @@ SwAccessiblePortionData::~SwAccessiblePortionData()
 
 void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
 {
-    DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
+    OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
                 "portion exceeds model string!" );
 
-    DBG_ASSERT( !bFinished, "We are already done!" );
+    OSL_ENSURE( !bFinished, "We are already done!" );
 
     // ignore zero-length portions
     if( nLength == 0 )
@@ -147,11 +147,11 @@ void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
 void SwAccessiblePortionData::Special(
     sal_uInt16 nLength, const String& rText, sal_uInt16 nType)
 {
-    DBG_ASSERT( nModelPosition >= 0, "illegal position" );
-    DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
+    OSL_ENSURE( nModelPosition >= 0, "illegal position" );
+    OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
                 "portion exceeds model string!" );
 
-    DBG_ASSERT( !bFinished, "We are already done!" );
+    OSL_ENSURE( !bFinished, "We are already done!" );
 
     // construct string with representation; either directly from
     // rText, or use resources for special case portions
@@ -219,23 +219,23 @@ void SwAccessiblePortionData::Special(
 
 void SwAccessiblePortionData::LineBreak()
 {
-    DBG_ASSERT( !bFinished, "We are already done!" );
+    OSL_ENSURE( !bFinished, "We are already done!" );
 
     aLineBreaks.push_back( aBuffer.getLength() );
 }
 
 void SwAccessiblePortionData::Skip(sal_uInt16 nLength)
 {
-    DBG_ASSERT( !bFinished, "We are already done!" );
-    DBG_ASSERT( aModelPositions.empty(), "Never Skip() after portions" );
-    DBG_ASSERT( nLength <= pTxtNode->GetTxt().Len(), "skip exceeds model string!" );
+    OSL_ENSURE( !bFinished, "We are already done!" );
+    OSL_ENSURE( aModelPositions.empty(), "Never Skip() after portions" );
+    OSL_ENSURE( nLength <= pTxtNode->GetTxt().Len(), "skip exceeds model string!" );
 
     nModelPosition += nLength;
 }
 
 void SwAccessiblePortionData::Finish()
 {
-    DBG_ASSERT( !bFinished, "We are already done!" );
+    OSL_ENSURE( !bFinished, "We are already done!" );
 
     // include terminator values: always include two 'last character'
     // markers in the position arrays to make sure we always find one
@@ -253,7 +253,7 @@ void SwAccessiblePortionData::Finish()
 sal_Bool SwAccessiblePortionData::IsPortionAttrSet(
     size_t nPortionNo, sal_uInt8 nAttr ) const
 {
-    DBG_ASSERT( nPortionNo < aPortionAttrs.size(),
+    OSL_ENSURE( nPortionNo < aPortionAttrs.size(),
                 "Illegal portion number" );
     return (aPortionAttrs[nPortionNo] & nAttr) != 0;
 }
@@ -300,7 +300,7 @@ sal_Bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const
 
 const OUString& SwAccessiblePortionData::GetAccessibleString() const
 {
-    DBG_ASSERT( bFinished, "Shouldn't call this before we are done!" );
+    OSL_ENSURE( bFinished, "Shouldn't call this before we are done!" );
 
     return sAccessibleString;
 }
@@ -351,7 +351,7 @@ void SwAccessiblePortionData::GetBoundaryOfLine( const sal_Int32 nLineNo,
 void SwAccessiblePortionData::GetLastLineBoundary(
     Boundary& rBound ) const
 {
-    DBG_ASSERT( aLineBreaks.size() >= 2, "need min + max value" );
+    OSL_ENSURE( aLineBreaks.size() >= 2, "need min + max value" );
 
     // The last two positions except the two deleimiters are the ones
     // we are looking for, except for empty paragraphs (nBreaks==3)
@@ -361,8 +361,8 @@ void SwAccessiblePortionData::GetLastLineBoundary(
 
 sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
 {
-    DBG_ASSERT( nPos >= 0, "illegal position" );
-    DBG_ASSERT( nPos <= sAccessibleString.getLength(), "illegal position" );
+    OSL_ENSURE( nPos >= 0, "illegal position" );
+    OSL_ENSURE( nPos <= sAccessibleString.getLength(), "illegal position" );
 
     // find the portion number
     size_t nPortionNo = FindBreak( aAccessiblePositions, nPos );
@@ -375,7 +375,7 @@ sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
     if( ! IsSpecialPortion( nPortionNo ) )
     {
         // 'wide' portions have to be of the same width
-        DBG_ASSERT( ( aModelPositions[nPortionNo+1] - nStartPos ) ==
+        OSL_ENSURE( ( aModelPositions[nPortionNo+1] - nStartPos ) ==
                     ( aAccessiblePositions[nPortionNo+1] -
                       aAccessiblePositions[nPortionNo] ),
                     "accesability portion disagrees with text model" );
@@ -385,7 +385,7 @@ sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
     }
     // else: return nStartPos unmodified
 
-    DBG_ASSERT( (nStartPos >= 0) && (nStartPos < USHRT_MAX),
+    OSL_ENSURE( (nStartPos >= 0) && (nStartPos < USHRT_MAX),
                 "How can the SwTxtNode have so many characters?" );
     return static_cast<sal_uInt16>(nStartPos);
 }
@@ -404,11 +404,11 @@ size_t SwAccessiblePortionData::FindBreak(
     const Positions_t& rPositions,
     sal_Int32 nValue ) const
 {
-    DBG_ASSERT( rPositions.size() >= 2, "need min + max value" );
-    DBG_ASSERT( rPositions[0] <= nValue, "need min value" );
-    DBG_ASSERT( rPositions[rPositions.size()-1] >= nValue,
+    OSL_ENSURE( rPositions.size() >= 2, "need min + max value" );
+    OSL_ENSURE( rPositions[0] <= nValue, "need min value" );
+    OSL_ENSURE( rPositions[rPositions.size()-1] >= nValue,
                 "need first terminator value" );
-    DBG_ASSERT( rPositions[rPositions.size()-2] >= nValue,
+    OSL_ENSURE( rPositions[rPositions.size()-2] >= nValue,
                 "need second terminator value" );
 
     size_t nMin = 0;
@@ -418,20 +418,20 @@ size_t SwAccessiblePortionData::FindBreak(
     while( nMin+1 < nMax )
     {
         // check loop invariants
-        DBG_ASSERT( ( (nMin == 0) && (rPositions[nMin] <= nValue) ) ||
+        OSL_ENSURE( ( (nMin == 0) && (rPositions[nMin] <= nValue) ) ||
                     ( (nMin != 0) && (rPositions[nMin] < nValue) ),
                     "minvalue not minimal" );
-        DBG_ASSERT( nValue <= rPositions[nMax], "max value not maximal" );
+        OSL_ENSURE( nValue <= rPositions[nMax], "max value not maximal" );
 
         // get middle (and ensure progress)
         size_t nMiddle = (nMin + nMax)/2;
-        DBG_ASSERT( nMin < nMiddle, "progress?" );
-        DBG_ASSERT( nMiddle < nMax, "progress?" );
+        OSL_ENSURE( nMin < nMiddle, "progress?" );
+        OSL_ENSURE( nMiddle < nMax, "progress?" );
 
         // check array
-        DBG_ASSERT( rPositions[nMin] <= rPositions[nMiddle],
+        OSL_ENSURE( rPositions[nMin] <= rPositions[nMiddle],
                     "garbled positions array" );
-        DBG_ASSERT( rPositions[nMiddle] <= rPositions[nMax],
+        OSL_ENSURE( rPositions[nMiddle] <= rPositions[nMax],
                     "garbled positions array" );
 
         if( nValue > rPositions[nMiddle] )
@@ -441,17 +441,17 @@ size_t SwAccessiblePortionData::FindBreak(
     }
 
     // only two are left; we only need to check which one is the winner
-    DBG_ASSERT( (nMax == nMin) || (nMax == nMin+1), "only two left" );
+    OSL_ENSURE( (nMax == nMin) || (nMax == nMin+1), "only two left" );
     if( (rPositions[nMin] < nValue) && (rPositions[nMin+1] <= nValue) )
         nMin = nMin+1;
 
     // finally, check to see whether the returned value is the 'right' position
-    DBG_ASSERT( rPositions[nMin] <= nValue, "not smaller or equal" );
-    DBG_ASSERT( nValue <= rPositions[nMin+1], "not equal or larger" );
-    DBG_ASSERT( (nMin == 0) || (rPositions[nMin-1] <= nValue),
+    OSL_ENSURE( rPositions[nMin] <= nValue, "not smaller or equal" );
+    OSL_ENSURE( nValue <= rPositions[nMin+1], "not equal or larger" );
+    OSL_ENSURE( (nMin == 0) || (rPositions[nMin-1] <= nValue),
                 "earlier value should have been returned" );
 
-    DBG_ASSERT( nMin < rPositions.size()-1,
+    OSL_ENSURE( nMin < rPositions.size()-1,
                 "shouldn't return last position (due to termintator values)" );
 
     return nMin;
@@ -479,13 +479,13 @@ void SwAccessiblePortionData::GetSentenceBoundary(
     Boundary& rBound,
     sal_Int32 nPos )
 {
-    DBG_ASSERT( nPos >= 0, "illegal position; check before" );
-    DBG_ASSERT( nPos < sAccessibleString.getLength(), "illegal position" );
+    OSL_ENSURE( nPos >= 0, "illegal position; check before" );
+    OSL_ENSURE( nPos < sAccessibleString.getLength(), "illegal position" );
 
     if( pSentences == NULL )
     {
-         DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
-         DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+         OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+         OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
          if( pBreakIt->GetBreakIter().is() )
          {
              pSentences = new Positions_t();
@@ -534,7 +534,7 @@ void SwAccessiblePortionData::GetAttributeBoundary(
     Boundary& rBound,
     sal_Int32 nPos) const
 {
-    DBG_ASSERT( pTxtNode != NULL, "Need SwTxtNode!" );
+    OSL_ENSURE( pTxtNode != NULL, "Need SwTxtNode!" );
 
     // attribute boundaries can only occur on portion boundaries
     FillBoundary( rBound, aAccessiblePositions,
@@ -544,7 +544,7 @@ void SwAccessiblePortionData::GetAttributeBoundary(
 
 sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) const
 {
-    DBG_ASSERT( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
+    OSL_ENSURE( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
 
     // find the portion number
     // #i70538# - consider "empty" model portions - e.g. number portion
@@ -560,7 +560,7 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) cons
     if( (nEndPos - nStartPos) > 1 )
     {
         // 'wide' portions have to be of the same width
-        DBG_ASSERT( ( nEndPos - nStartPos ) ==
+        OSL_ENSURE( ( nEndPos - nStartPos ) ==
                     ( aAccessiblePositions[nPortionNo+1] -
                       aAccessiblePositions[nPortionNo] ),
                     "accesability portion disagrees with text model" );
@@ -570,7 +570,7 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) cons
     }
     // else: return nRet unmodified
 
-    DBG_ASSERT( (nRet >= 0) && (nRet <= sAccessibleString.getLength()),
+    OSL_ENSURE( (nRet >= 0) && (nRet <= sAccessibleString.getLength()),
                 "too long!" );
     return nRet;
 }
@@ -606,10 +606,10 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
             nModelEndPos = nModelPos;
             nModelPos = aModelPositions[nCorePortionNo];
 
-            DBG_ASSERT( nModelPos >= 0, "Can't happen." );
-            DBG_ASSERT( nCorePortionNo >= nBeforePortions, "Can't happen." );
+            OSL_ENSURE( nModelPos >= 0, "Can't happen." );
+            OSL_ENSURE( nCorePortionNo >= nBeforePortions, "Can't happen." );
         }
-        DBG_ASSERT( nModelPos != nModelEndPos,
+        OSL_ENSURE( nModelPos != nModelEndPos,
                     "portion with core-representation expected" );
 
         // if we have anything except plain text, compute nExtend + nRefPos
@@ -637,7 +637,7 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
         else
         {
             // case 3: regular text portion
-            DBG_ASSERT( ( nModelEndPos - nModelPos ) ==
+            OSL_ENSURE( ( nModelEndPos - nModelPos ) ==
                         ( aAccessiblePositions[nPortionNo+1] -
                           aAccessiblePositions[nPortionNo] ),
                         "text portion expected" );
@@ -648,9 +648,9 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
     }
     if( rpPos != NULL )
     {
-        DBG_ASSERT( rpPos == &rPos, "Yes!" );
-        DBG_ASSERT( nRefPos <= nPos, "wrong reference" );
-        DBG_ASSERT( (nExtend == SP_EXTEND_RANGE_NONE) ||
+        OSL_ENSURE( rpPos == &rPos, "Yes!" );
+        OSL_ENSURE( nRefPos <= nPos, "wrong reference" );
+        OSL_ENSURE( (nExtend == SP_EXTEND_RANGE_NONE) ||
                     (nExtend == SP_EXTEND_RANGE_BEFORE) ||
                     (nExtend == SP_EXTEND_RANGE_BEHIND), "need extend" );
 
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 26b1995..85cfd2c 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -64,9 +64,9 @@ SwAccessibleSelectionHelper::~SwAccessibleSelectionHelper()
 
 SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
 {
-    DBG_ASSERT( rContext.GetMap() != NULL, "no map?" );
+    OSL_ENSURE( rContext.GetMap() != NULL, "no map?" );
     ViewShell* pViewShell = rContext.GetMap()->GetShell();
-    DBG_ASSERT( pViewShell != NULL,
+    OSL_ENSURE( pViewShell != NULL,
                 "No view shell? Then what are you looking at?" );
 
     SwFEShell* pFEShell = NULL;
@@ -293,7 +293,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
     if( !aChild.IsValid() )
         throwIndexOutOfBoundsException();
 
-    DBG_ASSERT( rContext.GetMap() != NULL, "We need the map." );
+    OSL_ENSURE( rContext.GetMap() != NULL, "We need the map." );
     Reference< XAccessible > xChild;
     if( aChild.GetSwFrm() )
     {
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index ed9fbad..be54ecd 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -626,8 +626,8 @@ void SwAccessibleTable::FireTableChangeEvent(
 
 const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
 {
-    DBG_ASSERT( nChildIndex >= 0, "Illegal child index." );
-    DBG_ASSERT( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
+    OSL_ENSURE( nChildIndex >= 0, "Illegal child index." );
+    OSL_ENSURE( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
 
     const SwTableBox* pBox = NULL;
 
@@ -644,7 +644,7 @@ const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
         }
     }
 
-    DBG_ASSERT( pBox != NULL, "We need the table box." );
+    OSL_ENSURE( pBox != NULL, "We need the table box." );
     return pBox;
 }
 
@@ -655,7 +655,7 @@ sal_Bool SwAccessibleTable::IsChildSelected( sal_Int32 nChildIndex ) const
     if( pSelBoxes )
     {
         const SwTableBox* pBox = GetTableBox( nChildIndex );
-        DBG_ASSERT( pBox != NULL, "We need the table box." );
+        OSL_ENSURE( pBox != NULL, "We need the table box." );
         bRet = pSelBoxes->Seek_Entry( const_cast<SwTableBox*>( pBox ) );
     }
 
@@ -1417,7 +1417,7 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
 
     // preliminaries: get 'our' table box, and get the cursor shell
     const SwTableBox* pBox = GetTableBox( nChildIndex );
-    DBG_ASSERT( pBox != NULL, "We need the table box." );
+    OSL_ENSURE( pBox != NULL, "We need the table box." );
 
     SwCrsrShell* pCrsrShell = GetCrsrShell();
     if( pCrsrShell == NULL )
@@ -1592,7 +1592,7 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
         return;
 
     const SwTableBox* pBox = GetTableBox( nChildIndex );
-    DBG_ASSERT( pBox != NULL, "We need the table box." );
+    OSL_ENSURE( pBox != NULL, "We need the table box." );
 
     // If we unselect point, then set cursor to mark. If we clear another
     // selected box, then set cursor to point.
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 003045a..c4800b3 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -230,7 +230,7 @@ SwFlyFrm* SwAccessibleTextFrame::getFlyFrm() const
     SwFlyFrm* pFlyFrm = NULL;
 
     const SwFrm* pFrm = GetFrm();
-    DBG_ASSERT( pFrm != NULL, "frame expected" );
+    OSL_ENSURE( pFrm != NULL, "frame expected" );
     if( pFrm->IsFlyFrm() )
     {
         pFlyFrm = static_cast<SwFlyFrm*>( const_cast<SwFrm*>( pFrm ) );
@@ -258,7 +258,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccess
     AccessibleRelationSetHelper* pHelper = new AccessibleRelationSetHelper();
 
     SwFlyFrm* pFlyFrm = getFlyFrm();
-    DBG_ASSERT( pFlyFrm != NULL, "fly frame expected" );
+    OSL_ENSURE( pFlyFrm != NULL, "fly frame expected" );
 
     const SwFlyFrm* pPrevFrm = pFlyFrm->GetPrevLink();
     if( pPrevFrm != NULL )
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index f9e88f5..348b92c 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -86,7 +86,7 @@ void SwClient::SwClientNotify( const SwModify&, const SfxHint& )
 //*************************************************************************
 SwClient::~SwClient()
 {
-    DBG_ASSERT( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
+    OSL_ENSURE( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
     if( pRegisteredIn && pRegisteredIn->GetDepends() )
         // still connected
         pRegisteredIn->Remove( this );
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 243a397..97ba70b 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -45,18 +45,18 @@ const sal_uInt16 nBlockGrowSize = 20;
 
 void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, sal_uLong nSize, sal_uInt16 nCur )
 {
-    DBG_ASSERT( !nSize || nCur < nBlock, "BigPtrArray: CurIndex steht falsch" );
+    OSL_ENSURE( !nSize || nCur < nBlock, "BigPtrArray: CurIndex steht falsch" );
 
     sal_uLong nIdx = 0;
     for( sal_uInt16 nCnt = 0; nCnt < nBlock; ++nCnt, ++ppInf )
     {
         nIdx += (*ppInf)->nElem;
         // Array mit Luecken darf es nicht geben
-        DBG_ASSERT( !nCnt || (*(ppInf-1))->nEnd + 1 == (*ppInf)->nStart,
+        OSL_ENSURE( !nCnt || (*(ppInf-1))->nEnd + 1 == (*ppInf)->nStart,
                     "BigPtrArray: Luecke in der Verwaltung!" );
     }
 
-    DBG_ASSERT( nIdx == nSize, "BigPtrArray: Anzahl ungueltig" );
+    OSL_ENSURE( nIdx == nSize, "BigPtrArray: Anzahl ungueltig" );
 }
 
 #else
@@ -140,7 +140,7 @@ void BigPtrArray::ForEach( sal_uLong nStart, sal_uLong nEnd,
 ElementPtr BigPtrArray::operator[]( sal_uLong idx ) const
 {
     // weil die Funktion eben doch nicht const ist:
-    DBG_ASSERT( idx < nSize, "operator[]: Index aussserhalb" );
+    OSL_ENSURE( idx < nSize, "operator[]: Index aussserhalb" );
     BigPtrArray* pThis = (BigPtrArray*) this;
     sal_uInt16 cur = Index2Block( idx );
     BlockInfo* p = ppInf[ cur ];
@@ -351,7 +351,7 @@ void BigPtrArray::Insert( const ElementPtr& rElem, sal_uLong pos )
     }
     // Nun haben wir einen freien Block am Wickel: eintragen
     pos -= p->nStart;
-    DBG_ASSERT( pos < MAXENTRY, "falsche Pos" );
+    OSL_ENSURE( pos < MAXENTRY, "falsche Pos" );
     if( pos != p->nElem )
     {
         int nCount = p->nElem - sal_uInt16(pos);
@@ -461,7 +461,7 @@ void BigPtrArray::Remove( sal_uLong pos, sal_uLong n )
 void BigPtrArray::Replace( sal_uLong idx, const ElementPtr& rElem)
 {
     // weil die Funktion eben doch nicht const ist:
-    DBG_ASSERT( idx < nSize, "Set: Index aussserhalb" );
+    OSL_ENSURE( idx < nSize, "Set: Index aussserhalb" );
     BigPtrArray* pThis = (BigPtrArray*) this;
     sal_uInt16 cur = Index2Block( idx );
     BlockInfo* p = ppInf[ cur ];
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 1f0a5aa..f3c964f 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -67,7 +67,7 @@ SwBreakIt::SwBreakIt(
       aLast( LANGUAGE_DONTKNOW ),
       aForbiddenLang( LANGUAGE_DONTKNOW)
 {
-    DBG_ASSERT( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
+    OSL_ENSURE( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
 }
 
 SwBreakIt::~SwBreakIt()
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index f9e2503..2d55c66 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -433,7 +433,7 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
         {
             aWordLst.Remove( nPos - 1 );
             sal_uInt16 nLRUPos = aLRULst.GetPos( (void*)pCurrent );
-            DBG_ASSERT(nLRUPos < USHRT_MAX, "word not found in LRU list" );
+            OSL_ENSURE(nLRUPos < USHRT_MAX, "word not found in LRU list" );
             aLRULst.Remove( nLRUPos );
             delete pCurrent;
         }
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index e5d8fd0..a3e96f0 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -662,7 +662,7 @@ const SwPrintData & SwDoc::getPrintData() const
         // the respective config item is implememted by SwPrintOptions which
         // is also derived from SwPrintData
         const SwDocShell *pDocSh = GetDocShell();
-        DBG_ASSERT( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
+        OSL_ENSURE( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
         bool bWeb = 0 != dynamic_cast< const SwWebDocShell * >(pDocSh);
         SwPrintOptions aPrintOptions( bWeb );
         *pThis->pPrtData = aPrintOptions;
@@ -1121,7 +1121,7 @@ bool lcl_GetPostIts(
     bool bHasPostIts = false;
 
     SwFieldType* pFldType = pIDFA->GetSysFldType( RES_POSTITFLD );
-    DBG_ASSERT( pFldType, "kein PostItType ? ");
+    OSL_ENSURE( pFldType, "kein PostItType ? ");
 
     if( pFldType->GetDepends() )
     {
@@ -1158,7 +1158,7 @@ static void lcl_FormatPostIt(
 {
     static char const sTmp[] = " : ";
 
-    DBG_ASSERT( ViewShell::GetShellRes(), "missing ShellRes" );
+    OSL_ENSURE( ViewShell::GetShellRes(), "missing ShellRes" );
 
     if (bNewPage)
     {
@@ -1272,7 +1272,7 @@ void SwDoc::CalculatePagesForPrinting(
         }
     }
 
-    DBG_ASSERT( nFirstPageNo, "first page not found!  Should not happen!" );
+    OSL_ENSURE( nFirstPageNo, "first page not found!  Should not happen!" );
     if (nFirstPageNo)
     {
 // HACK: Hier muss von der MultiSelection noch eine akzeptable Moeglichkeit
@@ -1380,7 +1380,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
 {
 
     sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 );
-    DBG_ASSERT(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
+    OSL_ENSURE(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
             "print post-its without post-it data?" );
     const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0;
     if (nPostItMode != POSTITS_NONE && nPostItCount > 0)
@@ -1466,14 +1466,14 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
             const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower();
             while( pPageFrm && nPageNum < nPostItDocPageCount )
             {
-                DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+                OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
                 ++nPageNum;
                 rData.GetPagesToPrint().push_back( 0 );  // a page number of 0 indicates this page is from the post-it doc
-                DBG_ASSERT( pPageFrm, "pPageFrm is NULL!" );
+                OSL_ENSURE( pPageFrm, "pPageFrm is NULL!" );
                 rData.GetPostItStartFrames().push_back( pPageFrm );
                 pPageFrm = (SwPageFrm*)pPageFrm->GetNext();
             }
-            DBG_ASSERT( nPageNum == nPostItDocPageCount, "unexpected number of pages" );
+            OSL_ENSURE( nPageNum == nPostItDocPageCount, "unexpected number of pages" );
         }    
         else if (nPostItMode == POSTITS_ENDPAGE)
         {
@@ -1487,12 +1487,12 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
             const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower();
             while( pPageFrm && sal_Int32(aAllPostItStartFrames.size()) < nPostItDocPageCount )
             {
-                DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+                OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
                 ++nPostItPageNum;
                 aAllPostItStartFrames.push_back( pPageFrm );
                 pPageFrm = (SwPageFrm*)pPageFrm->GetNext();
             }
-            DBG_ASSERT( sal_Int32(aAllPostItStartFrames.size()) == nPostItDocPageCount, 
+            OSL_ENSURE( sal_Int32(aAllPostItStartFrames.size()) == nPostItDocPageCount,
                     "unexpected number of frames; does not match number of pages" );
             
             // get a map that holds all post-it frames to be printed for a 
@@ -1504,13 +1504,13 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
                 const sal_Int32 nFrames = aIt->second - nLastStartPageNum;
                 const sal_Int32 nFirstStartPageNum = aIt == aPostItLastStartPageNum.begin() ?
                         1 : aIt->second - nFrames + 1;
-                DBG_ASSERT( 1 <= nFirstStartPageNum && nFirstStartPageNum <= nPostItDocPageCount,
+                OSL_ENSURE( 1 <= nFirstStartPageNum && nFirstStartPageNum <= nPostItDocPageCount,
                         "page number for first frame out of range" );
                 std::vector<  const SwPageFrm * > aStartFrames;
                 for (sal_Int32 i = 0; i < nFrames; ++i)
                 {
                     const sal_Int32 nIdx = nFirstStartPageNum - 1 + i;   // -1 because lowest page num is 1
-                    DBG_ASSERT( 0 <= nIdx && nIdx < sal_Int32(aAllPostItStartFrames.size()), 
+                    OSL_ENSURE( 0 <= nIdx && nIdx < sal_Int32(aAllPostItStartFrames.size()),
                             "index out of range" );
                     aStartFrames.push_back( aAllPostItStartFrames[ nIdx ] );
                 }
@@ -1601,7 +1601,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
     const SwPageFrm *pPageFrm  = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
     while( pPageFrm && nPageNum < nDocPageCount )
     {
-        DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+        OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
         ++nPageNum;
         rValidPagesSet.insert( nPageNum );
         rValidStartFrms[ nPageNum ] = pPageFrm;
@@ -1609,7 +1609,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
 
         rPrinterPaperTrays[ nPageNum ] = lcl_GetPaperBin( pStPage );
     }
-    DBG_ASSERT( nPageNum == nDocPageCount, "unexpected number of pages" );
+    OSL_ENSURE( nPageNum == nDocPageCount, "unexpected number of pages" );
 
     // properties to take into account when calcualting the set of pages
     // Note: here bPrintLeftPages and bPrintRightPages refer to the (virtual) resulting pages
@@ -1695,7 +1695,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
         nSPg = nSPg + nStep;
         nEPg = nEPg - nStep;
     }
-    DBG_ASSERT( size_t(nCntPage) == rPagePairs.size(), "size mismatch for number of page pairs" );
+    OSL_ENSURE( size_t(nCntPage) == rPagePairs.size(), "size mismatch for number of page pairs" );
 
     // luckily prospect printing does not make use of post-its so far, 
     // thus we are done here.
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 37a0b2c..841e053 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1409,13 +1409,13 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
     sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
     DateTime aTimeStamp;
     SwDocShell *pDocShell(rDoc.GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
             pDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+        OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
 
         if( bUseDocInfo && xDocProps.is() ) {
             String aTmp( 1 == xDocProps->getEditingCycles()
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index f9ec5c2..ea0eada 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -176,7 +176,7 @@ SwCharFmt* SwEndNoteInfo::GetCharFmt(SwDoc &rDoc) const
 
 void SwEndNoteInfo::SetCharFmt( SwCharFmt* pChFmt )
 {
-    DBG_ASSERT(pChFmt, "kein CharFmt?");
+    OSL_ENSURE(pChFmt, "kein CharFmt?");
     pChFmt->Add( &((SwClient&)aCharFmtDep) );
 }
 
@@ -193,7 +193,7 @@ SwCharFmt* SwEndNoteInfo::GetAnchorCharFmt(SwDoc &rDoc) const
 
 void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt )
 {
-    DBG_ASSERT(pChFmt, "kein CharFmt?");
+    OSL_ENSURE(pChFmt, "kein CharFmt?");
     pChFmt->Add( &((SwClient&)aAnchorCharFmtDep) );
 }
 
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index a0fadbc..2d6dee0 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -239,7 +239,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
                         uno::UNO_QUERY_THROW);
                     uno::Reference<document::XDocumentProperties> xDocProps(
                         xDPS->getDocumentProperties());
-                    DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+                    OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
                     // the GlobalDoc is the template
                     xDocProps->setTemplateName(aEmptyStr);
                     ::util::DateTime uDT(aTmplDate.Get100Sec(),
@@ -587,7 +587,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
                         uno::UNO_QUERY_THROW);
                     uno::Reference<document::XDocumentProperties> xDocProps(
                         xDPS->getDocumentProperties());
-                    DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+                    OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
                     // the GlobalDoc is the template
                     xDocProps->setTemplateName(aEmptyStr);
                     ::util::DateTime uDT(aTmplDate.Get100Sec(),
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 84f5a48..60bdf00 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -52,8 +52,8 @@ using namespace ::com::sun::star;
 static void lcl_copyDocumentProperties(
         uno::Reference<document::XDocumentProperties> i_xSource,
         uno::Reference<document::XDocumentProperties> i_xTarget) {
-    DBG_ASSERT(i_xSource.is(), "null reference");
-    DBG_ASSERT(i_xTarget.is(), "null reference");
+    OSL_ENSURE(i_xSource.is(), "null reference");
+    OSL_ENSURE(i_xTarget.is(), "null reference");
 
     i_xTarget->setAuthor(i_xSource->getAuthor());
     i_xTarget->setGenerator(i_xSource->getGenerator());
@@ -130,8 +130,8 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
             // entry document.
             // To be able to do this, we copy the document properties of the
             // target document to the glossary document
-//            DBG_ASSERT(GetDocShell(), "no SwDocShell"); // may be clipboard!
-            DBG_ASSERT(pGDoc->GetDocShell(), "no SwDocShell at glossary");
+//            OSL_ENSURE(GetDocShell(), "no SwDocShell"); // may be clipboard!
+            OSL_ENSURE(pGDoc->GetDocShell(), "no SwDocShell at glossary");
             if (GetDocShell() && pGDoc->GetDocShell()) {
                 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
                     GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 322eca0..15cd1b3 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1189,7 +1189,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
                 break;
             }
         }
-        DBG_ASSERT( pColl, "no text collection found" );
+        OSL_ENSURE( pColl, "no text collection found" );
     }
 
     if( !pColl )
@@ -1551,7 +1551,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
                 break;
             }
         }
-        DBG_ASSERT( pColl, "no text collection found" );
+        OSL_ENSURE( pColl, "no text collection found" );
     }
 
     if( !pColl )
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index d722fbb..5d5ffd1 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -71,19 +71,19 @@ TYPEINIT1(SwRedlineHint, SfxHint);
         SwPosition aComparePos( *pPos );
         aComparePos.nContent.Assign(
             aComparePos.nNode.GetNode().GetCntntNode(), 0 );
-        DBG_ASSERT( pPos->nContent.GetIdxReg() ==
+        OSL_ENSURE( pPos->nContent.GetIdxReg() ==
                     aComparePos.nContent.GetIdxReg(),
                     _ERROR_PREFIX "illegal position" );
 
         SwTxtNode* pTxtNode = pPos->nNode.GetNode().GetTxtNode();
         if( pTxtNode == NULL )
         {
-            DBG_ASSERT( pPos->nContent == 0,
+            OSL_ENSURE( pPos->nContent == 0,
                         _ERROR_PREFIX "non-text-node with content" );
         }
         else
         {
-            DBG_ASSERT( pPos->nContent >= 0  &&
+            OSL_ENSURE( pPos->nContent >= 0  &&
                         pPos->nContent <= pTxtNode->Len(),
                         _ERROR_PREFIX "index behind text" );
         }
@@ -91,7 +91,7 @@ TYPEINIT1(SwRedlineHint, SfxHint);
 
     void lcl_CheckPam( const SwPaM* pPam )
     {
-        DBG_ASSERT( pPam != NULL, _ERROR_PREFIX "illegal argument" );
+        OSL_ENSURE( pPam != NULL, _ERROR_PREFIX "illegal argument" );
         lcl_CheckPosition( pPam->GetPoint() );
         lcl_CheckPosition( pPam->GetMark() );
     }
@@ -109,7 +109,7 @@ TYPEINIT1(SwRedlineHint, SfxHint);
         for( sal_uInt16 j = 0; j < rTbl.Count(); ++j )
         {
             // check for empty redlines
-            DBG_ASSERT( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
+            OSL_ENSURE( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
                         ( rTbl[j]->GetContentIdx() != NULL ),
                         _ERROR_PREFIX "empty redline" );
          }
@@ -121,11 +121,11 @@ TYPEINIT1(SwRedlineHint, SfxHint);
             const SwRedline* pCurrent = rTbl[ n ];
 
             // check redline sorting
-            DBG_ASSERT( *pPrev->Start() <= *pCurrent->Start(),
+            OSL_ENSURE( *pPrev->Start() <= *pCurrent->Start(),
                         _ERROR_PREFIX "not sorted correctly" );
 
             // check for overlapping redlines
-            DBG_ASSERT( *pPrev->End() <= *pCurrent->Start(),
+            OSL_ENSURE( *pPrev->End() <= *pCurrent->Start(),
                         _ERROR_PREFIX "overlapping redlines" );
         }
     }
@@ -336,7 +336,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
             {
                 if( pStt->nContent > 0 )
                 {
-                    DBG_ASSERT( false, "Redline start: non-text-node with content" );
+                    OSL_ENSURE( false, "Redline start: non-text-node with content" );
                     pStt->nContent = 0;
                 }
             }
@@ -344,7 +344,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
             {
                 if( pStt->nContent > pTxtNode->Len() )
                 {
-                    DBG_ASSERT( false, "Redline start: index behind text" );
+                    OSL_ENSURE( false, "Redline start: index behind text" );
                     pStt->nContent = pTxtNode->Len();
                 }
             }
@@ -353,7 +353,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
             {
                 if( pEnd->nContent > 0 )
                 {
-                    DBG_ASSERT( false, "Redline end: non-text-node with content" );
+                    OSL_ENSURE( false, "Redline end: non-text-node with content" );
                     pEnd->nContent = 0;
                 }
             }
@@ -361,7 +361,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
             {
                 if( pEnd->nContent > pTxtNode->Len() )
                 {
-                    DBG_ASSERT( false, "Redline end: index behind text" );
+                    OSL_ENSURE( false, "Redline end: index behind text" );
                     pEnd->nContent = pTxtNode->Len();
                 }
             }
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 81b586b..1b6013a 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -788,7 +788,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
 
     SwDoc* pDoc = (SwDoc*)pSectNd->GetDoc();
 
-    DBG_ASSERT(pDoc != NULL, "Where is the document?");
+    OSL_ENSURE(pDoc != NULL, "Where is the document?");
 
     if(pAttr && pDoc && GetFmt())
         pDoc->ChgFmt(*GetFmt(), *pAttr);
diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index 322d286..682c8c9 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -70,28 +70,28 @@ bool SwDoc::isXForms() const
 
 Reference<XInterface> lcl_createInstance( const sal_Char* pServiceName )
 {
-    DBG_ASSERT( pServiceName != NULL, "no service name" );
+    OSL_ENSURE( pServiceName != NULL, "no service name" );
     return utl::getProcessServiceFactory()->createInstance(
         OUString::createFromAscii( pServiceName  ) );
 }
 
 void SwDoc::initXForms( bool bCreateDefaultModel )
 {
-    DBG_ASSERT( ! isXForms(), "please initialize only once" );
+    OSL_ENSURE( ! isXForms(), "please initialize only once" );
 
     try
     {
         // create XForms components
         xXForms.set( lcl_createInstance( "com.sun.star.xforms.XForms" ),
                     UNO_QUERY );
-        DBG_ASSERT( xXForms.is(), "can't create XForms container" );
+        OSL_ENSURE( xXForms.is(), "can't create XForms container" );
 
         // change our module identifier, to be able to have a dedicated UI
         Reference< XModule > xModule;
         SwDocShell* pShell( GetDocShell() );
         if ( pShell )
             xModule = xModule.query( pShell->GetModel() );
-        DBG_ASSERT( xModule.is(), "SwDoc::initXForms: no XModule at the document!" );
+        OSL_ENSURE( xModule.is(), "SwDoc::initXForms: no XModule at the document!" );
         if ( xModule.is() )
             xModule->setIdentifier( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xforms.XMLFormDocument" ) ) );
 
@@ -102,7 +102,7 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
             Reference<XModel> xModel( 
                 lcl_createInstance( "com.sun.star.xforms.Model" ),
                 UNO_QUERY );
-            DBG_ASSERT( xModel.is(), "no model?" );
+            OSL_ENSURE( xModel.is(), "no model?" );
             if( xModel.is() )
             {
                 xModel->setID( sName );
@@ -112,10 +112,10 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
                 xModel->initialize();
                 xXForms->insertByName( sName, makeAny( xModel ) );
             }
-            DBG_ASSERT( xXForms->hasElements(), "can't create XForms model" );
+            OSL_ENSURE( xXForms->hasElements(), "can't create XForms model" );
         }
 
-        DBG_ASSERT( isXForms(), "initialization failed" );
+        OSL_ENSURE( isXForms(), "initialization failed" );
     }
     catch( const Exception& )
     {
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 7826c44..57b5b18 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -1141,7 +1141,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                 // (text) node, and thus we set bStartisTxtNode to true. This
                 // will ensure that this node will be deleted during Undo
                 // using JoinNext.
-                DBG_ASSERT( !bStartIsTxtNode, "Oops, undo may be instable now." );
+                OSL_ENSURE( !bStartIsTxtNode, "Oops, undo may be instable now." );
                 bStartIsTxtNode = sal_True;
             }
 
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 05597e6..28eb833 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1898,9 +1898,9 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
         return;
 
     // when inserting into the source range, nothing need to be done
-    DBG_ASSERT( &aRg.aStart.GetNodes() == this,
+    OSL_ENSURE( &aRg.aStart.GetNodes() == this,
                 "aRg should use thisnodes array" );
-    DBG_ASSERT( &aRg.aStart.GetNodes() == &aRg.aEnd.GetNodes(),
+    OSL_ENSURE( &aRg.aStart.GetNodes() == &aRg.aEnd.GetNodes(),
                "Range across different nodes arrays? You deserve punishment!");
     if( &rIndex.GetNodes() == &aRg.aStart.GetNodes() &&
         rIndex.GetIndex() >= aRg.aStart.GetIndex() &&
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index fece09b..dcdc438 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1305,9 +1305,9 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
         sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
         if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
         {
-            DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
-            DBG_ASSERT( rLastPortions.size() > 0, "rLastPortions should not be empty here" );
-            DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+            OSL_ENSURE( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
+            OSL_ENSURE( rLastPortions.size() > 0, "rLastPortions should not be empty here" );
+            OSL_ENSURE( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
 
             //the simple case: the same number of elements on both sides
             //each changed element has to be applied to the corresponding source element
@@ -1330,7 +1330,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
                     }
                     else
                     {
-                        DBG_ASSERT( 0, "ApplyChangedSentence: iterator positions broken" );
+                        OSL_ENSURE( 0, "ApplyChangedSentence: iterator positions broken" );
                         break;
                     }
                 }
@@ -1372,7 +1372,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
         }
         else
         {
-            DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+            OSL_ENSURE( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
 
             //select the complete sentence
             SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 04d2bdb..036b20e 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -328,7 +328,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
 
     // the current position
     //    const SwPosition* pCurrentPos = GetCrsr()->GetPoint();
-    DBG_ASSERT( pCurrentPos != NULL, "Strange, we have no position!" );
+    OSL_ENSURE( pCurrentPos != NULL, "Strange, we have no position!" );
     const SwNode& rCurrentNode = pCurrentPos->nNode.GetNode();
 
 
@@ -361,9 +361,9 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
     // Now, pInnermostNode is NULL or the innermost section or table node.
     if( (pInnermostNode != NULL) && !pInnermostNode->IsProtect() )
     {
-        DBG_ASSERT( pInnermostNode->IsTableNode() ||
+        OSL_ENSURE( pInnermostNode->IsTableNode() ||
                     pInnermostNode->IsSectionNode(), "wrong node found" );
-        DBG_ASSERT( ( pInnermostNode->GetIndex() <= rCurrentNode.GetIndex() )&&
+        OSL_ENSURE( ( pInnermostNode->GetIndex() <= rCurrentNode.GetIndex() )&&
                     ( pInnermostNode->EndOfSectionNode()->GetIndex() >=
                       rCurrentNode.GetIndex() ), "wrong node found" );
 
@@ -403,7 +403,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
     }
 
 
-    DBG_ASSERT( ( pReturn == NULL ) || pReturn->IsStartNode() ||
+    OSL_ENSURE( ( pReturn == NULL ) || pReturn->IsStartNode() ||
                                        pReturn->IsEndNode(),
                 "SpecialInsertNode failed" );
     return pReturn;
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 92763af..359d010 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -153,7 +153,7 @@ void	SwAuthorityFieldType::RemoveField(long nHandle)
         }
     }
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT(bRemoved, "Field unknown" );
+    OSL_ENSURE(bRemoved, "Field unknown" );
 #endif
 }
 
@@ -203,7 +203,7 @@ sal_Bool SwAuthorityFieldType::AddField(long nHandle)
             break;
         }
     }
-    DBG_ASSERT(bRet, "::AddField(long) failed");
+    OSL_ENSURE(bRet, "::AddField(long) failed");
     return bRet;
 }
 
@@ -547,7 +547,7 @@ const SwTOXSortKey*  SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
     SwTOXSortKey* pRet = 0;
     if(m_pSortKeyArr->Count() > nIdx)
         pRet = (*m_pSortKeyArr)[nIdx];
-    DBG_ASSERT(pRet, "Sort key not found");
+    OSL_ENSURE(pRet, "Sort key not found");
     return pRet;
 }
 
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 0f86411..ea83304 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -618,13 +618,13 @@ String SwTemplNameFieldType::Expand(sal_uLong nFmt) const
 
     String aRet;
     SwDocShell *pDocShell(pDoc->GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
             pDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+        OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
 
         if( FF_UI_NAME == nFmt )
             aRet = xDocProps->getTemplateName();
@@ -908,14 +908,14 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
     String aStr;
     const LocaleDataWrapper *pAppLocalData = 0, *pLocalData = 0;
     SwDocShell *pDocShell(GetDoc()->GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     if (!pDocShell) { return aStr; }
 
     uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
         pDocShell->GetModel(), uno::UNO_QUERY_THROW);
     uno::Reference<document::XDocumentProperties> xDocProps(
         xDPS->getDocumentProperties());
-    DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+    OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
 
     sal_uInt16 nExtSub = nSub & 0xff00;
     nSub &= 0xff;	// ExtendedSubTypes nicht beachten
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 077b66d..07e9bdd 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -870,7 +870,7 @@ void SwSetExpField::SetSubType(sal_uInt16 nSub)
     ((SwSetExpFieldType*)GetTyp())->SetType(nSub & 0xff);
     nSubType = nSub & 0xff00;
 
-    DBG_ASSERT( (nSub & 0xff) != 3, "SubType ist illegal!" );
+    OSL_ENSURE( (nSub & 0xff) != 3, "SubType ist illegal!" );
 }
 
 sal_uInt16 SwSetExpField::GetSubType() const
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index d41d345..c00ba76 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -105,7 +105,7 @@ String SwMacroField::GetLibName() const
         return aMacro.Copy(0, nPos );
     }
 
-    DBG_ASSERT(0, "Kein Macroname vorhanden");
+    OSL_FAIL("Kein Macroname vorhanden");
     return aEmptyStr;
 }
 
@@ -128,7 +128,7 @@ String SwMacroField::GetMacroName() const
         }
     }
 
-    DBG_ASSERT(0, "Kein Macroname vorhanden");
+    OSL_FAIL("Kein Macroname vorhanden");
     return aEmptyStr;
 }
 
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 0a5310f..df65a56 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -295,9 +295,9 @@ SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
 bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
                                         sal_uInt8 ) const
 {
-    DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+    OSL_ENSURE(ISA(SfxByteItem),"Put/QueryValue should be removed!");
     sal_Int16 nRet = GetValue();
-    DBG_ASSERT( 0 <= nRet && nRet <= 100, "value out of range" );
+    OSL_ENSURE( 0 <= nRet && nRet <= 100, "value out of range" );
     rVal <<= nRet;
     return true;
 }
@@ -306,7 +306,7 @@ bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
                                         sal_uInt8 )
 {
     //temporary conversion until this is a SfxInt16Item!
-    DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+    OSL_ENSURE(ISA(SfxByteItem),"Put/QueryValue should be removed!");
     sal_Int16 nVal = 0;
     if(!(rVal >>= nVal) || nVal < -100 || nVal > 100)
         return false;
@@ -317,7 +317,7 @@ bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
         nVal = ( ( nVal * 128 ) - (99/2) ) / 100;
         nVal += 128;
     }
-    DBG_ASSERT( 0 <= nVal && nVal <= 100, "value out of range" );
+    OSL_ENSURE( 0 <= nVal && nVal <= 100, "value out of range" );
     SetValue(static_cast<sal_uInt8>(nVal));
     return true;
 }
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 2fcffc1..aece9b7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -475,7 +475,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
     }
     else
         nRet = 1;
-    DBG_ASSERTWARNING( nRet, "Grafik kann nicht eingeswapt werden" );
+    OSL_ENSURE( nRet, "Grafik kann nicht eingeswapt werden" );
 
     if( nRet )
     {
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 791459a..f5bd2ae 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2252,17 +2252,17 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             rVal.setValue( &bDisplayGrid, ::getBooleanCppuType() );
             break;
         case MID_GRID_BASEHEIGHT:
-            DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+            OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
             rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseHeight);
             break;
         case MID_GRID_BASEWIDTH:
-            DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+            OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
             rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseWidth);
             break;
         case MID_GRID_RUBYHEIGHT:
-            DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+            OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
             rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nRubyHeight);
             break;
@@ -2338,7 +2338,7 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         case MID_GRID_BASEWIDTH:
         case MID_GRID_RUBYHEIGHT:
         {
-            DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+            OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
             sal_Int32 nTmp = 0;
             bRet = (rVal >>= nTmp);
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 04edc6c..e5c5e13 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1902,7 +1902,7 @@ void SwRootFrm::UnoRemoveAllActions()
             // Recursives calls to <::EndAction()> are not allowed.
             if ( !pSh->IsInEndAction() )
             {
-                DBG_ASSERT(!pSh->GetRestoreActions(), "Restore action count is already set!");
+                OSL_ENSURE(!pSh->GetRestoreActions(), "Restore action count is already set!");
                 sal_Bool bCrsr = pSh->ISA( SwCrsrShell );
                 sal_Bool bFE = pSh->ISA( SwFEShell );
                 sal_uInt16 nRestore = 0;
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 7a8e977..394c691 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -288,7 +288,7 @@ SwCntntNode *SwOLENode::SplitCntntNode( const SwPosition & )
 
 sal_Bool SwOLENode::RestorePersistentData()
 {
-    DBG_ASSERT( aOLEObj.GetOleRef().is(), "No object to restore!" );
+    OSL_ENSURE( aOLEObj.GetOleRef().is(), "No object to restore!" );
     if ( aOLEObj.xOLERef.is() )
     {
         // Falls bereits eine SvPersist-Instanz existiert, nehmen wir diese
@@ -306,7 +306,7 @@ sal_Bool SwOLENode::RestorePersistentData()
         if ( xChild.is() )
             xChild->setParent( p->GetModel() );
 
-        DBG_ASSERT( aOLEObj.aName.Len(), "No object name!" );
+        OSL_ENSURE( aOLEObj.aName.Len(), "No object name!" );
         ::rtl::OUString aObjName;
         if ( !p->GetEmbeddedObjectContainer().InsertEmbeddedObject( aOLEObj.xOLERef.GetObject(), aObjName ) )
         {
@@ -334,7 +334,7 @@ sal_Bool SwOLENode::SavePersistentData()
 
 #if OSL_DEBUG_LEVEL > 0
         SfxObjectShell* p = GetDoc()->GetPersist();
-        DBG_ASSERT( p, "No document!" );
+        OSL_ENSURE( p, "No document!" );
         if( p )
         {
             comphelper::EmbeddedObjectContainer& rCnt = p->GetEmbeddedObjectContainer();
@@ -679,7 +679,7 @@ SwOLEObj::~SwOLEObj()
 
 #if OSL_DEBUG_LEVEL > 0
         SfxObjectShell* p = pOLENd->GetDoc()->GetPersist();
-        DBG_ASSERT( p, "No document!" );
+        OSL_ENSURE( p, "No document!" );
         if( p )
         {
             comphelper::EmbeddedObjectContainer& rCnt = p->GetEmbeddedObjectContainer();
@@ -931,7 +931,7 @@ void SwOLELRUCache::Load()
     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() && pValues->hasValue() )
     {
         sal_Int32 nVal = 0;
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index bc8f4fc..744b389 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -204,7 +204,7 @@ sal_uLong SwXMLTextBlocks::Delete( sal_uInt16 n )
 
 sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, const String& )
 {
-    DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+    OSL_ENSURE( xBlkRoot.is(), "No storage set" );
     if(!xBlkRoot.is())
         return 0;
     String aOldName (aNames[ nIdx ]->aPackageName);
@@ -255,7 +255,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
     String sDestShortName( GetPackageName (nIndex) );
     sal_uInt16 nIdx = 0;
 
-    DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+    OSL_ENSURE( xBlkRoot.is(), "No storage set" );
     if(!xBlkRoot.is())
         return ERR_SWG_WRITE_ERROR;
 
@@ -298,7 +298,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
 
 sal_uLong SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rPackageName )
 {
-    DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+    OSL_ENSURE( xBlkRoot.is(), "No storage set" );
     if(!xBlkRoot.is())
         return 0;
     GetIndex ( rShort );
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 0b16cbd..004b984 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -207,7 +207,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
             OUString sStreamName(RTL_CONSTASCII_USTRINGPARAM("atevent.xml"));
             uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement(
                 sStreamName, embed::ElementModes::READ );
-            DBG_ASSERT(xDocStream.is(), "Can't create stream");
+            OSL_ENSURE(xDocStream.is(), "Can't create stream");
             if ( xDocStream.is() )
             {
                 uno::Reference<io::XInputStream> xInputStream = xDocStream->getInputStream();
@@ -229,7 +229,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
                     uno::Reference< xml::sax::XParser > xParser(
                         xServiceFactory->createInstance(sParserService),
                         UNO_QUERY );
-                    DBG_ASSERT( xParser.is(), "Can't create parser" );
+                    OSL_ENSURE( xParser.is(), "Can't create parser" );
                     if( xParser.is() )
                     {
                         // create descriptor and reference to it. Either
@@ -249,7 +249,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
                             xServiceFactory->createInstanceWithArguments(
                                 sFilterComponent, aFilterArguments),
                             UNO_QUERY );
-                        DBG_ASSERT( xFilter.is(),
+                        OSL_ENSURE( xFilter.is(),
                                     "can't instantiate atevents filter");
                         if ( xFilter.is() )
                         {
@@ -416,7 +416,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
 
        uno::Reference < XInterface > xWriter (xServiceFactory->createInstance(
            OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))));
-       DBG_ASSERT(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
+       OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
     sal_uLong nRes = 0;
 
     try
@@ -548,7 +548,7 @@ void SwXMLTextBlocks::WriteInfo( void )
     {
         uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
             comphelper::getProcessServiceFactory();
-        DBG_ASSERT( xServiceFactory.is(),
+        OSL_ENSURE( xServiceFactory.is(),
                 "XMLReader::Read: got no service manager" );
         if( !xServiceFactory.is() )
         {
@@ -557,7 +557,7 @@ void SwXMLTextBlocks::WriteInfo( void )
 
         uno::Reference < XInterface > xWriter (xServiceFactory->createInstance(
             OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))));
-        DBG_ASSERT(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
+        OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
         OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( XMLN_BLOCKLIST ) );
 
         /*
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index fba4566..ba19cec 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1343,7 +1343,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals,
 
 const PropertyValues & SwTxtFormatInfo::GetHyphValues() const
 {
-    DBG_ASSERT( 2 == aHyphVals.getLength(),
+    OSL_ENSURE( 2 == aHyphVals.getLength(),
             "hyphenation values not yet initialized" );
     return aHyphVals;
 }
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index dd50932..9bc25b2 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -467,7 +467,7 @@ void SwWrongList::JoinList( SwWrongList* pNext, xub_StrLen nInsertPos )
 {
     if (pNext)
     {
-        DBG_ASSERT( GetWrongListType() == pNext->GetWrongListType(), "type mismatch with next list" );
+        OSL_ENSURE( GetWrongListType() == pNext->GetWrongListType(), "type mismatch with next list" );
     }
     if( pNext )
     {
@@ -503,7 +503,7 @@ void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uIn
 {
     if (pSubList)
     {
-        DBG_ASSERT( GetWrongListType() == pSubList->GetWrongListType(), "type mismatch with sub list" );
+        OSL_ENSURE( GetWrongListType() == pSubList->GetWrongListType(), "type mismatch with sub list" );
     }
     std::vector<SwWrongArea>::iterator i = maList.begin();
     if ( nWhere >= maList.size() )
diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx
index 6192fe8..0dd7661 100644
--- a/sw/source/core/tox/toxhlp.cxx
+++ b/sw/source/core/tox/toxhlp.cxx
@@ -66,7 +66,7 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "IndexEntrySupplierWrapper: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
 }
@@ -92,7 +92,7 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt,
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "getIndexKey: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
     return sRet;
@@ -113,7 +113,7 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "getIndexFollowPageWord: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
     return sRet;
@@ -136,7 +136,7 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "getAlgorithmList: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
     return sRet;
@@ -159,7 +159,7 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm(
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "loadAlgorithm: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
     return bRet;
@@ -185,7 +185,7 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry(
 #if OSL_DEBUG_LEVEL > 1
         ByteString aMsg( "compareIndexEntry: Exception caught\n" );
         aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
-        DBG_ERRORFILE( aMsg.GetBuffer() );
+        OSL_FAIL( aMsg.GetBuffer() );
 #endif
     }
     return nRet;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index af88482..29c6260 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -947,7 +947,7 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
     SfxItemSet aSet( pEditShell->GetAttrPool(), aRanges );
     aSet.Put( SvxLanguageItem( nLang, nLangWhichId ) );
 
-    DBG_ASSERT( pFont, "target font missing?" );
+    OSL_ENSURE( pFont, "target font missing?" );
     if (pFont)
     {
         SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId );
@@ -1071,7 +1071,7 @@ sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs )
     if (bFound && bInSelection)     // convertible text found within selection/range?
     {
         const XubString aTxtPortion = m_Text.Copy( nBegin, nLen );
-        DBG_ASSERT( m_Text.Len() > 0, "convertible text portion missing!" );
+        OSL_ENSURE( m_Text.Len() > 0, "convertible text portion missing!" );
         rArgs.aConvText     = m_Text.Copy( nBegin, nLen );
         rArgs.nConvTextLang = nLangFound;
 
@@ -1198,7 +1198,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
             if( bSpell && rWord.Len() > 0 )
             {
                 // check for: bAlter => xHyphWord.is()
-                DBG_ASSERT(!bSpell || xSpell.is(), "NULL pointer");
+                OSL_ENSURE(!bSpell || xSpell.is(), "NULL pointer");
 
                 if( !xSpell->isValid( rWord, eActLang, Sequence< PropertyValue >() ) )
                 {
@@ -1574,7 +1574,7 @@ void SwTxtNode::TransliterateText(
                 nStt = (xub_StrLen)aCurWordBndry.startPos;
                 nEnd = (xub_StrLen)aCurWordBndry.endPos;
                 sal_Int32 nLen = nEnd - nStt;
-                DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+                OSL_ENSURE( nLen > 0, "invalid word length of 0" );
 #if OSL_DEBUG_LEVEL > 1
                 String aText( GetTxt().Copy( nStt, nLen ) );
 #endif
@@ -1657,7 +1657,7 @@ void SwTxtNode::TransliterateText(
             while (nCurrentStart < nLastEnd)
             {
                 sal_Int32 nLen = nCurrentEnd - nCurrentStart;
-                DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+                OSL_ENSURE( nLen > 0, "invalid word length of 0" );
 #if OSL_DEBUG_LEVEL > 1
                 String aText( GetTxt().Copy( nCurrentStart, nLen ) );
 #endif
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index c74f072..2c9e3ca 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -161,28 +161,28 @@ Any SAL_CALL SwXTextDefaults::getPropertyValue( const OUString& rPropertyName )
 void SAL_CALL SwXTextDefaults::addPropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
         throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
-    DBG_WARNING ( "not implemented" );
+    OSL_FAIL ( "not implemented" );
 }
 
 
 void SAL_CALL SwXTextDefaults::removePropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
         throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
-    DBG_WARNING ( "not implemented" );
+    OSL_FAIL ( "not implemented" );
 }
 
 
 void SAL_CALL SwXTextDefaults::addVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
         throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
-    DBG_WARNING ( "not implemented" );
+    OSL_FAIL ( "not implemented" );
 }
 
 
 void SAL_CALL SwXTextDefaults::removeVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
         throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
 {
-    DBG_WARNING ( "not implemented" );
+    OSL_FAIL ( "not implemented" );
 }
 
 
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index cc0386a..162716d 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -230,7 +230,7 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
         }
         catch( UNO_NMSPC::Exception& )
         {
-            DBG_ERRORFILE( "create cursor failed!" );
+            OSL_FAIL( "create cursor failed!" );
         }
 
         if( xResultSet.is() )
@@ -274,13 +274,13 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
             }
             catch( UNO_NMSPC::Exception& )
             {
-                DBG_ERRORFILE( "Exception caught!" );
+                OSL_FAIL( "Exception caught!" );
             }
         }
     }
     catch( UNO_NMSPC::Exception& )
     {
-        DBG_ERRORFILE( "Exception caught!" );
+        OSL_FAIL( "Exception caught!" );
         bOk = sal_False;
     }
     return bOk;
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 7e5a3dd..fd9a2b6 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -240,12 +240,12 @@ sal_Bool FillRangeDescriptor(
     lcl_GetCellPosition( aTLName, rDesc.nLeft,  rDesc.nTop );
     lcl_GetCellPosition( aBRName, rDesc.nRight, rDesc.nBottom );
     rDesc.Normalize();
-    DBG_ASSERT( rDesc.nTop    != -1 &&
+    OSL_ENSURE( rDesc.nTop    != -1 &&
                 rDesc.nLeft   != -1 &&
                 rDesc.nBottom != -1 &&
                 rDesc.nRight  != -1,
             "failed to get range descriptor" );
-    DBG_ASSERT( rDesc.nTop <= rDesc.nBottom  &&  rDesc.nLeft <= rDesc.nRight,
+    OSL_ENSURE( rDesc.nTop <= rDesc.nBottom  &&  rDesc.nLeft <= rDesc.nRight,
             "invalid range descriptor");
     return sal_True;
 }
@@ -277,8 +277,8 @@ static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
             pStart = pUnoTblCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode();
             pStartBox = pTable->GetTblBox( pStart->GetIndex());
         }
-        DBG_ASSERT( pStartBox, "start box not found" );
-        DBG_ASSERT( pEndBox, "end box not found" );
+        OSL_ENSURE( pStartBox, "start box not found" );
+        OSL_ENSURE( pEndBox, "end box not found" );
         // need to switch start and end?
         if (*pUnoTblCrsr->GetPoint() < *pUnoTblCrsr->GetMark())
         {
@@ -302,8 +302,8 @@ static String GetRangeRepFromTableAndCells( const String &rTableName,
         const String &rStartCell, const String &rEndCell,
         sal_Bool bForceEndCellName )
 {
-    DBG_ASSERT( rTableName.Len(), "table name missing" );
-    DBG_ASSERT( rStartCell.Len(), "cell name missing" );
+    OSL_ENSURE( rTableName.Len(), "table name missing" );
+    OSL_ENSURE( rStartCell.Len(), "cell name missing" );
     String aRes( rTableName );
     aRes += (sal_Unicode) '.';
     aRes += rStartCell;
@@ -597,7 +597,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                                             // false: DataSource will be sequence of rows
     OUString aChartOleObjectName;//work around wrong writer ranges ( see Issue 58464 )
     sal_Int32 nArgs = rArguments.getLength();
-    DBG_ASSERT( nArgs != 0, "no properties provided" );
+    OSL_ENSURE( nArgs != 0, "no properties provided" );
     if (nArgs == 0)
         return xRes;
     const beans::PropertyValue *pArg = rArguments.getConstArray();
@@ -739,12 +739,12 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                 sal_Bool bOk2 = GetTableAndCellsFromRangeRep(
                                     pSubRanges[i], aTblName, aStartCell, aEndCell );
                 (void) bOk2;
-                DBG_ASSERT( bOk2, "failed to get table and start/end cells" );
+                OSL_ENSURE( bOk2, "failed to get table and start/end cells" );
 
                 sal_Int32 nStartRow, nStartCol, nEndRow, nEndCol;
                 lcl_GetCellPosition( aStartCell, nStartCol, nStartRow );
                 lcl_GetCellPosition( aEndCell,   nEndCol,   nEndRow );
-                DBG_ASSERT( nStartRow <= nEndRow && nStartCol <= nEndCol,
+                OSL_ENSURE( nStartRow <= nEndRow && nStartCol <= nEndCol,
                         "cell range not normalized");
 
                 // test if the ranges span more than the available cells
@@ -932,13 +932,13 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                 // create XDataSequence's from cursors
                 if (pLabelUnoCrsr)
                     pLabelSeqs[ nSeqsIdx ] = new SwChartDataSequence( *this, *pTblFmt, pLabelUnoCrsr );
-                DBG_ASSERT( pDataUnoCrsr, "pointer to data sequence missing" );
+                OSL_ENSURE( pDataUnoCrsr, "pointer to data sequence missing" );
                 if (pDataUnoCrsr)
                     pDataSeqs [ nSeqsIdx ] = new SwChartDataSequence( *this, *pTblFmt, pDataUnoCrsr );
                 if (pLabelUnoCrsr || pDataUnoCrsr)
                     ++nSeqsIdx;
             }
-            DBG_ASSERT( nSeqsIdx == nNumLDS,
+            OSL_ENSURE( nSeqsIdx == nNumLDS,
                     "mismatch between sequence size and num,ber of entries" );
 
             // build data source from data and label sequences
@@ -984,7 +984,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
                     if (pOld_LDS[i].is())
                         pLDS[nNewCnt++] = pOld_LDS[i];
                 }
-                DBG_ASSERT( nNewCnt == nNumLDS, "unexpected size of resulting sequence" );
+                OSL_ENSURE( nNewCnt == nNumLDS, "unexpected size of resulting sequence" );
             }
 
             xRes = new SwChartDataSource( aLDS );
@@ -1078,7 +1078,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
 
     if (nNumDS_LDS == 0)
     {
-        DBG_WARNING( "XLabeledDataSequence in data source contains 0 entries" );
+        OSL_FAIL( "XLabeledDataSequence in data source contains 0 entries" );
         return aResult;
     }
 
@@ -1160,14 +1160,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
         //
         sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
         String aCell( aLabelStartCell.Len() ? aLabelStartCell : aValuesStartCell );
-        DBG_ASSERT( aCell.Len() , "start cell missing?" );
+        OSL_ENSURE( aCell.Len() , "start cell missing?" );
         lcl_GetCellPosition( aCell, nFirstCol, nFirstRow);
         lcl_GetCellPosition( aValuesEndCell, nLastCol, nLastRow);
         //
         sal_Int16 nDirection = -1;  // -1: not yet set,  0: columns,  1: rows, -2: failed
         if (nFirstCol == nLastCol && nFirstRow == nLastRow) // a single cell...
         {
-            DBG_ASSERT( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
+            OSL_ENSURE( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
                     "trying to determine 'DataRowSource': something's fishy... should have been a single cell");
             (void)nCurValuesSeqLen;
             nDirection = 0;     // default direction for a single cell should be 'columns'
@@ -1197,7 +1197,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
         {
             // build data to obtain 'SequenceMapping' later on
             //
-            DBG_ASSERT( nDtaSrcIsColumns == 0  ||   /* rows */
+            OSL_ENSURE( nDtaSrcIsColumns == 0  ||   /* rows */
                         nDtaSrcIsColumns == 1,      /* columns */
                     "unexpected value for 'nDtaSrcIsColumns'" );
             pSequenceMapping[nDS1] = nDtaSrcIsColumns ? nFirstCol : nFirstRow;
@@ -1269,7 +1269,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
             {
                 lcl_GetCellPosition( aLabelStartCell, nStartCol, nStartRow);
                 lcl_GetCellPosition( aLabelEndCell,   nEndCol,   nEndRow);
-                DBG_ASSERT( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurLabel->getData().getLength()) ||
+                OSL_ENSURE( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurLabel->getData().getLength()) ||
                             (nStartRow == nEndRow && (nEndCol - nStartCol + 1) == xCurLabel->getData().getLength()),
                         "label sequence length does not match range representation!" );
             }
@@ -1277,7 +1277,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
             {
                 lcl_GetCellPosition( aValuesStartCell, nStartCol, nStartRow);
                 lcl_GetCellPosition( aValuesEndCell,   nEndCol,   nEndRow);
-                DBG_ASSERT( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurValues->getData().getLength()) ||
+                OSL_ENSURE( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurValues->getData().getLength()) ||
                             (nStartRow == nEndRow && (nEndCol - nStartCol + 1) == xCurValues->getData().getLength()),
                         "value sequence length does not match range representation!" );
             }
@@ -1350,13 +1350,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
     uno::Sequence< sal_Int32 > aSortedMapping( aSequenceMapping );
     sal_Int32 *pSortedMapping = aSortedMapping.getArray();
     std::sort( pSortedMapping, pSortedMapping + aSortedMapping.getLength() );
-    DBG_ASSERT( aSortedMapping.getLength() == nNumDS_LDS, "unexpected size of sequence" );
+    OSL_ENSURE( aSortedMapping.getLength() == nNumDS_LDS, "unexpected size of sequence" );
     sal_Bool bNeedSequenceMapping = sal_False;
     for (sal_Int32 i = 0;  i < nNumDS_LDS;  ++i)
     {
         sal_Int32 *pIt = std::find( pSortedMapping, pSortedMapping + nNumDS_LDS,
                                     pSequenceMapping[i] );
-        DBG_ASSERT( pIt, "index not found" );
+        OSL_ENSURE( pIt, "index not found" );
         if (!pIt)
             return aResult; // failed -> return empty property sequence
         pSequenceMapping[i] = pIt - pSortedMapping;
@@ -1373,13 +1373,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
     //
     // build resulting properties
     //
-    DBG_ASSERT(nLabelSeqLen >= 0 || nLabelSeqLen == -2 /*not used*/,
+    OSL_ENSURE(nLabelSeqLen >= 0 || nLabelSeqLen == -2 /*not used*/,
             "unexpected value for 'nLabelSeqLen'" );
     sal_Bool bFirstCellIsLabel = sal_False;     // default value if 'nLabelSeqLen' could not properly determined
     if (nLabelSeqLen > 0) // == 0 means no label sequence in use
         bFirstCellIsLabel = sal_True;
     //
-    DBG_ASSERT( aSortedCellRanges.getLength(), "CellRangeRepresentation missing" );
+    OSL_ENSURE( aSortedCellRanges.getLength(), "CellRangeRepresentation missing" );
     OUString aBrokenCellRangeForExport( GetBrokenCellRangeForExport( aSortedCellRanges ) );
     //
     aResult.realloc(5);
@@ -1432,7 +1432,7 @@ uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDa
     if (aDesc.nTop != aDesc.nBottom  &&  aDesc.nLeft != aDesc.nRight)
         throw lang::IllegalArgumentException();
 
-    DBG_ASSERT( pTblFmt && pUnoCrsr, "table format or cursor missing" );
+    OSL_ENSURE( pTblFmt && pUnoCrsr, "table format or cursor missing" );
     uno::Reference< chart2::data::XDataSequence > xDataSeq;
     if (!bTestOnly)
         xDataSeq = new SwChartDataSequence( *this, *pTblFmt, pUnoCrsr );
@@ -1561,7 +1561,7 @@ void SwChartDataProvider::RemoveDataSequence( const SwTable &rTable, uno::Refere
 
 void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
 {
-    DBG_ASSERT( pTable, "table pointer is NULL" );
+    OSL_ENSURE( pTable, "table pointer is NULL" );
     if (pTable)
     {
         if (!bDisposed)
@@ -1586,7 +1586,7 @@ void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
 sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox &rBox )
 {
     sal_Bool bRes = sal_False;
-    DBG_ASSERT( pTable, "table pointer is NULL" );
+    OSL_ENSURE( pTable, "table pointer is NULL" );
     if (pTable)
     {
         if (!bDisposed)
@@ -1635,7 +1635,7 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox
 
 void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
 {
-    DBG_ASSERT( pTable, "table pointer is NULL" );
+    OSL_ENSURE( pTable, "table pointer is NULL" );
     if (pTable)
     {
         if (!bDisposed)
@@ -1714,7 +1714,7 @@ void SwChartDataProvider::AddRowCols(
             sal_Int32 nFirstNewRow = bBehind ?  nFirstRow + 1 : nFirstRow - nLines;
             if (bAddCols)
             {
-                DBG_ASSERT( nFirstCol == nLastCol, "column indices seem broken" );
+                OSL_ENSURE( nFirstCol == nLastCol, "column indices seem broken" );
                 nFirstNewCol = bBehind ?  nFirstCol + 1 : nFirstCol - nLines;
                 nFirstNewRow = nFirstRow;
             }
@@ -1972,7 +1972,7 @@ SwChartDataSequence::SwChartDataSequence(
     // check if it can properly convert into a SwUnoTableCrsr
     // which is required for some functions
     SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
-    DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+    OSL_ENSURE(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
     (void) pUnoTblCrsr;
 #endif
 }
@@ -2022,7 +2022,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
     // check if it can properly convert into a SwUnoTableCrsr
     // which is required for some functions
     SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
-    DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+    OSL_ENSURE(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
     (void) pUnoTblCrsr;
 #endif
 }
@@ -2095,7 +2095,7 @@ OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation(  )
     {
         aRes = pTblFmt->GetName();
         String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
-        DBG_ASSERT( aCellRange.Len() != 0, "failed to get cell range" );
+        OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
         aRes += (sal_Unicode) '.';
         aRes += aCellRange;
     }
@@ -2122,16 +2122,16 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
         else
         {
             String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
-            DBG_ASSERT( aCellRange.Len() != 0, "failed to get cell range" );
+            OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
             bOk = FillRangeDescriptor( aDesc, aCellRange );
-            DBG_ASSERT( bOk, "falied to get SwRangeDescriptor" );
+            OSL_ENSURE( bOk, "falied to get SwRangeDescriptor" );
         }
         if (bOk)
         {
             aDesc.Normalize();
             sal_Int32 nColSpan = aDesc.nRight - aDesc.nLeft + 1;
             sal_Int32 nRowSpan = aDesc.nBottom - aDesc.nTop + 1;
-            DBG_ASSERT( nColSpan == 1 || nRowSpan == 1,
+            OSL_ENSURE( nColSpan == 1 || nRowSpan == 1,
                     "unexpected range of selected cells" );
 
             String aTxt;    // label text to be returned
@@ -2535,13 +2535,13 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
 
         lcl_GetCellPosition( aPointCellName, nPointCol, nPointRow );
         lcl_GetCellPosition( aMarkCellName,  nMarkCol,  nMarkRow );
-        DBG_ASSERT( nPointRow >= 0 && nPointCol >= 0, "invalid row and col" );
-        DBG_ASSERT( nMarkRow >= 0 && nMarkCol >= 0, "invalid row and col" );
+        OSL_ENSURE( nPointRow >= 0 && nPointCol >= 0, "invalid row and col" );
+        OSL_ENSURE( nMarkRow >= 0 && nMarkCol >= 0, "invalid row and col" );
 
         // move vertical or horizontal?
-        DBG_ASSERT( nPointRow == nMarkRow || nPointCol == nMarkCol,
+        OSL_ENSURE( nPointRow == nMarkRow || nPointCol == nMarkCol,
                 "row/col indices not matching" );
-        DBG_ASSERT( nPointRow != nMarkRow || nPointCol != nMarkCol,
+        OSL_ENSURE( nPointRow != nMarkRow || nPointCol != nMarkCol,
                 "point and mark are identical" );
         sal_Bool bMoveVertical      = (nPointCol == nMarkCol);
         sal_Bool bMoveHorizontal    = (nPointRow == nMarkRow);
@@ -2659,7 +2659,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
     const SwTableBox  *pEndBox   = 0;
 
     const SwTable* pTable = SwTable::FindTable( GetFrmFmt() );
-    DBG_ASSERT( !pTable->IsTblComplex(), "table too complex" );
+    OSL_ENSURE( !pTable->IsTblComplex(), "table too complex" );
     if (nCount < 1 || nFirstNew < 0 || pTable->IsTblComplex())
         return false;
 
@@ -2686,7 +2686,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
     {
         // new column cells adjacent to the bottom of the
         // current data-sequence to be added...
-        DBG_ASSERT( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
+        OSL_ENSURE( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
         aNewStartCell = lcl_GetCellName(aDesc.nLeft,  aDesc.nTop);
         aNewEndCell   = lcl_GetCellName(aDesc.nRight, aDesc.nBottom + nCount);
         bChanged = true;
@@ -2695,7 +2695,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
     {
         // new column cells adjacent to the top of the
         // current data-sequence to be added...
-        DBG_ASSERT( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
+        OSL_ENSURE( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
         aNewStartCell = lcl_GetCellName(aDesc.nLeft,  aDesc.nTop - nCount);
         aNewEndCell   = lcl_GetCellName(aDesc.nRight, aDesc.nBottom);
         bChanged = true;
@@ -2704,7 +2704,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
     {
         // new row cells adjacent to the right of the
         // current data-sequence to be added...
-        DBG_ASSERT( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
+        OSL_ENSURE( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
         aNewStartCell = lcl_GetCellName(aDesc.nLeft, aDesc.nTop);
         aNewEndCell   = lcl_GetCellName(aDesc.nRight + nCount, aDesc.nBottom);
         bChanged = true;
@@ -2713,7 +2713,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
     {
         // new row cells adjacent to the left of the
         // current data-sequence to be added...
-        DBG_ASSERT( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
+        OSL_ENSURE( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
         aNewStartCell = lcl_GetCellName(aDesc.nLeft - nCount, aDesc.nTop);
         aNewEndCell   = lcl_GetCellName(aDesc.nRight, aDesc.nBottom);
         bChanged = true;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 21ade05..398db6f 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -532,11 +532,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
                         {
                             //now the attribute should start before or at the selection
                             //and it should end at the end of the selection or behind
-                            DBG_ASSERT(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
+                            OSL_ENSURE(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
                                     "attribute overlaps or is outside");
                             //now the name of the style has to be added to the sequence
                             aCharStyles.realloc(aCharStyles.getLength() + 1);
-                            DBG_ASSERT(pAttr->GetCharFmt().GetCharFmt(), "no character format set");
+                            OSL_ENSURE(pAttr->GetCharFmt().GetCharFmt(), "no character format set");
                             aCharStyles.getArray()[aCharStyles.getLength() - 1] =
                                         SwStyleNameMapper::GetProgName(
                                             pAttr->GetCharFmt().GetCharFmt()->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
@@ -958,7 +958,7 @@ sal_Bool DocInsertStringSplitCR(
     }
     while (nIdx != STRING_NOTFOUND )
     {
-        DBG_ASSERT( nIdx - nStartIdx >= 0, "index negative!" );
+        OSL_ENSURE( nIdx - nStartIdx >= 0, "index negative!" );
         aTxt = rText.Copy( nStartIdx, nIdx - nStartIdx );
         if (aTxt.getLength() &&
             !rDoc.InsertString( rNewCursor, aTxt, nInsertFlags ))
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 2ea0438..b3c1dd6 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -364,7 +364,7 @@ uno::Reference< drawing::XShape >  SwFmDrawPage::_CreateShape( SdrObject *pObj )
                 OSL_FAIL( "<SwFmDrawPage::_CreateShape(..)> - could not retrieve type. Thus, no shape created." );
                 return xRet;
             }
-            DBG_ASSERT( eType != FLYCNTTYPE_ALL, "unexpected FlyCntType value for eType" );
+            OSL_ENSURE( eType != FLYCNTTYPE_ALL, "unexpected FlyCntType value for eType" );
             xRet = SwXFrames::GetObject( *pFlyFmt, eType );
         }
      }
@@ -632,7 +632,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
 
     uno::Reference< uno::XAggregation > 	xAgg = pShape->GetAggregationInterface();
 
-    DBG_ASSERT(pSvxShape, "warum gibt es hier kein SvxShape?");
+    OSL_ENSURE(pSvxShape, "warum gibt es hier kein SvxShape?");
     //diese Position ist auf jeden Fall in 1/100 mm
     awt::Point aMM100Pos(pSvxShape->getPosition());
 
@@ -1171,7 +1171,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                 else if(RES_OPAQUE == pEntry->nWID)
                 {
                     SvxShape* pSvxShape = GetSvxShape();
-                    DBG_ASSERT(pSvxShape, "No SvxShape found!");
+                    OSL_ENSURE(pSvxShape, "No SvxShape found!");
                     if(pSvxShape)
                     {
                         SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1222,9 +1222,9 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                                 SwTxtAttr * const pHnt =
                                     pTxtNode->GetTxtAttrForCharAt(
                                         nIdx, RES_TXTATR_FLYCNT );
-                                DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+                                OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
                                             "Missing FlyInCnt-Hint." );
-                                DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
+                                OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
                                             "Wrong TxtFlyCnt-Hint." );
                                 const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
                                     .SetFlyFmt();
@@ -1234,7 +1234,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                                     RES_TXTATR_FLYCNT, nIdx );
                                 //create a new one
                                 SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
-                                DBG_ASSERT( pNd, "Cursor not at TxtNode." );
+                                OSL_ENSURE( pNd, "Cursor not at TxtNode." );
                                 SwFmtFlyCnt aFmt( pFmt );
                                 pNd->InsertItem(aFmt, pInternalPam->GetPoint()
                                         ->nContent.GetIndex(), 0 );
@@ -1308,9 +1308,9 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             SwTxtAttr * const pHnt =
                                 pTxtNode->GetTxtAttrForCharAt(
                                     nIdx, RES_TXTATR_FLYCNT );
-                            DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+                            OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
                                         "Missing FlyInCnt-Hint." );
-                            DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
+                            OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
                                         "Wrong TxtFlyCnt-Hint." );
                             const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
                                 .SetFlyFmt();
@@ -1346,7 +1346,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             {
                                 //the RES_TXTATR_FLYCNT needs to be added now
                                 SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
-                                DBG_ASSERT( pNd, "Crsr is not in a TxtNode." );
+                                OSL_ENSURE( pNd, "Crsr is not in a TxtNode." );
                                 SwFmtFlyCnt aFmt( pFlyFmt );
                                 pNd->InsertItem(aFmt,
                                     aPam.GetPoint()->nContent.GetIndex(), 0 );
@@ -1476,7 +1476,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
                 if(RES_OPAQUE == pEntry->nWID)
                 {
                     SvxShape* pSvxShape = GetSvxShape();
-                    DBG_ASSERT(pSvxShape, "No SvxShape found!");
+                    OSL_ENSURE(pSvxShape, "No SvxShape found!");
                     if(pSvxShape)
                     {
                         SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1490,7 +1490,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
                 else if(FN_ANCHOR_POSITION == pEntry->nWID)
                 {
                     SvxShape* pSvxShape = GetSvxShape();
-                    DBG_ASSERT(pSvxShape, "No SvxShape found!");
+                    OSL_ENSURE(pSvxShape, "No SvxShape found!");
                     if(pSvxShape)
                     {
                         SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1946,7 +1946,7 @@ void SwXShape::addVetoableChangeListener(
     throw( beans::UnknownPropertyException, lang::WrappedTargetException,
            uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXShape::removeVetoableChangeListener(
@@ -1955,7 +1955,7 @@ void SwXShape::removeVetoableChangeListener(
     throw( beans::UnknownPropertyException, lang::WrappedTargetException,
            uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXShape::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -2682,7 +2682,7 @@ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
 {
 #if OSL_DEBUG_LEVEL > 1
     uno::Reference<XShapes> xShapes(xShapeAgg, uno::UNO_QUERY);
-    DBG_ASSERT(xShapes.is(), "no SvxShape found or shape is not a group shape");
+    OSL_ENSURE(xShapes.is(), "no SvxShape found or shape is not a group shape");
 #endif
 }
 
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 8351970..f31acb9 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -625,7 +625,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
                 throw uno::RuntimeException();
         }
 
-        DBG_ASSERT(pType2, "kein FieldType gefunden!" );
+        OSL_ENSURE(pType2, "kein FieldType gefunden!" );
     }
     else
     {
@@ -882,22 +882,22 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
 
 void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFieldMaster::dispose(void) 			throw( uno::RuntimeException )
@@ -1878,7 +1878,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
         {
             // hier muss ein neuer Feldtyp angelegt werden und
             // das Feld an den neuen Typ umgehaengt werden
-            DBG_WARNING("not implemented");
+            OSL_FAIL("not implemented");
         }
         else
         {
@@ -2198,22 +2198,22 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
 
 void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextField::update(  ) throw (uno::RuntimeException)
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index d4ad785..9392abe 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1582,7 +1582,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
         {
             SwDoc* pDoc = pFmt->GetDoc();
             const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-            DBG_ASSERT( pCnt->GetCntntIdx() &&
+            OSL_ENSURE( pCnt->GetCntntIdx() &&
                            pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                             GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
@@ -1630,7 +1630,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
             SwFrm* pTmpFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
             if ( pTmpFrm )
             {
-                DBG_ASSERT( pTmpFrm->IsValid(), "frame not valid" );
+                OSL_ENSURE( pTmpFrm->IsValid(), "frame not valid" );
                 const SwRect &rRect = pTmpFrm->Frm();
                 Size aMM100Size = OutputDevice::LogicToLogic(
                         Size( rRect.Width(), rRect.Height() ),
@@ -1666,28 +1666,28 @@ void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
     const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
     const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
                                 const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFrame::removeVetoableChangeListener(
     const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
@@ -2901,7 +2901,7 @@ uno::Reference< lang::XComponent >  SwXTextEmbeddedObject::getEmbeddedObject(voi
     {
         SwDoc* pDoc = pFmt->GetDoc();
         const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-        DBG_ASSERT(	pCnt->GetCntntIdx() &&
+        OSL_ENSURE(	pCnt->GetCntntIdx() &&
                        pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                         GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
@@ -2941,7 +2941,7 @@ uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExte
     {
         SwDoc* pDoc = pFmt->GetDoc();
         const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-        DBG_ASSERT(	pCnt->GetCntntIdx() &&
+        OSL_ENSURE(	pCnt->GetCntntIdx() &&
                        pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                         GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
@@ -2979,7 +2979,7 @@ sal_Int64 SAL_CALL SwXTextEmbeddedObject::getAspect() throw (uno::RuntimeExcepti
     {
         SwDoc* pDoc = pFmt->GetDoc();
         const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-        DBG_ASSERT(	pCnt->GetCntntIdx() &&
+        OSL_ENSURE(	pCnt->GetCntntIdx() &&
                        pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                         GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
@@ -2996,7 +2996,7 @@ void SAL_CALL SwXTextEmbeddedObject::setAspect( sal_Int64 nAspect ) throw (uno::
     {
         SwDoc* pDoc = pFmt->GetDoc();
         const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-        DBG_ASSERT(	pCnt->GetCntntIdx() &&
+        OSL_ENSURE(	pCnt->GetCntntIdx() &&
                        pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                         GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
@@ -3011,7 +3011,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme
     {
         SwDoc* pDoc = pFmt->GetDoc();
         const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
-        DBG_ASSERT(	pCnt->GetCntntIdx() &&
+        OSL_ENSURE(	pCnt->GetCntntIdx() &&
                        pDoc->GetNodes()[ pCnt->GetCntntIdx()->
                                         GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
 
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index bf3eb9c..93cbb5b 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -290,7 +290,7 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException)
     if(pFmt)
     {
         const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn();
-        DBG_ASSERT(pTxtFtn, "kein TextNode?");
+        OSL_ENSURE(pTxtFtn, "kein TextNode?");
         SwTxtNode& rTxtNode = (SwTxtNode&)pTxtFtn->GetTxtNode();
 
         SwPaM aPam(rTxtNode, *pTxtFtn->GetStart());
@@ -399,7 +399,7 @@ void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException)
     SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
 
     SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn();
-    DBG_ASSERT(pTxtFtn, "no TextNode?");
+    OSL_ENSURE(pTxtFtn, "no TextNode?");
     SwTxtNode& rTxtNode = const_cast<SwTxtNode&>(pTxtFtn->GetTxtNode());
     const xub_StrLen nPos = *pTxtFtn->GetStart();
     SwPaM aPam(rTxtNode, nPos, rTxtNode, nPos+1);
@@ -577,7 +577,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
             if (pFmt)
             {
                 SwTxtFtn const*const pTxtFtn = pFmt->GetTxtFtn();
-                DBG_ASSERT(pTxtFtn, "no TextNode?");
+                OSL_ENSURE(pTxtFtn, "no TextNode?");
                 aRet <<= static_cast<sal_Int16>(pTxtFtn->GetSeqRefNo());
             }
         }
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index ad0163f..25b84ca 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -634,7 +634,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
                 throw lang::IllegalArgumentException();
             }
             lcl_ConvertTOUNameToUserName(sNewName);
-            DBG_ASSERT(TOX_USER == eTxBaseType,
+            OSL_ENSURE(TOX_USER == eTxBaseType,
                     "tox type name can only be changed for user indexes");
             if (pSectionFmt)
             {
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 72a4614..62bf2bd 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -476,7 +476,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
 
 const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId)
 {
-    DBG_ASSERT(nPropertyId < PROPERTY_MAP_END, "Id ?" );
+    OSL_ENSURE(nPropertyId < PROPERTY_MAP_END, "Id ?" );
     if( !aMapEntriesArr[ nPropertyId ] )
     {
         switch(nPropertyId)
@@ -2452,7 +2452,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
             // get the cppu type from the comphelper
             CppuTypes nTyp = (CppuTypes) (long) p->pType;
             GenerateCppuType( nTyp, p->pType );
-            DBG_ASSERT( nTyp != (CppuTypes) (long) p->pType, "unknown type" );
+            OSL_ENSURE( nTyp != (CppuTypes) (long) p->pType, "unknown type" );
         }
     }
     return aMapEntriesArr[nPropertyId];
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 3881da7..b98dc4d 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -886,7 +886,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
                 const bool bSuccess(
                     SwUnoCursorHelper::DocInsertStringSplitCR(
                         *pDoc, *pCurrent, rText, bForceExpandHints ) );
-                DBG_ASSERT( bSuccess, "Doc->Insert(Str) failed." );
+                OSL_ENSURE( bSuccess, "Doc->Insert(Str) failed." );
                 (void) bSuccess;
 
                 SwUnoCursorHelper::SelectPam(*pUnoCrsr, true);
@@ -1702,7 +1702,7 @@ throw (uno::RuntimeException)
     // since MovePara(fnParaCurr, fnParaStart) only returns false
     // if we were already at the start of the paragraph this function
     // should always complete successfully.
-    DBG_ASSERT( bRet, "gotoStartOfParagraph failed" );
+    OSL_ENSURE( bRet, "gotoStartOfParagraph failed" );
     return bRet;
 }
 
@@ -1727,7 +1727,7 @@ SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException)
     // since MovePara(fnParaCurr, fnParaEnd) only returns false
     // if we were already at the end of the paragraph this function
     // should always complete successfully.
-    DBG_ASSERT( bRet, "gotoEndOfParagraph failed" );
+    OSL_ENSURE( bRet, "gotoEndOfParagraph failed" );
     return bRet;
 }
 
@@ -2544,7 +2544,7 @@ SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable)
     uno::Sequence< OUString > aSeq(
             GetAppCollator().listCollatorAlgorithms( aLang ) );
     const sal_Int32 nLen = aSeq.getLength();
-    DBG_ASSERT( nLen > 0, "list of collator algorithms is empty!");
+    OSL_ENSURE( nLen > 0, "list of collator algorithms is empty!");
     OUString aCollAlg;
     if (nLen > 0)
     {
@@ -2915,7 +2915,7 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException)
     {
         pParentText = ::sw::UnoTunnelGetImplementation<SwXText>(xTunnel);
     }
-    DBG_ASSERT(pParentText, "parent is not a SwXText");
+    OSL_ENSURE(pParentText, "parent is not a SwXText");
     if (!pParentText)
     {
         throw uno::RuntimeException();
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index fafd8ec..fc16bdf 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1123,7 +1123,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
                 : ((pPortion) ? pPortion->GetCursor() : 0);
             if (pUnoCrsr && pDoc == rToFill.GetDoc())
             {
-                DBG_ASSERT((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr,
+                OSL_ENSURE((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr,
                         "what to do about rings?");
                 bRet = true;
                 *rToFill.GetPoint() = *pUnoCrsr->GetPoint();
@@ -1718,7 +1718,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
         String aText(rString);
         const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR(
                     *pDoc, rCursor, aText, false ) );
-        DBG_ASSERT( bSuccess, "DocInsertStringSplitCR" );
+        OSL_ENSURE( bSuccess, "DocInsertStringSplitCR" );
         (void) bSuccess;
         SwUnoCursorHelper::SelectPam(rCursor, true);
         rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, sal_False, sal_False);
@@ -1813,7 +1813,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
     else
     {
         const SwNodeIndex* pIdx = pFormat->GetCntnt().GetCntntIdx();
-        DBG_ASSERT(pIdx, "where is the index?");
+        OSL_ENSURE(pIdx, "where is the index?");
         SwNode const*const pNd =
             i_rUnoCrsr.GetDoc()->GetNodes()[ pIdx->GetIndex() + 1 ];
 
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 3e703c4..c8fea5c 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -324,7 +324,7 @@ SwXParagraph::getSupportedServiceNames() throw (uno::RuntimeException)
 void
 SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode)
 {
-    DBG_ASSERT(m_pImpl->m_bIsDescriptor, "Paragraph is not a descriptor");
+    OSL_ENSURE(m_pImpl->m_bIsDescriptor, "Paragraph is not a descriptor");
     if (m_pImpl->m_bIsDescriptor)
     {
         m_pImpl->m_bIsDescriptor = false;
@@ -689,7 +689,7 @@ throw (uno::RuntimeException)
 
     for (sal_Int32 i = 0;  i < nProps;  ++i)
     {
-        DBG_ASSERT( nIdx < nProps, "index out ouf bounds" );
+        OSL_ENSURE( nIdx < nProps, "index out ouf bounds" );
         beans::GetDirectPropertyTolerantResult &rResult = pResult[nIdx];
 
         try
@@ -748,7 +748,7 @@ throw (uno::RuntimeException)
                     nIdx++;
                 }
                 // this assertion should never occur!
-                DBG_ASSERT( nIdx < 1  ||  pResult[nIdx - 1].Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
+                OSL_ENSURE( nIdx < 1  ||  pResult[nIdx - 1].Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
                         "unknown failure while retrieving property" );
 
             }
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 7320e07..a637932 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -254,7 +254,7 @@ void SwXTextPortion::GetPropertyValue(
         SwUnoCrsr *pUnoCrsr,
         SfxItemSet *&pSet )
 {
-    DBG_ASSERT( pUnoCrsr, "UNO cursor missing" );
+    OSL_ENSURE( pUnoCrsr, "UNO cursor missing" );
     if (!pUnoCrsr)
         return;
     if(pUnoCrsr)
@@ -734,22 +734,22 @@ void SwXTextPortion::addPropertyChangeListener(
     const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextPortion::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextPortion::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextPortion::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyName)
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 51286e0..753eb11 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -247,7 +247,7 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
        rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint(), sal_False);
     pUnoCrsr->Add(this);
 
-    DBG_ASSERT(nEnd == -1 || (nStart <= nEnd &&
+    OSL_ENSURE(nEnd == -1 || (nStart <= nEnd &&
         nEnd <= pUnoCrsr->Start()->nNode.GetNode().GetTxtNode()->GetTxt().Len()),
             "start or end value invalid!");
 
@@ -1045,7 +1045,7 @@ lcl_CreatePortions(
         (pUnoCrsr->Start()->nContent.GetIndex() != i_nStartPos))
     {
         pUnoCrsr->DeleteMark();
-        DBG_ASSERT(pUnoCrsr->Start()->nNode.GetNode().GetTxtNode() &&
+        OSL_ENSURE(pUnoCrsr->Start()->nNode.GetNode().GetTxtNode() &&
             (i_nStartPos <= pUnoCrsr->Start()->nNode.GetNode().GetTxtNode()->
                                 GetTxt().Len()), "Incorrect start position" );
         // ??? should this be i_nStartPos - current position ?
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index b6d31f4..493c2d0 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -795,7 +795,7 @@ const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
 }
 const SwPropNameLen& GetPropName( sal_uInt16 nId )
 {
-    DBG_ASSERT( SW_PROPNAME_BEGIN <= nId && nId < SW_PROPNAME_END,
+    OSL_ENSURE( SW_PROPNAME_BEGIN <= nId && nId < SW_PROPNAME_END,
                 "GetPropName(): Wrong index" );
     return aPropNameTab[ nId - SW_PROPNAME_BEGIN];
 }
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 000516e..f2049cb 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -273,7 +273,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
                 aRet <<= xRet;
             }
             else {
-                DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+                OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
             }
         }
     }
@@ -397,7 +397,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
             pRet[nPropIdx++].Value <<= xRet;
         }
         else {
-            DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+            OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
         }
     }
     if(pNext)
@@ -486,14 +486,14 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
             case ND_SECTIONNODE:
             {
                 SwSectionNode* pSectNode = pNode->GetSectionNode();
-                DBG_ASSERT(pSectNode, "No section node!");
+                OSL_ENSURE(pSectNode, "No section node!");
                 xRet = SwXTextSections::GetObject( *pSectNode->GetSection().GetFmt() );
             }
             break;
             case ND_TABLENODE :
             {
                 SwTableNode* pTblNode = pNode->GetTableNode();
-                DBG_ASSERT(pTblNode, "No table node!");
+                OSL_ENSURE(pTblNode, "No table node!");
                 SwTable& rTbl = pTblNode->GetTable();
                 SwFrmFmt* pTblFmt = rTbl.GetFrmFmt();
                 xRet = SwXTextTables::GetObject( *pTblFmt );
@@ -527,7 +527,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
                 aRet <<= xRet;
             }
             else {
-                DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+                OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
             }
         }
     }
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 8792753..a6d138a 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -583,28 +583,28 @@ void SwXFootnoteProperties::addPropertyChangeListener(
     const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFootnoteProperties::removePropertyChangeListener(
     const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFootnoteProperties::addVetoableChangeListener(
     const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXFootnoteProperties::removeVetoableChangeListener(
     const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 /******************************************************************
@@ -815,27 +815,27 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
 void SwXEndnoteProperties::addPropertyChangeListener(
     const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXEndnoteProperties::removePropertyChangeListener(const OUString& /*PropertyName*/,
         const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXEndnoteProperties::addVetoableChangeListener(const OUString& /*PropertyName*/,
     const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXEndnoteProperties::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 /******************************************************************
@@ -1103,23 +1103,23 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
 
 void SwXLineNumberingProperties::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
 }
 
 void SwXLineNumberingProperties::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
 }
 
 void SwXLineNumberingProperties::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
 }
 
 void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
 }
 
 /******************************************************************
@@ -1359,7 +1359,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
                 const SwNumRule& rNumRule, sal_Int32 nIndex) const
 {
     SolarMutexGuard aGuard;
-    DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
+    OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
 
     const SwNumFmt& rFmt = rNumRule.Get( (sal_uInt16)nIndex );
 
@@ -1627,7 +1627,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
     throw( uno::RuntimeException, lang::IllegalArgumentException )
 {
     SolarMutexGuard aGuard;
-    DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
+    OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
 
     // the order of the names is important!
     static const char* aNumPropertyNames[] =
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 003a96e..76fb803 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -619,22 +619,22 @@ SET_UINT16:
 
 void SwXTextSearch::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextSearch::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextSearch::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextSearch::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 sal_Bool SwXTextSearch::getValueSearch(void) throw( uno::RuntimeException )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 1aec961..ac86160 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -172,7 +172,7 @@ SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum ( SfxStyleFamily eFamily )
         case SFX_STYLE_FAMILY_PSEUDO:
             return nsSwGetPoolIdFromName::GET_POOLID_NUMRULE;
         default:
-            DBG_ASSERT(sal_False, "someone asking for all styles in unostyle.cxx!" );
+            OSL_ENSURE(sal_False, "someone asking for all styles in unostyle.cxx!" );
             return nsSwGetPoolIdFromName::GET_POOLID_CHRFMT;
     }
 }
@@ -1339,7 +1339,7 @@ SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
     {
         pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
         if(pBase)
         {
             const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
@@ -1377,7 +1377,7 @@ OUString SwXStyle::getName(void) throw( uno::RuntimeException )
     {
         pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
         if(!pBase)
             throw uno::RuntimeException();
         SwStyleNameMapper::FillProgName(pBase->GetName(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
@@ -1394,7 +1394,7 @@ void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException )
     {
         pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
         sal_Bool bExcept = sal_True;
         if(pBase && pBase->IsUserDefined())
         {
@@ -1622,7 +1622,7 @@ struct SwStyleBase_Impl
     sal_Bool HasItemSet() {return mxNewBase.is();}
     SfxItemSet& GetItemSet()
         {
-            DBG_ASSERT(mxNewBase.is(), "no SwDocStyleSheet available");
+            OSL_ENSURE(mxNewBase.is(), "no SwDocStyleSheet available");
             if(!pItemSet)
                 pItemSet = new SfxItemSet(mxNewBase->GetItemSet());
             return *pItemSet;
@@ -1887,7 +1887,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
             if (!(rValue >>= aSeq))
                 throw lang::IllegalArgumentException();
 
-            DBG_ASSERT(COND_COMMAND_COUNT == 28,
+            OSL_ENSURE(COND_COMMAND_COUNT == 28,
                     "invalid size of comman count?");
             const beans::NamedValue *pSeq = aSeq.getConstArray();
             sal_Int32 nLen = aSeq.getLength();
@@ -2104,7 +2104,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl(
         pBasePool->SetSearchMask(eFamily);
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
         pBasePool->SetSearchMask(eFamily, nSaveMask );
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
         if(pBase)
             aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
         else
@@ -2209,14 +2209,14 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
             case  FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
             {
                 const SwNumRule* pRule = rBase.mxNewBase->GetNumRule();
-                DBG_ASSERT(pRule, "Wo ist die NumRule?");
+                OSL_ENSURE(pRule, "Wo ist die NumRule?");
                 uno::Reference< container::XIndexReplace >  xRules = new SwXNumberingRules(*pRule);
                 aRet.setValue(&xRules, ::getCppuType((uno::Reference<container::XIndexReplace>*)0));
             }
             break;
             case RES_PARATR_OUTLINELEVEL:
             {
-                DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
+                OSL_ENSURE( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
                 int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
                     aRet <<= static_cast<sal_Int16>( nLevel );
             }
@@ -2264,7 +2264,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
             break;
             case FN_UNO_PARA_STYLE_CONDITIONS:
             {
-                DBG_ASSERT(COND_COMMAND_COUNT == 28,
+                OSL_ENSURE(COND_COMMAND_COUNT == 28,
                         "invalid size of comman count?");
                 uno::Sequence< beans::NamedValue > aSeq(COND_COMMAND_COUNT);
                 beans::NamedValue *pSeq = aSeq.getArray();
@@ -2510,28 +2510,28 @@ void SwXStyle::addPropertyChangeListener(const OUString& /*rPropertyName*/,
     const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXStyle::removePropertyChangeListener(const OUString& /*rPropertyName*/,
     const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXStyle::addVetoableChangeListener(const OUString& /*rPropertyName*/,
     const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
     const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
     throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
@@ -2557,7 +2557,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
     {
         pBasePool->SetSearchMask(eFamily );
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
 
         if(pBase)
         {
@@ -2657,7 +2657,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
     {
         pBasePool->SetSearchMask(eFamily);
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "Where is the style?");
+        OSL_ENSURE(pBase, "Where is the style?");
 
         if(pBase)
         {
@@ -2730,7 +2730,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault(  )
     {
         pBasePool->SetSearchMask(eFamily);
         SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-        DBG_ASSERT(pBase, "where is the style, you fiend!?");
+        OSL_ENSURE(pBase, "where is the style, you fiend!?");
 
         if(pBase)
         {
@@ -2843,7 +2843,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Seq
         {
             pBasePool->SetSearchMask(eFamily);
             SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
-            DBG_ASSERT(pBase, "Doesn't seem to be a style!");
+            OSL_ENSURE(pBase, "Doesn't seem to be a style!");
 
             if(pBase)
             {
@@ -2973,7 +2973,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
         GetBasePool()->SetSearchMask(GetFamily());
         SfxStyleSheetBase* pBase = GetBasePool()->Find(GetStyleName());
         GetBasePool()->SetSearchMask(GetFamily(), nSaveMask );
-        DBG_ASSERT(pBase, "where is the style?" );
+        OSL_ENSURE(pBase, "where is the style?" );
         if(pBase)
             aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
         else
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 64034bb..121c712 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -385,7 +385,7 @@ void lcl_GetCellPosition( const String &rCellName,
         }
     }
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT( rColumn != -1 && rRow != -1, "failed to get column or row index" );
+    OSL_ENSURE( rColumn != -1 && rRow != -1, "failed to get column or row index" );
 #endif
 }
 
@@ -469,13 +469,13 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
     {
         sal_Int32 nCol, nRow2;
         lcl_GetCellPosition( String::CreateFromAscii("z1"), nCol, nRow2);
-        DBG_ASSERT( nCol == 51, "lcl_GetCellPosition failed" );
+        OSL_ENSURE( nCol == 51, "lcl_GetCellPosition failed" );
         lcl_GetCellPosition( String::CreateFromAscii("AA1"), nCol, nRow2);
-        DBG_ASSERT( nCol == 52, "lcl_GetCellPosition failed" );
+        OSL_ENSURE( nCol == 52, "lcl_GetCellPosition failed" );
         lcl_GetCellPosition( String::CreateFromAscii("AB1"), nCol, nRow2);
-        DBG_ASSERT( nCol == 53, "lcl_GetCellPosition failed" );
+        OSL_ENSURE( nCol == 53, "lcl_GetCellPosition failed" );
         lcl_GetCellPosition( String::CreateFromAscii("BB1"), nCol, nRow2);
-        DBG_ASSERT( nCol == 105, "lcl_GetCellPosition failed" );
+        OSL_ENSURE( nCol == 105, "lcl_GetCellPosition failed" );
     }
 #endif
 
@@ -1164,22 +1164,22 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
 
 void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 uno::Reference< container::XEnumeration >  SwXCell::createEnumeration(void) throw( uno::RuntimeException )
@@ -1446,22 +1446,22 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
 
 void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -1845,7 +1845,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
                 break;
                 case RES_BOXATR_FORMAT:
                     //GetAttr fuer Tabellenselektion am Doc fehlt noch
-                    DBG_WARNING("not implemented");
+                    OSL_FAIL("not implemented");
                 break;
                 case FN_UNO_PARA_STYLE:
                 {
@@ -1878,22 +1878,22 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
 
 void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTableCursor::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -3424,22 +3424,22 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
 
 void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
@@ -3939,7 +3939,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
                 break;
                 case RES_BOXATR_FORMAT:
                     //GetAttr fuer Tabellenselektion am Doc fehlt noch
-                    DBG_WARNING("not implemented");
+                    OSL_FAIL("not implemented");
                 break;
                 case FN_UNO_PARA_STYLE:
                 {
@@ -3985,22 +3985,22 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
 
 void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
 }
 
 void SwXCellRange::GetDataSequence(
@@ -4086,7 +4086,7 @@ void SwXCellRange::GetDataSequence(
                             fVal = lcl_getValue(*pXCell);
                         else
                         {
-                            DBG_ASSERT( table::CellContentType_TEXT == pXCell->getType(),
+                            OSL_ENSURE( table::CellContentType_TEXT == pXCell->getType(),
                                     "this branch of 'if' is only for text formatted cells" );
 
                             // now we'll try to get a useful numerical value
@@ -4138,7 +4138,7 @@ void SwXCellRange::GetDataSequence(
             }
         }
     }
-    DBG_ASSERT( nDtaCnt == nSize, "size mismatch. Invalid cell range?" );
+    OSL_ENSURE( nDtaCnt == nSize, "size mismatch. Invalid cell range?" );
     if (pAnySeq)
         pAnySeq->realloc( nDtaCnt );
     else if (pTxtSeq)
@@ -4517,14 +4517,14 @@ void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< char
 
 sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
     return sal_False;
 
 }
 
 double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException )
 {
-    DBG_WARNING("not implemented");
+    OSL_FAIL("not implemented");
     return 0.;
 }
 
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index bca7ade..a1a6bdf 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1001,7 +1001,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
     const uno::Reference<lang::XUnoTunnel> xTunnel(xOwnCursor, uno::UNO_QUERY);
     OTextCursorHelper *const pOwnCursor =
             ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
-    DBG_ASSERT(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? ");
+    OSL_ENSURE(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? ");
     const SwStartNode* pOwnStartNode =
         pOwnCursor->GetPaM()->GetNode()->StartOfSectionNode();
     SwStartNodeType eSearchNodeType = SwNormalStartNode;
@@ -1070,7 +1070,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
     }
     else
     {
-        DBG_ASSERT(*pStart1 == *pStart2,
+        OSL_ENSURE(*pStart1 == *pStart2,
                 "SwPositions should be equal here");
         nCompare = 0;
     }
@@ -2062,7 +2062,7 @@ lcl_ApplyCellProperties(
             else
             {
                 // find the cell that
-                DBG_ASSERT(rMergedCells.size(),
+                OSL_ENSURE(rMergedCells.size(),
                         "the first merged cell is missing");
                 if (rMergedCells.size())
                 {
@@ -2085,7 +2085,7 @@ lcl_ApplyCellProperties(
                         ++aMergedIter;
                     }
 #if OSL_DEBUG_LEVEL > 1
-                    DBG_ASSERT( bDbgFound,
+                    OSL_ENSURE( bDbgFound,
                             "couldn't find first vertically merged cell" );
 #endif
                 }
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 955e98a..846b6e1 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -72,15 +72,15 @@ SwRenderData::~SwRenderData()
 {
     delete m_pViewOptionAdjust;     m_pViewOptionAdjust = 0;
     delete m_pPrtOptions;           m_pPrtOptions = 0;
-    DBG_ASSERT( !m_pPostItShell, "m_pPostItShell should already have been deleted" );
-    DBG_ASSERT( !m_pPostItDoc, "m_pPostItDoc should already have been deleted" );
-    DBG_ASSERT( !m_pPostItFields, " should already have been deleted" );
+    OSL_ENSURE( !m_pPostItShell, "m_pPostItShell should already have been deleted" );
+    OSL_ENSURE( !m_pPostItDoc, "m_pPostItDoc should already have been deleted" );
+    OSL_ENSURE( !m_pPostItFields, " should already have been deleted" );
 }    
 
 
 void SwRenderData::CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev )
 {
-    DBG_ASSERT( !m_pPostItFields && !m_pPostItDoc && !m_pPostItShell, "some post-it data already exists" );
+    OSL_ENSURE( !m_pPostItFields && !m_pPostItDoc && !m_pPostItShell, "some post-it data already exists" );
     m_pPostItFields = new _SetGetExpFlds;
     lcl_GetPostIts( pDoc, m_pPostItFields );
     m_pPostItDoc    = new SwDoc;
@@ -118,7 +118,7 @@ void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rV
 {
     if (m_pViewOptionAdjust)
     {
-        DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" );
+        OSL_ENSURE( 0, "error: there should be no ViewOptionAdjust active when calling this function" );
     }
     m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions );
 }
@@ -196,7 +196,7 @@ SwPrintUIOptions::SwPrintUIOptions(
 {
     ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
 
-    DBG_ASSERT( aLocalizedStrings.Count() >= 30, "resource incomplete" );
+    OSL_ENSURE( aLocalizedStrings.Count() >= 30, "resource incomplete" );
     if( aLocalizedStrings.Count() < 30 ) // bad resource ?
         return;
     
@@ -388,7 +388,7 @@ SwPrintUIOptions::SwPrintUIOptions(
         // 0 : all pages (left & right)
         // 1 : left pages
         // 2 : right pages
-        DBG_ASSERT( rDefaultPrintData.IsPrintLeftPage() || rDefaultPrintData.IsPrintRightPage(), 
+        OSL_ENSURE( rDefaultPrintData.IsPrintLeftPage() || rDefaultPrintData.IsPrintRightPage(),
                 "unexpected value combination" );
         sal_Int16 nPagesChoice = 0;
         if (rDefaultPrintData.IsPrintLeftPage() && !rDefaultPrintData.IsPrintRightPage())
@@ -440,7 +440,7 @@ SwPrintUIOptions::SwPrintUIOptions(
     }
     
 
-    DBG_ASSERT( nIdx == nNumProps, "number of added properties is not as expected" );
+    OSL_ENSURE( nIdx == nNumProps, "number of added properties is not as expected" );
 }
 
 
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index ec7813e..95d60eb 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -92,7 +92,7 @@ void ViewShell::PrintProspect(
 {
     const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagePairsForProspectPrinting().size() - 1;
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
+    OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
 #endif
     Printer *pPrinter = dynamic_cast< Printer * >(pOutDev);
     if (!pPrinter || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer)
@@ -105,8 +105,8 @@ void ViewShell::PrintProspect(
     std::pair< sal_Int32, sal_Int32 > rPagesToPrint = 
             rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ];
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT( rPagesToPrint.first  == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
-    DBG_ASSERT( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
+    OSL_ENSURE( rPagesToPrint.first  == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
+    OSL_ENSURE( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
 #endif
 
     // create a new shell for the Printer
@@ -129,13 +129,13 @@ void ViewShell::PrintProspect(
     if (rPagesToPrint.first > 0)
     {
         SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.first ) );
-        DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+        OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
         pStPage = aIt->second;
     }
     if (rPagesToPrint.second > 0)
     {
         SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.second ) );
-        DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+        OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
         pNxtPage = aIt->second;
     }
 
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bcae1df..669c5e8 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -632,7 +632,7 @@ void ViewShell::LayoutIdle()
 
         SwSaveSetLRUOfst aSave( *SwTxtFrm::GetTxtCache(),
                              SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
-        DBG_ASSERT(Imp(), "ViewShell already deleted?");
+        OSL_ENSURE(Imp(), "ViewShell already deleted?");
         if(!Imp())
             return;
         SwLayIdle aIdle( GetLayout(), Imp() );
@@ -2094,7 +2094,7 @@ void ViewShell::UISizeNotify()
 
 void    ViewShell::SetRestoreActions(sal_uInt16 nSet)
 {
-    DBG_ASSERT(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions ?");
+    OSL_ENSURE(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions ?");
     Imp()->SetRestoreActions(nSet);
 }
 sal_uInt16 	ViewShell::GetRestoreActions() const
@@ -2124,7 +2124,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create
 uno::Reference< ::com::sun::star::accessibility::XAccessible >
 ViewShell::CreateAccessiblePreview()
 {
-    DBG_ASSERT( IsPreView(),
+    OSL_ENSURE( IsPreView(),
                 "Can't create accessible preview for non-preview ViewShell" );
 
     // We require a layout and an XModel to be accessible.
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index f3cd6ed..f1a3794 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -447,7 +447,7 @@ sal_Bool ViewShell::PrintOrPDFExport(
 
     const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagesToPrint().size() - 1;
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
+    OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
 #endif
     if (!pOutDev || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer)
         return sal_False;
@@ -485,24 +485,24 @@ sal_Bool ViewShell::PrintOrPDFExport(
 
         const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ nRenderer ];
 #if OSL_DEBUG_LEVEL > 1
-        DBG_ASSERT( nPage == 0 || rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, "nPage not valid" );
+        OSL_ENSURE( nPage == 0 || rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, "nPage not valid" );
 #endif
         const SwPageFrm *pStPage = 0;
         if (nPage > 0)  // a 'regular' page, not one from the post-it document
         {
             const SwRenderData::ValidStartFramesMap_t &rFrms = rPrintData.GetRenderData().GetValidStartFrames();
             SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( nPage ) );
-            DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+            OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
             if (aIt == rFrms.end())
                 return sal_False;
             pStPage = aIt->second;
         }
         else    // a page from the post-its document ...
         {
-            DBG_ASSERT( nPage == 0, "unexpected page number. 0 for post-it pages expected" );
+            OSL_ENSURE( nPage == 0, "unexpected page number. 0 for post-it pages expected" );
             pStPage = rPrintData.GetRenderData().GetPostItStartFrames()[ nRenderer ];
         }
-        DBG_ASSERT( pStPage, "failed to get start page" );
+        OSL_ENSURE( pStPage, "failed to get start page" );
 
         //!! applying view options and formatting the dcoument should now only be done in getRendererCount!
 
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 942d864..1cc399f 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -474,7 +474,7 @@ SwDoc* Reader::GetTemplateDoc()
     {
         INetURLObject aTDir( aTemplateNm );
         String aFileName = aTDir.GetMainURL( INetURLObject::NO_DECODE );
-        DBG_ASSERT( !aTDir.HasError(), "No absolute path for template name!" );
+        OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" );
         DateTime aCurrDateTime;
         sal_Bool bLoad = sal_False;
 
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index bac3c23..2d10e6f 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -628,7 +628,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
             {
                 nNumStart = static_cast< sal_uInt16 >(pTxtNd->GetActualListStartValue());
             }
-            DBG_ASSERT( rHWrt.nLastParaToken == 0,
+            OSL_ENSURE( rHWrt.nLastParaToken == 0,
                 "<PRE> wurde nicht vor <LI> beendet." );
         }
     }
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index b6d3efd..ec14987 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1766,7 +1766,7 @@ sal_Bool SwHTMLParser::FileDownload( const String& rURL,
         aStream << *pStream;
 
         aStream.Seek( STREAM_SEEK_TO_END );
-        DBG_ASSERT( aStream.Tell() < STRING_MAXLEN,
+        OSL_ENSURE( aStream.Tell() < STRING_MAXLEN,
                     "File zu lang fuer einen String, Ende abgeschnitten" );
         xub_StrLen nLen = aStream.Tell() < STRING_MAXLEN
                         ? (xub_StrLen)aStream.Tell()
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index bcf7346..0570f6a 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -282,13 +282,13 @@ void SwHTMLParser::NewField()
         SvtUserOptions aOpt;
         const String& rUser = aOpt.GetFullName();
         SwDocShell *pDocShell(pDoc->GetDocShell());
-        DBG_ASSERT(pDocShell, "no SwDocShell");
+        OSL_ENSURE(pDocShell, "no SwDocShell");
         if (pDocShell) {
             uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
                 pDocShell->GetModel(), uno::UNO_QUERY_THROW);
             uno::Reference<document::XDocumentProperties> xDocProps(
                 xDPS->getDocumentProperties());
-            DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+            OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
             const String& rChanged = xDocProps->getModifiedBy();
             const String& rCreated = xDocProps->getAuthor();
             if( !rUser.Len() ||
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index c4447b1..0db2cd3 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -972,7 +972,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
 
         xShape = uno::Reference< drawing::XShape >( xCreate, UNO_QUERY );
 
-        DBG_ASSERT( xShape.is(), "XShape nicht erhalten" );
+        OSL_ENSURE( xShape.is(), "XShape nicht erhalten" );
         awt::Size aTmpSz;
         aTmpSz.Width  = rSize.Width();
         aTmpSz.Height = rSize.Height();
@@ -1415,7 +1415,7 @@ void SwHTMLParser::NewForm( sal_Bool bAppend )
         return;
 
     uno::Reference< XForm >  xForm( xInt, UNO_QUERY );
-    DBG_ASSERT( xForm.is(), "keine Form?" );
+    OSL_ENSURE( xForm.is(), "keine Form?" );
 
     uno::Reference< container::XIndexContainer > xFormComps( xForm, UNO_QUERY );
     pFormImpl->SetFormComps( xFormComps );
@@ -2119,7 +2119,7 @@ void SwHTMLParser::NewTextArea()
     }
 
     uno::Reference< XFormComponent > xFComp( xInt, UNO_QUERY );
-    DBG_ASSERT( xFComp.is(), "keine FormComponent?" );
+    OSL_ENSURE( xFComp.is(), "keine FormComponent?" );
 
     uno::Reference< beans::XPropertySet > xPropSet( xFComp, UNO_QUERY );
 
@@ -2398,7 +2398,7 @@ void SwHTMLParser::NewSelect()
     }
 
     uno::Reference< XFormComponent > xFComp( xInt, UNO_QUERY );
-    DBG_ASSERT(xFComp.is(), "keine FormComponent?");
+    OSL_ENSURE(xFComp.is(), "keine FormComponent?");
 
     uno::Reference< beans::XPropertySet >  xPropSet( xFComp, UNO_QUERY );
 
diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx
index 47c48b2..7a9ed66 100644
--- a/sw/source/filter/html/htmlnum.cxx
+++ b/sw/source/filter/html/htmlnum.cxx
@@ -796,7 +796,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt,
     }
 
 
-    DBG_ASSERT( rWrt.nLastParaToken == 0,
+    OSL_ENSURE( rWrt.nLastParaToken == 0,
                 "<PRE> wurde nicht vor <OL> beendet." );
     sal_uInt16 nPrevDepth =
         (bSameRule && !rInfo.IsRestart()) ? rPrevInfo.GetDepth() : 0;
@@ -909,7 +909,7 @@ Writer& OutHTML_NumBulListEnd( SwHTMLWriter& rWrt,
         return rWrt;
     }
 
-    DBG_ASSERT( rWrt.nLastParaToken == 0,
+    OSL_ENSURE( rWrt.nLastParaToken == 0,
                 "<PRE> wurde nicht vor </OL> beendet." );
     sal_uInt16 nNextDepth =
         (bSameRule && !rNextInfo.IsRestart()) ? rNextInfo.GetDepth() : 0;
diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index f4dc79a..2472562 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -54,7 +54,7 @@
 #define LOOP_CHECK_RESTART \
     nOldInPos = STRING_MAXLEN;
 #define LOOP_CHECK_CHECK( where ) \
-    DBG_ASSERT( nOldInPos!=nInPos || cNextCh==(sal_Unicode)EOF, where );	\
+    OSL_ENSURE( nOldInPos!=nInPos || cNextCh==(sal_Unicode)EOF, where );	\
     if( nOldInPos==nInPos && cNextCh!=(sal_Unicode)EOF )					\
         break;																\
     else																	\
@@ -462,7 +462,7 @@ CSS1Token CSS1Parser::GetNextToken()
                         }
 
                         double nScale = 0.0;
-                        DBG_ASSERT( pCmp1, "Wo kommt das erste Zeichen her?" );
+                        OSL_ENSURE( pCmp1, "Wo kommt das erste Zeichen her?" );
                         if( aIdent.EqualsIgnoreCaseAscii(pCmp1) )
                         {
                             nScale = nScale1;
@@ -966,7 +966,7 @@ CSS1Selector *CSS1Parser::ParseSelector()
         // falls ein Selektor angelegt wurd, ihn speichern
         if( pNew )
         {
-            DBG_ASSERT( (pRoot!=0) == (pLast!=0),
+            OSL_ENSURE( (pRoot!=0) == (pLast!=0),
                     "Root-Selektor, aber kein Last" );
             if( pLast )
                 pLast->SetNext( pNew );
@@ -1113,7 +1113,7 @@ CSS1Expression *CSS1Parser::ParseDeclaration( String& rProperty )
         // falls ein Expression angelegt wurde, diesen speichern
         if( pNew )
         {
-            DBG_ASSERT( (pRoot!=0) == (pLast!=0),
+            OSL_ENSURE( (pRoot!=0) == (pLast!=0),
                     "Root-Selektor, aber kein Last" );
             if( pLast )
                 pLast->SetNext( pNew );
@@ -1259,9 +1259,9 @@ CSS1Expression::~CSS1Expression()
 
 sal_Bool CSS1Expression::GetURL( String& rURL  ) const
 {
-    DBG_ASSERT( CSS1_URL==eType, "CSS1-Ausruck ist keine Farbe URL" );
+    OSL_ENSURE( CSS1_URL==eType, "CSS1-Ausruck ist keine Farbe URL" );
 
-    DBG_ASSERT( aValue.CompareIgnoreCaseToAscii( sCSS1_url, 3 ) ==
+    OSL_ENSURE( aValue.CompareIgnoreCaseToAscii( sCSS1_url, 3 ) ==
                                         COMPARE_EQUAL &&
                 aValue.Len() > 5 &&
                 '(' == aValue.GetChar(3) &&
@@ -1283,7 +1283,7 @@ sal_Bool CSS1Expression::GetURL( String& rURL  ) const
 
 sal_Bool CSS1Expression::GetColor( Color &rColor ) const
 {
-    DBG_ASSERT( CSS1_IDENT==eType || CSS1_RGB==eType ||
+    OSL_ENSURE( CSS1_IDENT==eType || CSS1_RGB==eType ||
                 CSS1_HEXCOLOR==eType || CSS1_STRING==eType,
                 "CSS1-Ausruck kann keine Farbe sein" );
 
@@ -1296,7 +1296,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
         {
             sal_uInt8 aColors[3] = { 0, 0, 0 };
 
-            DBG_ASSERT( aValue.CompareIgnoreCaseToAscii( sCSS1_rgb, 3 )
+            OSL_ENSURE( aValue.CompareIgnoreCaseToAscii( sCSS1_rgb, 3 )
                                             == COMPARE_EQUAL &&
                         aValue.Len() > 5 &&
                         '(' == aValue.GetChar( 3 ) &&
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index fd6d1f0..9359a29 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -717,7 +717,7 @@ sal_Bool SvxCSS1Parser::SelectorParsed( const CSS1Selector *pSelector,
 {
     if( bFirst )
     {
-        DBG_ASSERT( pSheetItemSet, "Where is the Item-Set for Style-Sheets?" );
+        OSL_ENSURE( pSheetItemSet, "Where is the Item-Set for Style-Sheets?" );
 
         // Dieses ist der erste Selektor einer Rule, also muessen
         // die bisher geparsten Items auf die Styles verteilt werden
@@ -743,7 +743,7 @@ sal_Bool SvxCSS1Parser::SelectorParsed( const CSS1Selector *pSelector,
 sal_Bool SvxCSS1Parser::DeclarationParsed( const String& rProperty,
                                        const CSS1Expression *pExpr )
 {
-    DBG_ASSERT( pExpr, "DeclarationParsed() without Expression" );
+    OSL_ENSURE( pExpr, "DeclarationParsed() without Expression" );
 
     if( !pExpr )
         return sal_True;
@@ -1017,7 +1017,7 @@ static void ParseCSS1_font_size( const CSS1Expression *pExpr,
                                  SvxCSS1PropertyInfo& /*rPropInfo*/,
                                  const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uLong nHeight = 0;
     sal_uInt16 nPropHeight = 100;
@@ -1082,7 +1082,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr,
                                    SvxCSS1PropertyInfo& /*rPropInfo*/,
                                    const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     String aName, aStyleName, aDfltName;
     FontFamily eFamily = FAMILY_DONTKNOW;
@@ -1163,7 +1163,7 @@ static void ParseCSS1_font_weight( const CSS1Expression *pExpr,
                                    SvxCSS1PropertyInfo& /*rPropInfo*/,
                                    const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     switch( pExpr->GetType() )
     {
@@ -1222,7 +1222,7 @@ static void ParseCSS1_font_style( const CSS1Expression *pExpr,
                                   SvxCSS1PropertyInfo& /*rPropInfo*/,
                                   const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_Bool bPosture = sal_False;
     sal_Bool bCaseMap = sal_False;
@@ -1293,7 +1293,7 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr,
                                     SvxCSS1PropertyInfo& /*rPropInfo*/,
                                     const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     // normal | small-caps
 
@@ -1321,7 +1321,7 @@ static void ParseCSS1_color( const CSS1Expression *pExpr,
                              SvxCSS1PropertyInfo& /*rPropInfo*/,
                              const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     switch( pExpr->GetType() )
     {
@@ -1345,7 +1345,7 @@ static void ParseCSS1_direction( const CSS1Expression *pExpr,
                              SvxCSS1PropertyInfo& /*rPropInfo*/,
                              const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nDir;
     switch( pExpr->GetType() )
@@ -1369,7 +1369,7 @@ static void ParseCSS1_direction( const CSS1Expression *pExpr,
 
 static void MergeHori( SvxGraphicPosition& ePos, SvxGraphicPosition eHori )
 {
-    DBG_ASSERT( GPOS_LT==eHori || GPOS_MT==eHori || GPOS_RT==eHori,
+    OSL_ENSURE( GPOS_LT==eHori || GPOS_MT==eHori || GPOS_RT==eHori,
                 "vertical position not at the top" );
 
     switch( ePos )
@@ -1399,7 +1399,7 @@ static void MergeHori( SvxGraphicPosition& ePos, SvxGraphicPosition eHori )
 
 static void MergeVert( SvxGraphicPosition& ePos, SvxGraphicPosition eVert )
 {
-    DBG_ASSERT( GPOS_LT==eVert || GPOS_LM==eVert || GPOS_LB==eVert,
+    OSL_ENSURE( GPOS_LT==eVert || GPOS_LM==eVert || GPOS_LB==eVert,
                 "horizontal position not on the left side" );
 
     switch( ePos )
@@ -1432,7 +1432,7 @@ static void ParseCSS1_background( const CSS1Expression *pExpr,
                                   SvxCSS1PropertyInfo& /*rPropInfo*/,
                                   const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     Color aColor;
     String aURL;
@@ -1572,7 +1572,7 @@ static void ParseCSS1_background_color( const CSS1Expression *pExpr,
                                   SvxCSS1PropertyInfo& /*rPropInfo*/,
                                   const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     Color aColor;
 
@@ -1620,7 +1620,7 @@ static void ParseCSS1_line_height( const CSS1Expression *pExpr,
                                    SvxCSS1PropertyInfo& /*rPropInfo*/,
                                    const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nHeight = 0;
     sal_uInt8 nPropHeight = 0;
@@ -1685,7 +1685,7 @@ static void ParseCSS1_font( const CSS1Expression *pExpr,
                             SvxCSS1PropertyInfo& rPropInfo,
                             const SvxCSS1Parser& rParser )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     FontItalic eItalic = ITALIC_NONE;
     SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
@@ -1795,7 +1795,7 @@ static void ParseCSS1_letter_spacing( const CSS1Expression *pExpr,
                                       SvxCSS1PropertyInfo& /*rPropInfo*/,
                                       const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     switch( pExpr->GetType() )
     {
@@ -1840,7 +1840,7 @@ static void ParseCSS1_text_decoration( const CSS1Expression *pExpr,
                                        SvxCSS1PropertyInfo& /*rPropInfo*/,
                                        const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_Bool bUnderline = sal_False;
     sal_Bool bOverline = sal_False;
@@ -1950,7 +1950,7 @@ static void ParseCSS1_text_align( const CSS1Expression *pExpr,
                                   SvxCSS1PropertyInfo& /*rPropInfo*/,
                                   const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     if( CSS1_IDENT==pExpr->GetType() ||
         CSS1_STRING==pExpr->GetType() ) // MS-IE, mal wieder
@@ -1972,7 +1972,7 @@ static void ParseCSS1_text_indent( const CSS1Expression *pExpr,
                                    SvxCSS1PropertyInfo& rPropInfo,
                                    const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     short nIndent = 0;
     sal_Bool bSet = sal_False;
@@ -2025,7 +2025,7 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
                                    SvxCSS1PropertyInfo& rPropInfo,
                                    const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     long nLeft = 0;
     sal_Bool bSet = sal_False;
@@ -2082,7 +2082,7 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
                                     SvxCSS1PropertyInfo& rPropInfo,
                                     const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     long nRight = 0;
     sal_Bool bSet = sal_False;
@@ -2139,7 +2139,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
                                   SvxCSS1PropertyInfo& rPropInfo,
                                   const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nUpper = 0;
     sal_Bool bSet = sal_False;
@@ -2199,7 +2199,7 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
                                      SvxCSS1PropertyInfo& rPropInfo,
                                      const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nLower = 0;
     sal_Bool bSet = sal_False;
@@ -2259,7 +2259,7 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
                               SvxCSS1PropertyInfo& rPropInfo,
                               const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     long nMargins[4] = { 0, 0, 0, 0 };
     sal_Bool bSetMargins[4] = { sal_False, sal_False, sal_False, sal_False };
@@ -2402,7 +2402,7 @@ static sal_Bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr,
                                    const SvxCSS1Parser& /*rParser*/,
                                    sal_uInt16 nWhichLine )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_Bool bSet = sal_False;
     sal_uInt16 nDist = 0;
@@ -2524,7 +2524,7 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr,
                                   const SvxCSS1Parser& /*rParser*/,
                                   sal_uInt16 nWhichLine, sal_Bool bAll )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nWidth = USHRT_MAX;		// die Linien-Dicke
     sal_uInt16 nNWidth = 1;    			// benannte Linien-Dicke (und default)
@@ -2619,7 +2619,7 @@ static void ParseCSS1_border_xxx_width( const CSS1Expression *pExpr,
                                         const SvxCSS1Parser& /*rParser*/,
                                         sal_uInt16 nWhichLine )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     sal_uInt16 nWidth = USHRT_MAX;		// die Linien-Dicke
     sal_uInt16 nNWidth = 1;    			// benannte Linien-Dicke (und default)
@@ -2811,7 +2811,7 @@ static void ParseCSS1_float( const CSS1Expression *pExpr,
                              SvxCSS1PropertyInfo& rPropInfo,
                              const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     if( CSS1_IDENT==pExpr->GetType() )
     {
@@ -2829,7 +2829,7 @@ static void ParseCSS1_position( const CSS1Expression *pExpr,
                                 SvxCSS1PropertyInfo& rPropInfo,
                                 const SvxCSS1Parser& /*rParser*/ )
 {
-    DBG_ASSERT( pExpr, "no expression" );
+    OSL_ENSURE( pExpr, "no expression" );
 
     if( CSS1_IDENT==pExpr->GetType() )
     {
@@ -3208,7 +3208,7 @@ static int
 void SvxCSS1Parser::ParseProperty( const String& rProperty,
                                    const CSS1Expression *pExpr )
 {
-    DBG_ASSERT( pItemSet, "DeclarationParsed() without ItemSet" );
+    OSL_ENSURE( pItemSet, "DeclarationParsed() without ItemSet" );
 
     if( !bSortedPropFns )
     {
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 3cf9a03..3cef695 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -853,13 +853,13 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
         if( IsNewDoc() )
         {
             SwDocShell *pDocShell(pDoc->GetDocShell());
-            DBG_ASSERT(pDocShell, "no SwDocShell");
+            OSL_ENSURE(pDocShell, "no SwDocShell");
             if (pDocShell) {
                 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
                     pDocShell->GetModel(), uno::UNO_QUERY_THROW);
                 uno::Reference<document::XDocumentProperties> xDocProps(
                     xDPS->getDocumentProperties());
-                DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+                OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
                 if ( xDocProps.is() && (xDocProps->getAutoloadSecs() > 0) &&
                      (xDocProps->getAutoloadURL().getLength() == 0) )
                 {
@@ -1013,7 +1013,7 @@ void SwHTMLParser::NextToken( int nToken )
                             uno::UNO_QUERY_THROW);
                         uno::Reference<document::XDocumentProperties> xDocProps(
                             xDPS->getDocumentProperties());
-                        DBG_ASSERT(xDocProps.is(), "no DocumentProperties");
+                        OSL_ENSURE(xDocProps.is(), "no DocumentProperties");
                         if (xDocProps.is()) {
                             xDocProps->setTitle(sTitle);
                         }
@@ -1315,13 +1315,13 @@ void SwHTMLParser::NextToken( int nToken )
                     if( IsNewDoc() )
                     {
                         SwDocShell *pDocShell(pDoc->GetDocShell());
-                        DBG_ASSERT(pDocShell, "no SwDocShell");
+                        OSL_ENSURE(pDocShell, "no SwDocShell");
                         if (pDocShell) {
                             uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
                                 pDocShell->GetModel(), uno::UNO_QUERY_THROW);
                             uno::Reference<document::XDocumentProperties>
                                 xDocProps(xDPS->getDocumentProperties());
-                            DBG_ASSERT(xDocProps.is(),"no DocumentProperties");
+                            OSL_ENSURE(xDocProps.is(),"no DocumentProperties");
                             if (xDocProps.is()) {
                                 xDocProps->setDefaultTarget(
                                     pOption->GetString());
@@ -1344,7 +1344,7 @@ void SwHTMLParser::NextToken( int nToken )
                     pHTTPHeader = pDocSh->GetHeaderAttributes();
             }
             SwDocShell *pDocShell(pDoc->GetDocShell());
-            DBG_ASSERT(pDocShell, "no SwDocShell");
+            OSL_ENSURE(pDocShell, "no SwDocShell");
             if (pDocShell)
             {
                 uno::Reference<document::XDocumentProperties> xDocProps;
@@ -1353,7 +1353,7 @@ void SwHTMLParser::NextToken( int nToken )
                     const uno::Reference<document::XDocumentPropertiesSupplier>
                         xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
                     xDocProps = xDPS->getDocumentProperties();
-                    DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+                    OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
                 }
                 ParseMetaOptions( xDocProps, pHTTPHeader );
             }
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index f7f48f0..47a734a 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -153,7 +153,7 @@ sal_uLong RtfReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, con
 
     sal_uLong nRet = 0;
     SwDocShell *pDocShell(rDoc.GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     uno::Reference<document::XDocumentProperties> xDocProps;
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index f1dd20d..91539d3 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -66,7 +66,7 @@ Ww1PlainText::Ww1PlainText(Ww1Fib& rWwFib, sal_uLong nFilePos, sal_uLong nCountB
 
 sal_Unicode Ww1PlainText::operator [] ( sal_uLong ulOffset )
 {
-    DBG_ASSERT( ulOffset<Count(), "Ww1PlainText" );
+    OSL_ENSURE( ulOffset<Count(), "Ww1PlainText" );
     sal_Unicode cRet;
     sal_Char cRead;
     if( rFib.GetStream().Seek( ulFilePos + ulOffset ) == ulFilePos+ulOffset &&
@@ -83,7 +83,7 @@ String Ww1PlainText::GetText( sal_uLong ulOffset, sal_uLong nLen ) const
 {
     String sRet;
     ByteString aStr;
-    DBG_ASSERT(ulOffset+nLen<Count(), "Ww1PlainText");
+    OSL_ENSURE(ulOffset+nLen<Count(), "Ww1PlainText");
     if( rFib.GetStream().Seek(ulFilePos+ulOffset) == ulFilePos+ulOffset &&
         rFib.GetStream().Read( aStr.AllocBuffer( static_cast< xub_StrLen >(nLen) ), nLen ) == nLen )
         sRet = String( aStr, RTL_TEXTENCODING_MS_1252 );
@@ -170,7 +170,7 @@ sal_uInt16 Ww1Style::ReadName( sal_uInt8*&p, sal_uInt16& rnCountBytes, sal_uInt1
     {
         SetName( String( (sal_Char*)p, nCountBytes, RTL_TEXTENCODING_MS_1252 ));
         p += nCountBytes;
-        DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+        OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
         rnCountBytes = rnCountBytes - nCountBytes;
     }
     return 0;
@@ -188,7 +188,7 @@ sal_uInt16 Ww1Style::ReadChpx( sal_uInt8*&p, sal_uInt16& rnCountBytes )
             nCountBytes = sizeof(aChpx);
         memcpy( &aChpx, p, nCountBytes );
         p += nCountBytes;
-        DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+        OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
         rnCountBytes = rnCountBytes - nCountBytes;
     }
     return 0;
@@ -203,7 +203,7 @@ sal_uInt16 Ww1Style::ReadPapx(sal_uInt8*&p, sal_uInt16& rnCountBytes)
     {
         pPapx = new Ww1SprmPapx(p, nCountBytes);
         p += nCountBytes;
-        DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+        OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
         rnCountBytes = rnCountBytes - nCountBytes;
     }
     else
@@ -218,7 +218,7 @@ sal_uInt16 Ww1Style::ReadEstcp(sal_uInt8*&p, sal_uInt16& rnCountBytes)
     rnCountBytes--;
     stcBase = SVBT8ToByte(p);
     p++;
-    DBG_ASSERT(rnCountBytes>0, "Ww1Style");
+    OSL_ENSURE(rnCountBytes>0, "Ww1Style");
     rnCountBytes--;
     return 0;
 }
@@ -230,7 +230,7 @@ Ww1StyleSheet::Ww1StyleSheet(Ww1Fib& _rFib)
     bOK(sal_False)
 {
     sal_uInt16 cbStshf = rFib.GetFIB().cbStshfGet();
-    DBG_ASSERT(cbStshf>=17, "Ww1StyleSheet");
+    OSL_ENSURE(cbStshf>=17, "Ww1StyleSheet");
     for (sal_uInt16 stc=0;stc<Count();stc++)
     {
         aStyles[stc].SetParent(this);
@@ -250,7 +250,7 @@ Ww1StyleSheet::Ww1StyleSheet(Ww1Fib& _rFib)
             ReadChpx(p, cbStshf);
             ReadPapx(p, cbStshf);
             ReadEstcp(p, cbStshf);
-            DBG_ASSERT(cbStshf==0, "Ww1StyleSheet");
+            OSL_ENSURE(cbStshf==0, "Ww1StyleSheet");
             bOK = cbStshf == 0;
         }
     delete [] del;
@@ -260,7 +260,7 @@ sal_uInt16 Ww1StyleSheet::ReadNames( sal_uInt8*& p, sal_uInt16& rnCountBytes )
 {
     sal_uInt16 nCountBytes = SVBT16ToShort(p);
     p += sizeof(SVBT16);
-    DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+    OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
     rnCountBytes = rnCountBytes - nCountBytes;
     nCountBytes = nCountBytes - sizeof(SVBT16);
     sal_uInt16 stcp = 0;
@@ -270,7 +270,7 @@ sal_uInt16 Ww1StyleSheet::ReadNames( sal_uInt8*& p, sal_uInt16& rnCountBytes )
         aStyles[stc].ReadName(p, nCountBytes, stc);
         stcp++;
     }
-    DBG_ASSERT(nCountBytes==0, "Ww1StyleSheet");
+    OSL_ENSURE(nCountBytes==0, "Ww1StyleSheet");
     return 0;
 }
 
@@ -278,7 +278,7 @@ sal_uInt16 Ww1StyleSheet::ReadChpx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
 {
     sal_uInt16 nCountBytes = SVBT16ToShort(p);
     p += sizeof(SVBT16);
-    DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+    OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
     rnCountBytes = rnCountBytes - nCountBytes;
     nCountBytes = nCountBytes - sizeof(SVBT16);
     sal_uInt16 stcp = 0;
@@ -288,7 +288,7 @@ sal_uInt16 Ww1StyleSheet::ReadChpx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
         aStyles[stc].ReadChpx(p, nCountBytes);
         stcp++;
     }
-    DBG_ASSERT(nCountBytes == 0, "Ww1StyleSheet");
+    OSL_ENSURE(nCountBytes == 0, "Ww1StyleSheet");
     return 0;
 }
 
@@ -296,7 +296,7 @@ sal_uInt16 Ww1StyleSheet::ReadPapx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
 {
     sal_uInt16 nCountBytes = SVBT16ToShort(p);
     p += sizeof(SVBT16);
-    DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+    OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
     rnCountBytes = rnCountBytes - nCountBytes;
     nCountBytes = nCountBytes - sizeof(SVBT16);
     sal_uInt16 stcp = 0;
@@ -306,7 +306,7 @@ sal_uInt16 Ww1StyleSheet::ReadPapx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
         aStyles[stc].ReadPapx(p, nCountBytes);
         stcp++;
     }
-    DBG_ASSERT(nCountBytes == 0, "Ww1StyleSheet");
+    OSL_ENSURE(nCountBytes == 0, "Ww1StyleSheet");
     return 0;
 }
 
@@ -314,14 +314,14 @@ sal_uInt16 Ww1StyleSheet::ReadEstcp(sal_uInt8*& p, sal_uInt16& rnCountBytes)
 {
     sal_uInt16 iMac = SVBT16ToShort(p);
     p += sizeof(SVBT16);
-    DBG_ASSERT(rnCountBytes>=sizeof(SVBT16), "Ww1StyleSheet");
+    OSL_ENSURE(rnCountBytes>=sizeof(SVBT16), "Ww1StyleSheet");
     rnCountBytes -= sizeof(SVBT16);
     for (sal_uInt16 stcp=0;stcp<iMac;stcp++)
     {
         sal_uInt16 stc = (stcp - cstcStd) & 255;
         aStyles[stc].ReadEstcp(p, rnCountBytes);
     }
-    DBG_ASSERT(rnCountBytes==0, "Ww1StyleSheet");
+    OSL_ENSURE(rnCountBytes==0, "Ww1StyleSheet");
     return 0;
 }
 
@@ -333,13 +333,13 @@ Ww1Fonts::Ww1Fonts(Ww1Fib& rInFib, sal_uLong nFieldFlgs)
     if(rFib.GetFIB().cbSttbfffnGet() > 2 ) // ueberhaupt fonts?
     {
         SVBT16 nCountBytes;
-        DBG_ASSERT(rFib.GetFIB().cbSttbfffnGet() > sizeof(nCountBytes), "Ww1Fonts");
+        OSL_ENSURE(rFib.GetFIB().cbSttbfffnGet() > sizeof(nCountBytes), "Ww1Fonts");
         if (rFib.GetStream().Seek(rFib.GetFIB().fcSttbfffnGet())
          == (sal_uLong)rFib.GetFIB().fcSttbfffnGet())
             if (rFib.GetStream().Read(nCountBytes, sizeof(nCountBytes))
              == sizeof(nCountBytes)) // Laenge steht hier nochmal
             {
-                DBG_ASSERT(SVBT16ToShort(nCountBytes)
+                OSL_ENSURE(SVBT16ToShort(nCountBytes)
                  == rFib.GetFIB().cbSttbfffnGet(), "redundant-size missmatch");
                  // hoffentlich sind sie immer gleich
                 W1_FFN* pA = (W1_FFN*)new char[rFib.GetFIB().cbSttbfffnGet()
@@ -421,7 +421,7 @@ Ww1Picture::Ww1Picture(SvStream& rStream, sal_uLong ulFilePos)
                     if (rStream.Seek(ulFilePos) == (sal_uLong)ulFilePos)
                         if (rStream.Read(pPic, SVBT32ToUInt32(lcb)) == (sal_uLong)SVBT32ToUInt32(lcb))
                         {
-                            DBG_ASSERT(pPic->cbHeaderGet()==sizeof(*pPic)-sizeof(pPic->rgb), "Ww1Picture");
+                            OSL_ENSURE(pPic->cbHeaderGet()==sizeof(*pPic)-sizeof(pPic->rgb), "Ww1Picture");
                             bOK = true;
                         }
 }
@@ -479,7 +479,7 @@ sal_uInt16 Ww1SingleSprm::Size(sal_uInt8* /*pSprm*/)
 
 sal_uInt16 Ww1SingleSprmTab::Size(sal_uInt8* pSprm) // Doc 24/25, Fastsave-Sprm
 {
-    DBG_ASSERT(nCountBytes==0, "Ww1SingleSprmTab");
+    OSL_ENSURE(nCountBytes==0, "Ww1SingleSprmTab");
     sal_uInt16 nRet = sizeof(SVBT8);
     sal_uInt16 nSize = SVBT8ToByte(pSprm);
     if (nSize != 255)
@@ -490,7 +490,7 @@ sal_uInt16 Ww1SingleSprmTab::Size(sal_uInt8* pSprm) // Doc 24/25, Fastsave-Sprm
         sal_uInt16 nIns = SVBT8ToByte(pSprm + 3 + nDel) * 3;
         nRet += nDel + nIns;
     }
-    DBG_ASSERT(nRet <= 354, "Ww1SingleSprmTab");
+    OSL_ENSURE(nRet <= 354, "Ww1SingleSprmTab");
     if (nRet > 354)
         nRet = 0;
     return nRet;
@@ -527,7 +527,7 @@ sal_uInt16 Ww1Sprm::GetSize(sal_uInt8 nId, sal_uInt8* pSprm)
 
 sal_Bool Ww1Sprm::Fill(sal_uInt16 index, sal_uInt8& nId, sal_uInt16& nL, sal_uInt8*& pSprm)
 {
-    DBG_ASSERT(index < Count(), "Ww1Sprm");
+    OSL_ENSURE(index < Count(), "Ww1Sprm");
     pSprm = p + pArr[index];
     nId = SVBT8ToByte(pSprm);
     pSprm++;
@@ -548,7 +548,7 @@ sal_Bool Ww1Sprm::ReCalc()
         while (cbsik > 0)
         {
             sal_uInt16 iLen = GetSizeBrutto(psik);
-            DBG_ASSERT(iLen<=cbsik, "Ww1Sprm");
+            OSL_ENSURE(iLen<=cbsik, "Ww1Sprm");
             if (iLen > cbsik)
                 cbsik = 0; // ignore the rest: we are wrong...
             else
@@ -753,7 +753,7 @@ Ww1Plc::Ww1Plc(Ww1Fib& rInFib, sal_uLong ulFilePos, sal_uInt16 nInCountBytes,
                     bOK = true;
                     iMac = (nCountBytes -
                         sizeof(SVBT32)) / (sizeof(SVBT32) + nItemSize);
-                    DBG_ASSERT(iMac * ((sal_uInt16)sizeof(sal_uLong) + nItemSize) +
+                    OSL_ENSURE(iMac * ((sal_uInt16)sizeof(sal_uLong) + nItemSize) +
                      (sal_uInt16)sizeof(SVBT32) == nCountBytes, "Ww1Plc");
                 }
             }
@@ -776,7 +776,7 @@ void Ww1Plc::Seek(sal_uLong ulSeek, sal_uInt16& nIndex)
 sal_uLong Ww1Plc::Where(sal_uInt16 nIndex)
 {
     sal_uLong ulRet = 0xffffffff;
-    DBG_ASSERT(nIndex <= iMac, "index out of bounds");
+    OSL_ENSURE(nIndex <= iMac, "index out of bounds");
     if (iMac && nIndex <= iMac)
         ulRet = SVBT32ToUInt32(p + sizeof(SVBT32) * nIndex);
     return ulRet;
@@ -785,7 +785,7 @@ sal_uLong Ww1Plc::Where(sal_uInt16 nIndex)
 sal_uInt8* Ww1Plc::GetData(sal_uInt16 nIndex)
 {
     sal_uInt8* pRet = NULL;
-    DBG_ASSERT(nIndex < iMac, "index out of bounds");
+    OSL_ENSURE(nIndex < iMac, "index out of bounds");
     if (nIndex < iMac)
         pRet = p + (iMac + 1) * sizeof(SVBT32) +
          nIndex * nItemSize; // Pointer auf Inhalts-Array
@@ -804,12 +804,12 @@ Ww1StringList::Ww1StringList( SvStream& rSt, sal_uLong nFc, sal_uInt16 nCb )
     if( nCb > 2 )			 // ueberhaupt Eintraege ?
     {
         SVBT16 nCountBytes;
-        DBG_ASSERT(nCb > sizeof(nCountBytes), "Ww1StringList");
+        OSL_ENSURE(nCb > sizeof(nCountBytes), "Ww1StringList");
         if (rSt.Seek(nFc) == (sal_uLong)nFc)
             if (rSt.Read(nCountBytes, sizeof(nCountBytes))
                      == sizeof(nCountBytes)) // Laenge steht hier nochmal
             {
-                DBG_ASSERT(SVBT16ToShort(nCountBytes)
+                OSL_ENSURE(SVBT16ToShort(nCountBytes)
                          == nCb, "redundant-size missmatch");
                                     // hoffentlich sind sie immer gleich
                 sal_Char* pA = new sal_Char[nCb - sizeof(nCountBytes) + 1];
@@ -924,7 +924,7 @@ long Ww1Bookmarks::Len() const
 {
     if( nIsEnd )
     {
-        DBG_ASSERT( sal_False, "Falscher Aufruf (1) von Ww1Bookmarks::Len()" );
+        OSL_ENSURE( sal_False, "Falscher Aufruf (1) von Ww1Bookmarks::Len()" );
         return 0;
     }
     sal_uInt16 nEndIdx = SVBT16ToShort(pPos[0]->GetData(nPlcIdx[0]));
@@ -951,7 +951,7 @@ Ww1Fkp::Ww1Fkp(SvStream& rStream, sal_uLong ulFilePos, sal_uInt16 _nItemSize) :
 sal_uLong Ww1Fkp::Where(sal_uInt16 nIndex)
 {
     sal_uLong lRet = 0xffffffff;
-    DBG_ASSERT(nIndex<=Count(), "index out of bounds");
+    OSL_ENSURE(nIndex<=Count(), "index out of bounds");
     if (nIndex<=Count())
         lRet = SVBT32ToUInt32(aFkp+nIndex*sizeof(SVBT32));
     return lRet;
@@ -960,7 +960,7 @@ sal_uLong Ww1Fkp::Where(sal_uInt16 nIndex)
 sal_uInt8* Ww1Fkp::GetData(sal_uInt16 nIndex)
 {
     sal_uInt8* pRet = NULL;
-    DBG_ASSERT(nIndex<=Count(), "index out of bounds");
+    OSL_ENSURE(nIndex<=Count(), "index out of bounds");
     if (nIndex<=Count())
         pRet = aFkp + (Count()+1) * sizeof(SVBT32) +
          nIndex * nItemSize; // beginn der strukturen
@@ -970,11 +970,11 @@ sal_uInt8* Ww1Fkp::GetData(sal_uInt16 nIndex)
 //////////////////////////////////////////////////////////////// FkpPap
 sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBytes)
 {
-    DBG_ASSERT( nIndex < Count(), "Ww1FkpPap::Fill() Index out of Range" );
+    OSL_ENSURE( nIndex < Count(), "Ww1FkpPap::Fill() Index out of Range" );
     sal_uInt16 nOffset = SVBT8ToByte(GetData(nIndex)) * 2;
     if (nOffset)
     {
-        DBG_ASSERT(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
+        OSL_ENSURE(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
         rnCountBytes = SVBT8ToByte(aFkp+nOffset) * 2;
         nOffset += sizeof(SVBT8);
         if( nOffset + rnCountBytes < 511 )	// SH: Assert schlug 1 zu frueh zu
@@ -983,7 +983,7 @@ sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBy
                                             // genutzt wird, aber so vergessen
                                             // wir keins und sind trotzdem
                                             // auf der sicheren Seite
-        DBG_ASSERT(nOffset+rnCountBytes <= 511, "calc error");
+        OSL_ENSURE(nOffset+rnCountBytes <= 511, "calc error");
         p = aFkp + nOffset;
     }
     else
@@ -997,16 +997,16 @@ sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBy
 //////////////////////////////////////////////////////////////// FkpChp
 sal_Bool Ww1FkpChp::Fill(sal_uInt16 nIndex, W1_CHP& aChp)
 {
-    DBG_ASSERT( nIndex < Count(), "Ww1FkpChp::Fill() Index out of Range" );
+    OSL_ENSURE( nIndex < Count(), "Ww1FkpChp::Fill() Index out of Range" );
     memset(&aChp, 0, sizeof(aChp));	// Default, da verkuerzt gespeichert
     sal_uInt16 nOffset = GetData(nIndex)[0] * 2;
     if (nOffset)
     {
-        DBG_ASSERT(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
+        OSL_ENSURE(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
         sal_uInt16 nCountBytes = aFkp[nOffset];
         nOffset += sizeof(SVBT8);
-        DBG_ASSERT(nCountBytes <= 511-nOffset, "calc error");
-        DBG_ASSERT(nCountBytes <= sizeof(aChp), "calc error");
+        OSL_ENSURE(nCountBytes <= 511-nOffset, "calc error");
+        OSL_ENSURE(nCountBytes <= sizeof(aChp), "calc error");
         memcpy(&aChp, aFkp+nOffset, nCountBytes);
     }
     return sal_True;
@@ -1027,7 +1027,7 @@ Ww1Assoc::Ww1Assoc(Ww1Fib& _rFib)
      && rFib.GetStream().Read(pBuffer, cb) == cb)
     {
         sal_uInt16 j;
-        DBG_ASSERT( cb == SVBT16ToShort( *(SVBT16*)pBuffer ), "size missmatch");
+        OSL_ENSURE( cb == SVBT16ToShort( *(SVBT16*)pBuffer ), "size missmatch");
         for (i=0,j=sizeof(SVBT16);j<cb && i<Criteria1;i++)
         {
             pStrTbl[i] = pBuffer+j;
@@ -1040,7 +1040,7 @@ Ww1Assoc::Ww1Assoc(Ww1Fib& _rFib)
 String Ww1Assoc::GetStr(sal_uInt16 code)
 {
     String sRet;
-    DBG_ASSERT(code<MaxFields, "out of range");
+    OSL_ENSURE(code<MaxFields, "out of range");
     if (pStrTbl[code] != NULL)
         for( sal_uInt16 i=0;i<pStrTbl[code][0];i++ )
             sRet += String( pStrTbl[code][i+1], RTL_TEXTENCODING_MS_1252 );
@@ -1116,7 +1116,7 @@ sal_Bool Ww1Pap::HasId0(sal_uInt16 nId)
     UpdateIdx();
 
     if( !pPap ){
-        DBG_ASSERT( sal_False, "Ww1Pap::HasId():: kann kein pPap erzeugen" );
+        OSL_ENSURE( sal_False, "Ww1Pap::HasId():: kann kein pPap erzeugen" );
         return sal_False;
     }
 
diff --git a/sw/source/filter/ww1/w1class.hxx b/sw/source/filter/ww1/w1class.hxx
index 4bb72a6..073ec06 100644
--- a/sw/source/filter/ww1/w1class.hxx
+++ b/sw/source/filter/ww1/w1class.hxx
@@ -157,7 +157,7 @@ public:
     sal_uLong Where() const					{ return ulSeek; }
     void Seek( sal_uLong ulNew )
         {
-            DBG_ASSERT(ulNew < ulCountBytes, "Ww1PlainText");
+            OSL_ENSURE(ulNew < ulCountBytes, "Ww1PlainText");
             if (ulNew < ulCountBytes)
                 ulSeek = ulNew;
         }
@@ -171,7 +171,7 @@ public:
         }
     void operator++(int)
     {
-        DBG_ASSERT(ulSeek+1<ulCountBytes, "Ww1PlainText");
+        OSL_ENSURE(ulSeek+1<ulCountBytes, "Ww1PlainText");
         ulSeek++;
     }
     sal_Bool GetError() 					{ return !bOK; }
@@ -1136,7 +1136,7 @@ public:
         if (grpfIhdt & 0x0008) nOddFootL = nextIhdd++;
         if (grpfIhdt & 0x0010) nFirstHeadL = nextIhdd++;
         if (grpfIhdt & 0x0020) nFirstFootL = nextIhdd++;
-        DBG_ASSERT(nextIhdd<=Count(), "Ww1HeaderFooter");
+        OSL_ENSURE(nextIhdd<=Count(), "Ww1HeaderFooter");
     }
     sal_Bool operator++(int)
     {
@@ -1233,13 +1233,13 @@ public:
     sal_uLong Where() 		{ return Where(nPlcIndex); }
     void operator++(int)
     {
-        DBG_ASSERT(nPlcIndex+1 <= Count(), "Ww1Fields");
+        OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Fields");
         nPlcIndex++;
     }
     void Seek(sal_uLong ulNew) 		{ Ww1PlcFields::Seek(ulNew, nPlcIndex); }
     W1_FLD* GetData()
     {
-        DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+        OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
         return Ww1PlcFields::GetData(nPlcIndex);
     }
     sal_uLong GetLength();
@@ -1335,7 +1335,7 @@ public:
     }
     void operator++(int)
     {
-        DBG_ASSERT(nPlcIndex+1 <= Count(), "Ww1Footnotes");
+        OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Footnotes");
         nPlcIndex++;
     }
     void Start(Ww1Shell&, Ww1Manager&);
@@ -1408,7 +1408,7 @@ public:
     void Seek(sal_uLong);
     void Push(sal_uLong ulOffsetTmp = 0)
     {
-        DBG_ASSERT(!Pushed(), "Ww1Pap");
+        OSL_ENSURE(!Pushed(), "Ww1Pap");
         nPushedPlcIndex = nPlcIndex;
         nPushedFkpIndex = nFkpIndex;
         Seek(ulOffsetTmp);
@@ -1422,7 +1422,7 @@ public:
     }
     void Pop()
     {
-        DBG_ASSERT(Pushed(), "Ww1Pap");
+        OSL_ENSURE(Pushed(), "Ww1Pap");
         ulOffset = 0;
         nPlcIndex = nPushedPlcIndex;
         nFkpIndex = nPushedFkpIndex;
@@ -1473,7 +1473,7 @@ public:
     void Seek(sal_uLong);
     void Push(sal_uLong ulOffsetTmp = 0)
     {
-        DBG_ASSERT(!Pushed(), "Ww1Chp");
+        OSL_ENSURE(!Pushed(), "Ww1Chp");
         nPushedPlcIndex = nPlcIndex;
         nPushedFkpIndex = nFkpIndex;
         Seek(ulOffsetTmp);
@@ -1484,7 +1484,7 @@ public:
     sal_Bool Pushed()  				{ return nPushedPlcIndex != 0xffff; }
     void Pop()
     {
-        DBG_ASSERT(Pushed(), "Ww1Chp");
+        OSL_ENSURE(Pushed(), "Ww1Chp");
         ulOffset = 0;
         nPlcIndex = nPushedPlcIndex;
         nFkpIndex = nPushedFkpIndex;
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index 9e07cb4..5aeae5c 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -280,7 +280,7 @@ SvxFontItem Ww1Manager::GetFont(sal_uInt16 nFCode)
 
 void Ww1Manager::Push0(Ww1PlainText* _pDoc, sal_uLong ulSeek, Ww1Fields* _pFld)
 {
-    DBG_ASSERT(!Pushed(), "Ww1Manager");
+    OSL_ENSURE(!Pushed(), "Ww1Manager");
     this->pDoc = _pDoc;
     pSeek = new sal_uLong;
     *pSeek = pDoc->Where();
@@ -295,7 +295,7 @@ void Ww1Manager::Push0(Ww1PlainText* _pDoc, sal_uLong ulSeek, Ww1Fields* _pFld)
 void Ww1Manager::Push1(Ww1PlainText* _pDoc, sal_uLong ulSeek, sal_uLong ulSeek2,
                        Ww1Fields* _pFld)
 {
-    DBG_ASSERT(!Pushed(), "Ww1Manager");
+    OSL_ENSURE(!Pushed(), "Ww1Manager");
     this->pDoc = _pDoc;
     pSeek = new sal_uLong;
     *pSeek = pDoc->Where();
@@ -308,7 +308,7 @@ void Ww1Manager::Push1(Ww1PlainText* _pDoc, sal_uLong ulSeek, sal_uLong ulSeek2,
 
 void Ww1Manager::Pop()
 {
-    DBG_ASSERT(Pushed(), "Ww1Manager");
+    OSL_ENSURE(Pushed(), "Ww1Manager");
     delete pDoc;
     pDoc = &aDoc;
     delete pSeek;
@@ -365,10 +365,10 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan)
 {
     if (rMan.Where() >= Where())
     {
-        DBG_ASSERT(nPlcIndex < Count(), "WwFootnotes");
+        OSL_ENSURE(nPlcIndex < Count(), "WwFootnotes");
         sal_Unicode c;
         rMan.Fill(c);
-        DBG_ASSERT(c==0x02, "Ww1Footnotes");
+        OSL_ENSURE(c==0x02, "Ww1Footnotes");
         if (c==0x02)
         {
             Ww1FtnText* pText = new Ww1FtnText(rMan.GetFib());
@@ -380,7 +380,7 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan)
             pText->SetCount(count);
         // fusznotenkennung sollte das erste byte sein
             pText->Out(c);
-            DBG_ASSERT(c==0x02, "Ww1Footnotes");
+            OSL_ENSURE(c==0x02, "Ww1Footnotes");
             count--; // fuer das eben gelesene kenn-byte
         // fusznoten mode beginnen:
             rOut.BeginFootnote();
@@ -400,7 +400,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c)
 {
     if (bStarted && rMan.Where() > Where())
     {
-        DBG_ASSERT(nPlcIndex < Count(), "Ww1Footnotes");
+        OSL_ENSURE(nPlcIndex < Count(), "Ww1Footnotes");
         c = ' ';
         (*this)++;
     }
@@ -410,7 +410,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c)
 void Ww1Fields::Start(Ww1Shell& rOut, Ww1Manager& rMan)
 {
     if (rMan.Where() >= Where()){
-        DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+        OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
         if (GetData()->chGet() == 19)
             Out(rOut, rMan);
         else
@@ -422,11 +422,11 @@ void Ww1Fields::Stop( Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode& c)
 {
     if (rMan.Where() >= Where())
     {
-        DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+        OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
         if (GetData()->chGet() != 19)
         {
             rMan.Fill( c );
-            DBG_ASSERT(c==21, "Ww1Fields");
+            OSL_ENSURE(c==21, "Ww1Fields");
             (*this)++;
             c = ' ';
             if (pField)
@@ -554,16 +554,16 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
     String sFormat;
     String sDTFormat;	// Datum / Zeit-Format
     W1_FLD* pData = GetData(); // die an den plc gebunden daten
-    DBG_ASSERT(pData->chGet()==19, "Ww1Fields"); // sollte beginn sein
+    OSL_ENSURE(pData->chGet()==19, "Ww1Fields"); // sollte beginn sein
 
     sal_Unicode c;
     rMan.Fill( c );
-    DBG_ASSERT(c==19, "Ww1Fields"); // sollte auch beginn sein
+    OSL_ENSURE(c==19, "Ww1Fields"); // sollte auch beginn sein
     if (pData->chGet()==19 && c == 19)
     {
         String aStr;
         c = rMan.Fill( aStr, GetLength() );
-        DBG_ASSERT(Ww1PlainText::IsChar(c), "Ww1Fields");
+        OSL_ENSURE(Ww1PlainText::IsChar(c), "Ww1Fields");
         xub_StrLen pos = aStr.Search(' ');
         // get type out of text
         sType = aStr.Copy( 0, pos );
@@ -583,11 +583,11 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
             {
                 Out(rOut, rMan, nDepth+1);
                 rMan.Fill(c);
-                DBG_ASSERT(c==21, "Ww1PlainText");
+                OSL_ENSURE(c==21, "Ww1PlainText");
                 sFormel.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "Ww" ));
                 sFormel += String::CreateFromInt32( nPlcIndex );
                 c = rMan.Fill(aStr, GetLength());
-                DBG_ASSERT(Ww1PlainText::IsChar(c), "Ww1PlainText");
+                OSL_ENSURE(Ww1PlainText::IsChar(c), "Ww1PlainText");
                 sFormel += aStr;
             }
         }
@@ -606,16 +606,16 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
         if( pData->chGet() == 20 )
         {
             rMan.Fill( c );
-            DBG_ASSERT(c==20, "Ww1PlainText");
+            OSL_ENSURE(c==20, "Ww1PlainText");
             c = rMan.Fill(sErgebnis, GetLength());
             if (!Ww1PlainText::IsChar(c))
                 sErgebnis += c; //~ mdt: sonderzeichenbenhandlung
             (*this)++;
             pData = GetData();
         }
-        DBG_ASSERT(pData->chGet()==21, "Ww1PlainText");
+        OSL_ENSURE(pData->chGet()==21, "Ww1PlainText");
         sal_Bool bKnown = sal_True;
-        DBG_ASSERT(pField==0, "Ww1PlainText");
+        OSL_ENSURE(pField==0, "Ww1PlainText");
         if (pField != 0)
         {
             rOut << *pField;
@@ -817,7 +817,7 @@ oncemore:
             {
                 SwGetExpFieldType* pFieldType =
                  (SwGetExpFieldType*)rOut.GetSysFldType(RES_GETEXPFLD);
-                DBG_ASSERT(pFieldType!=0, "Ww1Fields");
+                OSL_ENSURE(pFieldType!=0, "Ww1Fields");
                 if (pFieldType != 0)
                     pField = new SwGetExpField(pFieldType, sFormel,
                      nsSwGetSetExpType::GSE_STRING, VVF_SYS);
@@ -944,7 +944,7 @@ oncemore:
         }
         break;
         default: // unknown
-            DBG_ASSERT(sal_False, "Ww1PlainText");
+            OSL_ENSURE(sal_False, "Ww1PlainText");
         // unsupported:
         case 1: // unknown
         case 2: // possible bookmark
@@ -997,7 +997,7 @@ sal_uLong Ww1Fields::GetLength()
 // und ende bedeuten.
     sal_uLong ulBeg = Where();
     sal_uLong ulEnd = Where(nPlcIndex+1);
-    DBG_ASSERT(ulBeg<ulEnd, "Ww1Fields");
+    OSL_ENSURE(ulBeg<ulEnd, "Ww1Fields");
     return (ulEnd - ulBeg) - 1;
 }
 
@@ -1060,7 +1060,7 @@ void Ww1Pap::Stop(Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode&)
             Ww1SprmPapx aSprm(pByte, cb);
             aSprm.Stop(rOut, rMan);
         }else{
-            DBG_ASSERT( !nPlcIndex || rMan.IsStopAll(), "Pap-Attribut-Stop verloren" );
+            OSL_ENSURE( !nPlcIndex || rMan.IsStopAll(), "Pap-Attribut-Stop verloren" );
         }
     }
 }
@@ -1097,7 +1097,7 @@ void W1_CHP::Out(Ww1Shell& rOut, Ww1Manager& rMan)
                     rOut << SvxUnderlineItem(UNDERLINE_NONE, RES_CHRATR_UNDERLINE) <<
                         SvxWordLineModeItem(sal_False, RES_CHRATR_WORDLINEMODE);
                 } break;
-        default: DBG_ASSERT(sal_False, "Chpx");
+        default: OSL_ENSURE(sal_False, "Chpx");
         case 1: {
                     rOut << SvxUnderlineItem(UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE);
                 } break;
@@ -1115,7 +1115,7 @@ void W1_CHP::Out(Ww1Shell& rOut, Ww1Manager& rMan)
 
     if (fsIcoGet())
         switch(icoGet()) {
-        default: DBG_ASSERT(sal_False, "Chpx");
+        default: OSL_ENSURE(sal_False, "Chpx");
         case 0: { rOut.EndItem(RES_CHRATR_COLOR); } break;
         case 1: { rOut << SvxColorItem(Color(COL_BLACK), RES_CHRATR_COLOR); } break;
         case 2: { rOut << SvxColorItem(Color(COL_LIGHTBLUE), RES_CHRATR_COLOR); } break;
@@ -1205,7 +1205,7 @@ void Ww1Chp::Stop(Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode&)
             if (aChpx.fsFtcGet())
                 rOut.EndItem(RES_CHRATR_FONT);
         }else{
-            DBG_ASSERT( !nPlcIndex, "Chp-Attribut-Stop verloren" );
+            OSL_ENSURE( !nPlcIndex, "Chp-Attribut-Stop verloren" );
         }
     }
 }
@@ -1387,7 +1387,7 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode)
         }
         else
         {
-            DBG_ASSERT(sal_False, "WW1Fonts::GetFont: Nicht existenter Font !");
+            OSL_ENSURE(sal_False, "WW1Fonts::GetFont: Nicht existenter Font !");
             eFamily = FAMILY_SWISS;
              aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helv" ));
             ePitch = PITCH_VARIABLE;
@@ -1487,13 +1487,13 @@ void Ww1Assoc::Out(Ww1Shell& rOut)
 //~ mdt: fehlen: FileNext, Dot, DataDoc, HeaderDoc, Criteria1,
 // Criteria2, Criteria3, Criteria4, Criteria5, Criteria6, Criteria7
     SwDocShell *pDocShell(rOut.GetDoc().GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
             pDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+        OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
         if (xDocProps.is()) {
             xDocProps->setTitle( GetStr(Title) );
             xDocProps->setSubject( GetStr(Subject) );
@@ -1793,13 +1793,13 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
     p+= sizeof(SVBT16); nSize -= sizeof(SVBT16);
 
 #if OSL_DEBUG_LEVEL > 1
-    DBG_ASSERT(x==maxx, "Ww1Picture");
-    DBG_ASSERT(y==maxy, "Ww1Picture");
-    DBG_ASSERT(planes==1, "Ww1Picture");
-    DBG_ASSERT(bitcount==4, "Ww1Picture");
+    OSL_ENSURE(x==maxx, "Ww1Picture");
+    OSL_ENSURE(y==maxy, "Ww1Picture");
+    OSL_ENSURE(planes==1, "Ww1Picture");
+    OSL_ENSURE(bitcount==4, "Ww1Picture");
 #endif
 
-    DBG_ASSERT(16*3+padx*maxy/2==nSize, "Ww1Picture");
+    OSL_ENSURE(16*3+padx*maxy/2==nSize, "Ww1Picture");
 
     SVBT32 tmpLong;
     SVBT16 tmpShort;
@@ -1842,7 +1842,7 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
         nSize -= sizeof(sal_uInt8);
         wByte(0);
     }
-    DBG_ASSERT(padx*maxy/2==nSize, "Ww1Picture");
+    OSL_ENSURE(padx*maxy/2==nSize, "Ww1Picture");
     sal_uInt16 j;
 #if 1
     {
@@ -1888,7 +1888,7 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
         }
     }
 #endif
-    DBG_ASSERT(nSize==0, "Ww1Picture");
+    OSL_ENSURE(nSize==0, "Ww1Picture");
 #undef wLong
 #undef wShort
 #undef wByte
@@ -1944,7 +1944,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1Manager& /*rMan*/)
         pGraphic = new Graphic(aBmp);
     }
     default:
-        DBG_ASSERT(pPic->mfp.mmGet() == 97, "Ww1Picture");
+        OSL_ENSURE(pPic->mfp.mmGet() == 97, "Ww1Picture");
     }
     if (pGraphic)
         rOut << *pGraphic;
diff --git a/sw/source/filter/ww8/needed_cast.hxx b/sw/source/filter/ww8/needed_cast.hxx
index 5dc4197..4a8c23c 100644
--- a/sw/source/filter/ww8/needed_cast.hxx
+++ b/sw/source/filter/ww8/needed_cast.hxx
@@ -41,7 +41,7 @@ namespace ww
 
     template<typename Ret> Ret checking_cast(Ret in, Ret)
     {
-        DBG_ASSERT( false, "UnnecessaryCast" );
+        OSL_ENSURE( false, "UnnecessaryCast" );
         return in;
     }
 
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index 30b2839..1dde32e 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -147,7 +147,7 @@ namespace
             "Plain Text"
         };
 
-        DBG_ASSERT( (SAL_N_ELEMENTS(stiName)) == ww::stiMax, "WrongSizeOfArray" );
+        OSL_ENSURE( (SAL_N_ELEMENTS(stiName)) == ww::stiMax, "WrongSizeOfArray" );
 
         return stiName;
     }
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 224f4c1..22ff650 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -308,7 +308,7 @@ namespace sw
         {
             if (mxIPRef.is())
             {
-                DBG_ASSERT( !mrPers.GetEmbeddedObjectContainer().HasEmbeddedObject( mxIPRef ), "Object in adaptor is inserted?!" );
+                OSL_ENSURE( !mrPers.GetEmbeddedObjectContainer().HasEmbeddedObject( mxIPRef ), "Object in adaptor is inserted?!" );
                 try
                 {
                     uno::Reference < com::sun::star::util::XCloseable > xClose( mxIPRef, uno::UNO_QUERY );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c7abbfa..599e963 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -267,7 +267,7 @@ static void WriteDop( WW8Export& rWrt )
     rDop.cLines = rDStat.nPara;
 
     SwDocShell *pDocShell(rWrt.pDoc->GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
     uno::Reference<document::XDocumentProperties> xDocProps;
     uno::Reference<beans::XPropertySet> xProps;
     if (pDocShell) {
@@ -278,7 +278,7 @@ static void WriteDop( WW8Export& rWrt )
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
             xModelComp, uno::UNO_QUERY_THROW);
         xDocProps = xDPS->getDocumentProperties();
-        DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+        OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
 
         rDop.lKeyProtDoc = pDocShell->GetModifyPasswordHash();        
     }
@@ -3250,14 +3250,14 @@ void WW8Export::PrepareStorage()
     xStor->Write( pData, nLen );
 
     SwDocShell* pDocShell = pDoc->GetDocShell ();
-    DBG_ASSERT(pDocShell, "no SwDocShell");
+    OSL_ENSURE(pDocShell, "no SwDocShell");
 
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
             pDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+        OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
 
         if (xDocProps.is())
         {
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index ac4b148..1bb7fa6 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -179,7 +179,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
                 catch( uno::Exception& )
                 {}
 
-                DBG_ASSERT( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
+                OSL_ENSURE( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
                 if ( pGraphicStream && !pGraphicStream->GetError() )
                 {
                     Graphic aGr1;
@@ -771,7 +771,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
                 comphelper::EmbeddedObjectContainer aCnt( pOleNd->GetDoc()->GetDocStorage() );
 
                 SvStream* pGraphicStream = ::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( rObj ) );
-                DBG_ASSERT( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
+                OSL_ENSURE( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
                 if ( pGraphicStream && !pGraphicStream->GetError() )
                 {
                     Graphic aGr;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 86012c7..adafb3e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1504,7 +1504,7 @@ void SwWW8ImplReader::ImportDop()
         mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
     uno::Reference<document::XDocumentProperties> xDocuProps(
         xDPS->getDocumentProperties());
-    DBG_ASSERT(xDocuProps.is(), "DocumentProperties is null");
+    OSL_ENSURE(xDocuProps.is(), "DocumentProperties is null");
     if (xDocuProps.is())
     {
         DateTime aLastPrinted(
@@ -4095,10 +4095,10 @@ void SwWW8ImplReader::ReadDocVars()
             mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+        OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
         uno::Reference<beans::XPropertyContainer> xUserDefinedProps =
             xDocProps->getUserDefinedProperties();
-        DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null");
+        OSL_ENSURE(xUserDefinedProps.is(), "UserDefinedProperties is null");
 
         for(size_t i=0; i<aDocVarStrings.size(); i++)
         {
@@ -4129,7 +4129,7 @@ void SwWW8ImplReader::ReadDocInfo()
             mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
-        DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+        OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
 
         if (xDocProps.is()) {
             if ( pWwFib->fDot )
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 5eae82b..19c4eef 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2559,7 +2559,7 @@ sal_Bool SwMSConvertControls::InsertControl(
     uno::Reference< drawing::XShape > xShape =
         uno::Reference< drawing::XShape >(xCreate, uno::UNO_QUERY);
 
-    DBG_ASSERT(xShape.is(), "XShape nicht erhalten");
+    OSL_ENSURE(xShape.is(), "XShape nicht erhalten");
     xShape->setSize(rSize);
 
     uno::Reference< beans::XPropertySet > xShapePropSet(
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 00efe9d..a99e489 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1311,7 +1311,7 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
             case 4:
             case 5:
             case 22:
-                DBG_WARNING("Can't create these from the menus, please report");
+                OSL_FAIL("Can't create these from the menus, please report");
             default:
             case 23:    //Only 3pt in the menus, but honours the size setting.
                 break;
@@ -2999,7 +2999,7 @@ void WW8PLCFx_Fc_FKP::GetPCDSprms( WW8PLCFxDesc& rDesc )
     {
         if( !pFkp )
         {
-            DBG_WARNING(
+            OSL_FAIL(
                 "+Problem: GetPCDSprms: NewFkp necessay (not possible!)" );
             if( !NewFkp() )
                 return;
@@ -3014,7 +3014,7 @@ const sal_uInt8* WW8PLCFx_Fc_FKP::HasSprm( sal_uInt16 nId )
     // wegfallen
     if( !pFkp )
     {
-        DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
+        OSL_FAIL( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
         // Passiert bei BugDoc 31722
         if( !NewFkp() )
             return 0;
@@ -3044,7 +3044,7 @@ bool WW8PLCFx_Fc_FKP::HasSprm(sal_uInt16 nId, std::vector<const sal_uInt8 *> &rR
     // wegfallen
     if (!pFkp)
     {
-       DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
+       OSL_FAIL( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
        // Passiert bei BugDoc 31722
        if( !NewFkp() )
            return 0;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 994b061..58f7452 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -152,10 +152,10 @@ sal_Int32 ReadThroughComponent(
     sal_Bool bMustBeSuccessfull,
     sal_Bool bEncrypted )
 {
-    DBG_ASSERT(xInputStream.is(), "input stream missing");
-    DBG_ASSERT(xModelComponent.is(), "document missing");
-    DBG_ASSERT(rFactory.is(), "factory missing");
-    DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!");
+    OSL_ENSURE(xInputStream.is(), "input stream missing");
+    OSL_ENSURE(xModelComponent.is(), "document missing");
+    OSL_ENSURE(rFactory.is(), "factory missing");
+    OSL_ENSURE(NULL != pFilterName,"I need a service name for the component!");
 
     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sw", LOGFILE_AUTHOR, "ReadThroughComponent" );
 
@@ -169,7 +169,7 @@ sal_Int32 ReadThroughComponent(
         rFactory->createInstance(
             OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))),
         UNO_QUERY );
-    DBG_ASSERT( xParser.is(), "Can't create parser" );
+    OSL_ENSURE( xParser.is(), "Can't create parser" );
     if( !xParser.is() )
         return ERR_SWG_READ_ERROR;
     RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" );
@@ -179,7 +179,7 @@ sal_Int32 ReadThroughComponent(
         rFactory->createInstanceWithArguments(
             OUString::createFromAscii(pFilterName), rFilterArguments),
         UNO_QUERY );
-    DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
+    OSL_ENSURE( xFilter.is(), "Can't instantiate filter component." );
     if( !xFilter.is() )
         return ERR_SWG_READ_ERROR;
     RTL_LOGFILE_CONTEXT_TRACE1( aLog, "%s created", pFilterName );
@@ -316,8 +316,8 @@ sal_Int32 ReadThroughComponent(
     const OUString& rName,
     sal_Bool bMustBeSuccessfull)
 {
-    DBG_ASSERT(xStorage.is(), "Need storage!");
-    DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
+    OSL_ENSURE(xStorage.is(), "Need storage!");
+    OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!");
 
     // open stream (and set parser input)
     OUString sStreamName = OUString::createFromAscii(pStreamName);
@@ -357,7 +357,7 @@ sal_Int32 ReadThroughComponent(
     uno::Reference< beans::XPropertySet > xInfoSet;
     if( rFilterArguments.getLength() > 0 )
         rFilterArguments.getConstArray()[0] >>= xInfoSet;
-    DBG_ASSERT( xInfoSet.is(), "missing property set" );
+    OSL_ENSURE( xInfoSet.is(), "missing property set" );
     if( xInfoSet.is() )
     {
         OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index e887615..2067ece 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -87,7 +87,7 @@ SwXMLWriter::~SwXMLWriter()
 
 sal_uInt32 SwXMLWriter::_Write( SfxMedium* pTargetMedium )
 {
-    DBG_ASSERT( pTargetMedium, "No medium is provided!" );
+    OSL_ENSURE( pTargetMedium, "No medium is provided!" );
     // Get service factory
     uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
             comphelper::getProcessServiceFactory();
@@ -532,9 +532,9 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
     const Sequence<beans::PropertyValue> & rMediaDesc,
     sal_Bool bPlainStream )
 {
-    DBG_ASSERT( xStg.is(), "Need storage!" );
-    DBG_ASSERT( NULL != pStreamName, "Need stream name!" );
-    DBG_ASSERT( NULL != pServiceName, "Need service name!" );
+    OSL_ENSURE( xStg.is(), "Need storage!" );
+    OSL_ENSURE( NULL != pStreamName, "Need stream name!" );
+    OSL_ENSURE( NULL != pServiceName, "Need service name!" );
 
     RTL_LOGFILE_TRACE_AUTHOR1( "sw", LOGFILE_AUTHOR,
                                "SwXMLWriter::WriteThroughComponent : stream %s",
@@ -580,7 +580,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
         uno::Reference< beans::XPropertySet > xInfoSet;
         if( rArguments.getLength() > 0 )
             rArguments.getConstArray()[0] >>= xInfoSet;
-        DBG_ASSERT( xInfoSet.is(), "missing property set" );
+        OSL_ENSURE( xInfoSet.is(), "missing property set" );
         if( xInfoSet.is() )
         {
             OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 76fc0d4..624f061 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -152,7 +152,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
             {
                 OUStringBuffer aOut;
                 const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
-                DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+                OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
                 sal_uInt16 eEnum = pSplit->GetValue() ? 1 : 0;
                 rUnitConverter.convertEnum( aOut, eEnum, aXML_KeepTogetherType );
                 aValue = aOut.makeStringAndClear();
@@ -249,7 +249,7 @@ void SvXMLExportItemMapper::exportElementItems(
     {
         const sal_uInt16 nElement = rIndexArray.GetObject( nIndex );
         SvXMLItemMapEntry* pEntry = mrMapEntries->getByIndex( nElement );
-        DBG_ASSERT( 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT),
+        OSL_ENSURE( 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT),
                     "wrong mid flag!" );
 
         const SfxPoolItem* pItem = GetItem( rSet, pEntry->nWhichId, nFlags );
@@ -405,7 +405,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_LR_SPACE:
         {
             const SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
-            DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
+            OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" );
 
             bOk = sal_True;
             switch( nMemberId )
@@ -455,7 +455,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_UL_SPACE:
         {
             const SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
-            DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
+            OSL_ENSURE( pULSpace != NULL, "Wrong Which-ID!" );
 
             switch( nMemberId )
             {
@@ -484,7 +484,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_SHADOW:
         {
             const SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
-            DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pShadow != NULL, "Wrong Which-ID" );
 
             sal_Int32 nX = 1, nY = 1;
             switch( pShadow->GetLocation() )
@@ -523,7 +523,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_BOX:
         {
             SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
-            DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
+            OSL_ENSURE( pBox != NULL, "Wrong WHich-ID" );
 
             /**
                xml -> MemberId
@@ -812,7 +812,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_BREAK:
         {
             const SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
-            DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" );
 
             sal_uInt16 eEnum = 0;
 
@@ -859,7 +859,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_KEEP:
         {
             SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
-            DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFmtKeep != NULL, "Wrong Which-ID" );
 
             aOut.append( pFmtKeep->GetValue()
                          ? GetXMLToken( XML_ALWAYS )
@@ -871,7 +871,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_BACKGROUND:
         {
             SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
-            DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" );
 
             // note: the graphic is only exported if nMemberId equals
             //       MID_GRAPHIC..
@@ -982,7 +982,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_PAGEDESC:
         {
             const SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
-            DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" );
 
             if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
             {
@@ -1004,7 +1004,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_ROW_SPLIT:
         {
             const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
-            DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
 
             rUnitConverter.convertBool( aOut, pSplit->GetValue() );
             bOk = sal_True;
@@ -1014,7 +1014,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_HORI_ORIENT:
         {
             SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
-            DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pHoriOrient != NULL, "Wrong Which-ID" );
 
             rUnitConverter.convertEnum( aOut, pHoriOrient->GetHoriOrient(),
                                         aXMLTableAlignMap );
@@ -1025,7 +1025,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_VERT_ORIENT:
         {
             SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
-            DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" );
 
             rUnitConverter.convertEnum( aOut, pVertOrient->GetVertOrient(),
                                         aXMLTableVAlignMap );
@@ -1036,7 +1036,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_FRM_SIZE:
         {
             SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
-            DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" );
 
             sal_Bool bOutHeight = sal_False;
             switch( nMemberId )
@@ -1087,7 +1087,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
         case RES_COLLAPSING_BORDERS:
         {
             const SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
-            DBG_ASSERT( pBorders != NULL, "Wrong RES-ID" );
+            OSL_ENSURE( pBorders != NULL, "Wrong RES-ID" );
 
             aOut.append( pBorders->GetValue()
                          ? GetXMLToken( XML_COLLAPSING )
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index c9f6007..e7333be 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -68,10 +68,10 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
     CheckAttrList();
 
     // style:family="..."
-    DBG_ASSERT( RES_FRMFMT==rFmt.Which(), "frame format expected" );
+    OSL_ENSURE( RES_FRMFMT==rFmt.Which(), "frame format expected" );
     if( RES_FRMFMT != rFmt.Which() )
         return;
-    DBG_ASSERT( eFamily != XML_TOKEN_INVALID, "family must be specified" );
+    OSL_ENSURE( eFamily != XML_TOKEN_INVALID, "family must be specified" );
     // style:name="..."
     sal_Bool bEncoded = sal_False;
     AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, EncodeStyleName(
@@ -118,7 +118,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
 
     if( XML_TABLE_CELL == eFamily )
     {
-        DBG_ASSERT(RES_FRMFMT == rFmt.Which(), "only frame format");
+        OSL_ENSURE(RES_FRMFMT == rFmt.Which(), "only frame format");
 
         const SfxPoolItem *pItem;
         if( SFX_ITEM_SET ==
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 790bfa6..2d23af0 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -245,7 +245,7 @@ SvXMLImportContext *SwXMLDocContext_Impl::CreateChildContext(
                                                             xAttrList );
         break;
     case XML_TOK_DOC_META:
-        DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
+        OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
         break;
     case XML_TOK_DOC_SCRIPT:
         pContext = GetSwImport().CreateScriptContext( rLocalName );
@@ -564,7 +564,7 @@ void SwXMLImport::startDocument( void )
     // delegate to parent
     SvXMLImport::startDocument();
 
-    DBG_ASSERT( GetModel().is(), "model is missing" );
+    OSL_ENSURE( GetModel().is(), "model is missing" );
     if( !GetModel().is() )
         return;
 
@@ -775,7 +775,7 @@ void SwXMLImport::startDocument( void )
 void SwXMLImport::endDocument( void )
     throw( xml::sax::SAXException, uno::RuntimeException )
 {
-    DBG_ASSERT( GetModel().is(), "model missing; maybe startDocument wasn't called?" );
+    OSL_ENSURE( GetModel().is(), "model missing; maybe startDocument wasn't called?" );
     if( !GetModel().is() )
         return;
 
@@ -861,14 +861,14 @@ void SwXMLImport::endDocument( void )
         }
 
         SwPosition* pPos = pPaM->GetPoint();
-        DBG_ASSERT( !pPos->nContent.GetIndex(), "last paragraph isn't empty" );
+        OSL_ENSURE( !pPos->nContent.GetIndex(), "last paragraph isn't empty" );
         if( !pPos->nContent.GetIndex() )
         {
             SwTxtNode* pCurrNd;
             sal_uLong nNodeIdx = pPos->nNode.GetIndex();
             pDoc = pPaM->GetDoc();
 
-            DBG_ASSERT( pPos->nNode.GetNode().IsCntntNode(),
+            OSL_ENSURE( pPos->nNode.GetNode().IsCntntNode(),
                         "insert position is not a content node" );
             if( !IsInsertMode() )
             {
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 2c635c0..9e70a5d 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -163,7 +163,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
                 {
                     SfxPoolItem *pNew = pItem->Clone();
                     pUnknownItem = PTR_CAST( SvXMLAttrContainerItem, pNew );
-                    DBG_ASSERT( pUnknownItem,
+                    OSL_ENSURE( pUnknownItem,
                                 "SvXMLAttrContainerItem expected" );
                     if( !pUnknownItem )
                         delete pNew;
@@ -240,7 +240,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_LR_SPACE:
         {
             SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
-            DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
+            OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" );
 
             switch( nMemberId )
             {
@@ -301,7 +301,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_UL_SPACE:
         {
             SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
-            DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
+            OSL_ENSURE( pULSpace != NULL, "Wrong Which-ID!" );
 
             sal_Int32 nProp = 100;
             sal_Int32 nAbs = 0;
@@ -328,7 +328,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_SHADOW:
         {
             SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
-            DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pShadow != NULL, "Wrong Which-ID" );
 
             sal_Bool bColorFound = sal_False;
             sal_Bool bOffsetFound = sal_False;
@@ -407,7 +407,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_BOX:
         {
             SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
-            DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
+            OSL_ENSURE( pBox != NULL, "Wrong WHich-ID" );
 
             /** copy SvxBorderLines */
             SvxBorderLine* pTop    = pBox->GetTop() == NULL ?
@@ -572,7 +572,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_BREAK:
         {
             SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
-            DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" );
 
             sal_uInt16 eEnum;
 
@@ -607,7 +607,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_KEEP:
         {
             SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
-            DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFmtKeep != NULL, "Wrong Which-ID" );
 
             if( IsXMLToken( rValue, XML_ALWAYS ) ||
                  IsXMLToken( rValue, XML_TRUE ) )
@@ -627,7 +627,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_BACKGROUND:
         {
             SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
-            DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" );
 
             Color aTempColor;
             switch( nMemberId )
@@ -769,7 +769,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_PAGEDESC:
         {
             SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
-            DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" );
 
             if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
             {
@@ -785,7 +785,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_ROW_SPLIT:
         {
             SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
-            DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
             
             if( IsXMLToken( rValue, XML_AUTO ) ||
                  IsXMLToken( rValue, XML_TRUE ) )
@@ -805,7 +805,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_HORI_ORIENT:
         {
             SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
-            DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pHoriOrient != NULL, "Wrong Which-ID" );
 
             sal_uInt16 nValue;
             bOk = rUnitConverter.convertEnum( nValue, rValue,
@@ -818,7 +818,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_VERT_ORIENT:
         {
             SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
-            DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" );
 
             sal_uInt16 nValue;
             bOk = rUnitConverter.convertEnum( nValue, rValue,
@@ -837,7 +837,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_FRM_SIZE:
         {
             SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
-            DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" );
 
             sal_Bool bSetHeight = sal_False;
             sal_Bool bSetWidth = sal_False;
@@ -939,7 +939,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
         case RES_COLLAPSING_BORDERS:
         {
             SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
-            DBG_ASSERT( pBorders != NULL, "Wrong Which-ID" );
+            OSL_ENSURE( pBorders != NULL, "Wrong Which-ID" );
 
             if( IsXMLToken( rValue, XML_COLLAPSING ) )
             {
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 6a50937..5aeb3b9 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -261,7 +261,7 @@ const struct SvXMLEnumMapEntry psXML_BrushVertPos[] =
 void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
                                    SvxGraphicPosition eHori )
 {
-    DBG_ASSERT( GPOS_LM==eHori || GPOS_MM==eHori || GPOS_RM==eHori,
+    OSL_ENSURE( GPOS_LM==eHori || GPOS_MM==eHori || GPOS_RM==eHori,
                 "lcl_frmitems_MergeXMLHoriPos: vertical pos must be middle" );
 
     switch( ePos )
@@ -291,7 +291,7 @@ void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
 void lcl_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
                                      SvxGraphicPosition eVert )
 {
-    DBG_ASSERT( GPOS_MT==eVert || GPOS_MM==eVert || GPOS_MB==eVert,
+    OSL_ENSURE( GPOS_MT==eVert || GPOS_MM==eVert || GPOS_MB==eVert,
                 "lcl_frmitems_MergeXMLVertPos: horizontal pos must be middle" );
 
     switch( ePos )
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 77a5739..52666fa 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -1098,7 +1098,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines,
         SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE,
                                   XML_TABLE_HEADER_ROWS, sal_True, sal_True );
 
-        DBG_ASSERT( nHeaderRows <= nLines, "more headers then lines?" );
+        OSL_ENSURE( nHeaderRows <= nLines, "more headers then lines?" );
         for( sal_uInt16 nLine = 0U; nLine < nHeaderRows; nLine++ )
             ExportTableLine( *(rLines[nLine]), *pLines, rTblInfo );
     }
@@ -1201,7 +1201,7 @@ void SwXMLTextParagraphExport::exportTable(
     ((SwXMLExport&)GetExport()).SetShowProgress( _bProgress );
 
     Reference < XTextTable > xTxtTbl( rTextContent, UNO_QUERY );
-    DBG_ASSERT( xTxtTbl.is(), "text table missing" );
+    OSL_ENSURE( xTxtTbl.is(), "text table missing" );
     if( xTxtTbl.is() )
     {
         const SwXTextTable *pXTable = 0;
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index ee34901..e0523da 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1230,7 +1230,7 @@ SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext,
             GetDoc()->InsertFldType(aDDEFieldType);
     }
 
-    DBG_ASSERT(NULL != pType, "We really want a SwDDEFieldType here!");
+    OSL_ENSURE(NULL != pType, "We really want a SwDDEFieldType here!");
     return pType;
 }
 
@@ -2784,7 +2784,7 @@ void SwXMLTableContext::MakeTable()
     }
 
     SwTableLine *pLine1 = pTableNode->GetTable().GetTabLines()[0U];
-    DBG_ASSERT( pBox1 == pLine1->GetTabBoxes()[0U],
+    OSL_ENSURE( pBox1 == pLine1->GetTabBoxes()[0U],
                 "Why is box 1 change?" );
     pBox1->pSttNd = pSttNd1;
     pLine1->GetTabBoxes().Remove(0U);
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index fce08c5..bdceb25 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -166,7 +166,7 @@ void SwXMLTextParagraphExport::exportStyleContent(
                 }
                 OUString sVal( sBuffer.makeStringAndClear() );
 
-                DBG_ASSERT( eFunc != XML_TOKEN_INVALID,
+                OSL_ENSURE( eFunc != XML_TOKEN_INVALID,
                             "SwXMLExport::ExportFmt: unknown condition" );
                 if( eFunc != XML_TOKEN_INVALID )
                 {
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index bfa231c..ea9d15f 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -994,7 +994,7 @@ void SwXMLTextImportHelper::RedlineAdd(
     sal_Bool bMergeLastPara)
 {
     // create redline helper on demand
-    DBG_ASSERT(NULL != pRedlineHelper, "helper should have been created in constructor");
+    OSL_ENSURE(NULL != pRedlineHelper, "helper should have been created in constructor");
     if (NULL != pRedlineHelper)
         pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
                             bMergeLastPara);
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 5360988..231a7c0 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -236,7 +236,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
     const SfxPoolItem*	pColorItem	= NULL;
     XColorTable*		pColorTable = NULL;
 
-    DBG_ASSERT( pDocSh, "DocShell not found!" );
+    OSL_ENSURE( pDocSh, "DocShell not found!" );
 
     if ( pDocSh )
     {
@@ -245,7 +245,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
             pColorTable = ( (SvxColorTableItem*)pColorItem )->GetColorTable();
     }
 
-    DBG_ASSERT( pColorTable, "ColorTable not found!" );
+    OSL_ENSURE( pColorTable, "ColorTable not found!" );
 
     if ( pColorTable )
     {
-- 
1.7.3.4


--=-TLu7T+1OV5ueLe2HJt6A
Content-Disposition: attachment;
	filename="0002-Remove-unused-dbgloop.hxx-from-repository.patch"
Content-Type: text/x-patch; name="0002-Remove-unused-dbgloop.hxx-from-repository.patch";
	charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the LibreOffice mailing list