From 9ace8bebd88ff41d65eeaa87a6d1f1dfd8875b6d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 24 Nov 2011 00:52:07 +0100 Subject: sw: enable more debug code: Whole bunch of code is #if OSL_DEBUG_LEVEL > 1, reduce that to > 0 so more assertions are active when building --enable-debug or --enable-dbgutil. --- sw/inc/swrect.hxx | 2 + sw/source/core/access/accmap.cxx | 20 ++++----- sw/source/core/attr/calbck.cxx | 2 +- sw/source/core/attr/hints.cxx | 2 +- sw/source/core/attr/swatrset.cxx | 4 +- sw/source/core/bastyp/init.cxx | 4 +- sw/source/core/bastyp/swrect.cxx | 8 +--- sw/source/core/bastyp/tabcol.cxx | 2 +- sw/source/core/crsr/crsrsh.cxx | 18 ++++---- sw/source/core/crsr/crstrvl.cxx | 2 +- sw/source/core/crsr/trvltbl.cxx | 2 +- sw/source/core/doc/acmplwrd.cxx | 22 +++++----- sw/source/core/doc/docbm.cxx | 2 +- sw/source/core/doc/docdraw.cxx | 2 +- sw/source/core/doc/docfld.cxx | 48 +++++++++------------- sw/source/core/doc/docfly.cxx | 2 +- sw/source/core/doc/doclay.cxx | 4 +- sw/source/core/doc/docredln.cxx | 10 ++--- sw/source/core/doc/doctxm.cxx | 2 +- sw/source/core/doc/fmtcol.cxx | 2 - sw/source/core/doc/htmltbl.cxx | 6 +-- sw/source/core/doc/visiturl.cxx | 5 --- sw/source/core/docnode/ndcopy.cxx | 2 +- sw/source/core/docnode/ndnum.cxx | 2 +- sw/source/core/docnode/nodes.cxx | 6 +-- sw/source/core/draw/dcontact.cxx | 4 +- sw/source/core/edit/autofmt.cxx | 2 +- sw/source/core/edit/eddel.cxx | 2 +- sw/source/core/edit/editsh.cxx | 29 ++++++------- sw/source/core/edit/ednumber.cxx | 4 +- sw/source/core/fields/authfld.cxx | 12 +++--- sw/source/core/fields/docufld.cxx | 9 ++-- sw/source/core/frmedt/fedesc.cxx | 2 +- sw/source/core/frmedt/fefly1.cxx | 6 +-- sw/source/core/layout/atrfrm.cxx | 20 ++++----- sw/source/core/layout/calcmove.cxx | 16 +++----- sw/source/core/layout/flowfrm.cxx | 2 - sw/source/core/layout/fly.cxx | 2 - sw/source/core/layout/flycnt.cxx | 2 - sw/source/core/layout/flylay.cxx | 24 +++-------- sw/source/core/layout/ftnfrm.cxx | 4 +- sw/source/core/layout/layact.cxx | 7 ---- sw/source/core/layout/newfrm.cxx | 2 +- sw/source/core/layout/objectformatter.cxx | 2 - sw/source/core/layout/pagechg.cxx | 4 +- sw/source/core/layout/paintfrm.cxx | 4 +- sw/source/core/layout/sortedobjsimpl.cxx | 4 -- sw/source/core/layout/ssfrm.cxx | 2 +- sw/source/core/layout/tabfrm.cxx | 6 +-- sw/source/core/layout/trvlfrm.cxx | 7 +--- sw/source/core/layout/wsfrm.cxx | 4 +- .../objectpositioning/anchoredobjectposition.cxx | 2 +- sw/source/core/table/swnewtable.cxx | 2 +- sw/source/core/text/frmcrsr.cxx | 8 ++-- sw/source/core/text/frmform.cxx | 4 +- sw/source/core/text/guess.cxx | 6 +-- sw/source/core/text/inftxt.cxx | 8 ++-- sw/source/core/text/porglue.cxx | 2 +- sw/source/core/text/porlay.cxx | 4 +- sw/source/core/text/porlin.cxx | 6 +-- sw/source/core/text/porrst.cxx | 2 +- sw/source/core/text/txtftn.cxx | 2 +- sw/source/core/text/txttab.cxx | 9 +--- sw/source/core/text/wrong.cxx | 4 +- sw/source/core/tox/toxhlp.cxx | 24 +++++------ sw/source/core/tox/txmsrt.cxx | 9 ++-- sw/source/core/txtnode/fntcache.cxx | 4 +- sw/source/core/txtnode/ndhints.cxx | 2 +- sw/source/core/txtnode/ndtxt.cxx | 4 +- sw/source/core/txtnode/swfont.cxx | 4 +- sw/source/core/txtnode/thints.cxx | 10 ++--- sw/source/core/txtnode/txtedt.cxx | 2 - sw/source/core/undo/undobj.cxx | 12 +++--- sw/source/core/undo/untbl.cxx | 6 +-- sw/source/core/unocore/unochart.cxx | 6 +-- sw/source/core/unocore/unodraw.cxx | 2 +- sw/source/core/unocore/unofield.cxx | 4 +- sw/source/core/unocore/unotbl.cxx | 4 +- sw/source/core/unocore/unotext.cxx | 10 ++--- sw/source/core/view/viewpg.cxx | 4 -- sw/source/core/view/viewsh.cxx | 2 +- sw/source/core/view/vprint.cxx | 2 - sw/source/filter/html/htmlcss1.cxx | 11 ++--- sw/source/filter/html/htmlftn.cxx | 4 +- sw/source/filter/html/htmltab.cxx | 15 +++---- sw/source/filter/html/swhtml.cxx | 16 ++++---- sw/source/filter/rtf/rtfnum.cxx | 2 +- sw/source/filter/rtf/swparrtf.cxx | 4 +- sw/source/filter/writer/wrtswtbl.cxx | 30 +++++--------- sw/source/filter/ww1/fltshell.cxx | 9 +--- sw/source/filter/ww1/w1filter.cxx | 12 +++--- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/ww8par2.cxx | 14 +++---- sw/source/filter/ww8/ww8par6.cxx | 14 ++----- sw/source/filter/xml/swxml.cxx | 10 ++--- sw/source/filter/xml/xmlfmte.cxx | 2 +- sw/source/filter/xml/xmlimp.cxx | 2 +- sw/source/filter/xml/xmltble.cxx | 21 ++++------ sw/source/filter/xml/xmltbli.cxx | 4 +- sw/source/ui/app/apphdl.cxx | 6 --- sw/source/ui/app/docsh2.cxx | 10 ++--- sw/source/ui/app/docshini.cxx | 2 +- sw/source/ui/dbui/dbinsdlg.cxx | 3 -- sw/source/ui/dialog/swdlgfact.cxx | 7 +--- sw/source/ui/docvw/edtwin.cxx | 4 +- sw/source/ui/envelp/labprt.cxx | 7 ++-- sw/source/ui/misc/docfnote.cxx | 2 +- sw/source/ui/misc/numberingtypelistbox.cxx | 2 +- sw/source/ui/shells/basesh.cxx | 4 -- sw/source/ui/shells/txtattr.cxx | 4 -- sw/source/ui/uiview/pview.cxx | 2 +- sw/source/ui/uno/unotxdoc.cxx | 2 +- 113 files changed, 291 insertions(+), 471 deletions(-) (limited to 'sw') diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx index f3111e097d87..f2b620884f67 100644 --- a/sw/inc/swrect.hxx +++ b/sw/inc/swrect.hxx @@ -154,8 +154,10 @@ public: sal_Bool OverStepRight( long ) const; }; +#ifdef DBG_UTIL // Implementation in swrect.cxx extern SvStream &operator<<( SvStream &rStream, const SwRect &rRect ); +#endif typedef void (SwRect:: *SwRectSet)( const long nNew ); typedef long (SwRect:: *SwRectGet)() const; diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 0b1916c01e3e..44f6b40c6a04 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -95,12 +95,12 @@ class SwAccessibleContextMap_Impl: public _SwAccessibleContextMap_Impl { public: -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_Bool mbLocked; #endif SwAccessibleContextMap_Impl() -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 : mbLocked( sal_False ) #endif {} @@ -185,7 +185,7 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/, catch( uno::RuntimeException const & r ) { (void)r; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM("Runtime exception caught while notifying shape.:\n")); aError.append(rtl::OUStringToOString(r.Message, RTL_TEXTENCODING_ASCII_US)); OSL_FAIL( aError.getStr() ); @@ -218,11 +218,11 @@ class SwAccessibleShapeMap_Impl: public _SwAccessibleShapeMap_Impl public: -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_Bool mbLocked; #endif SwAccessibleShapeMap_Impl( SwAccessibleMap *pMap ) -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 : mbLocked( sal_False ) #endif { @@ -1175,7 +1175,7 @@ SwAccessibleMap::~SwAccessibleMap() { osl::MutexGuard aGuard( maMutex ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !mpFrmMap || mpFrmMap->empty(), "Frame map should be empty after disposing the root frame" ); if( mpFrmMap ) @@ -1226,7 +1226,7 @@ SwAccessibleMap::~SwAccessibleMap() { osl::MutexGuard aGuard( maEventMutex ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !(mpEvents || mpEventMap), "pending events" ); if( mpEvents ) { @@ -1265,12 +1265,12 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView( if( !mpFrmMap ) { mpFrmMap = new SwAccessibleContextMap_Impl; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 mpFrmMap->mbLocked = sal_False; #endif } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !mpFrmMap->mbLocked, "Map is locked" ); mpFrmMap->mbLocked = sal_True; #endif @@ -1302,7 +1302,7 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView( } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 mpFrmMap->mbLocked = sal_False; #endif } diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 3508aefee24a..1820f61e4f5f 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -234,7 +234,7 @@ void SwModify::Add(SwClient *pDepend) if(pDepend->pRegisteredIn != this ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwClientIter* pTmp = pClientIters; while( pTmp ) { diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index 8070941046a5..7fe479f25e17 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -172,7 +172,7 @@ SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const * Ist keines vorhanden, returnt ein 0-Pointer !!! * Used to be inlined (hintids.hxx) in PRODUCT. ******************************************************************************/ -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich ) { OSL_ASSERT( nWhich < POOLATTR_END && nWhich >= POOLATTR_BEGIN ); diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 558f5ba7caf4..0de9bf0cb6e8 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -374,9 +374,9 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const pNewListIdItem = 0; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else - OSL_ENSURE( !this, "weder Format noch ContentNode - keine Attribute kopiert"); + OSL_FAIL("neither Format nor ContentNode - no Attributes copied"); #endif } diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 72e6ec4f92fd..e8276732e2ac 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -756,8 +756,8 @@ void _FinitCore() delete SwEditShell::pAutoFmtFlags; -#if OSL_DEBUG_LEVEL > 1 - //Defaultattribut freigeben lassen um asserts zu vermeiden. +#if OSL_DEBUG_LEVEL > 0 + // free defaults to prevent assertions if ( aAttrTab[0]->GetRefCount() ) SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, sal_False); #endif diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index 9f5a7b6c6a1f..d54bf063c97e 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -29,8 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#if OSL_DEBUG_LEVEL > 1 +#ifdef DBG_UTIL #include #endif #include @@ -289,13 +288,10 @@ void SwRect::SetUpperRightCorner( const Point& rNew ) void SwRect::SetLowerLeftCorner( const Point& rNew ) { m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); } -#if OSL_DEBUG_LEVEL > 1 +#ifdef DBG_UTIL /************************************************************************* * operator<<( ostream&, SwRect&) *************************************************************************/ - - - SvStream &operator<<( SvStream &rStream, const SwRect &rRect ) { rStream << '[' << rRect.Top() << '/' << rRect.Left() diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx index bf6a87dfd331..c88d0c855f9d 100644 --- a/sw/source/core/bastyp/tabcol.cxx +++ b/sw/source/core/bastyp/tabcol.cxx @@ -53,7 +53,7 @@ SwTabCols::SwTabCols( const SwTabCols& rCpy ) : bLastRowAllowedToChange( rCpy.IsLastRowAllowedToChange() ), aData( rCpy.GetData() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 for ( sal_uInt16 i = 0; i < Count(); ++i ) { SwTabColsEntry aEntry1 = aData[i]; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 5377c7de9a2a..9600bb76c06b 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1442,12 +1442,10 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) Point aCentrPt( aCharRect.Center() ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); pTblFrm->GetCrsrOfst( pTblCrsr->GetPoint(), aCentrPt, &aTmpState ); -#if OSL_DEBUG_LEVEL > 1 - if ( !pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ) ) - OSL_ENSURE( !this, "GetCharRect failed." ); -#else - pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ); -#endif + bool const bResult = + pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ); + OSL_ENSURE( bResult, "GetCharRect failed." ); + (void) bResult; // non-debug: unused } pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken @@ -1988,12 +1986,10 @@ void SwCrsrShell::Combine() SwCrsrSaveState aSaveState( *pCurCrsr ); if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde { -#if OSL_DEBUG_LEVEL > 1 - if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True )) - OSL_ENSURE( !this, "StackCrsr & akt. Crsr nicht in gleicher Section." ); -#else + bool const bResult = CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ); -#endif + OSL_ENSURE(bResult, "StackCrsr & act. Crsr not in same Section."); + (void) bResult; // non-debug: unused // kopiere das GetMark if( !pCurCrsr->HasMark() ) pCurCrsr->SetMark(); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 04d9c38c0e7d..4493f982f5cf 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1354,7 +1354,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) && 0 != ( pBox = pTblNd->GetTable().GetTblBox( pSttNd->GetIndex() )) && -#if OSL_DEBUG_LEVEL > 1 +#ifdef DBG_UTIL ( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( RES_BOXATR_FORMULA, sal_False, &pItem ) || SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 24afa4630224..ac2506f52c29 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -303,7 +303,7 @@ sal_Bool SwCrsrShell::SelTblBox() const SwStartNode* pStartNode = pCurCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // the old code checks whether we're in a table by asking the // frame. This should yield the same result as searching for the // table box start node, right? diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 063aeb6ef103..d08398ab2ba9 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -56,7 +56,7 @@ class SwAutoCompleteClient : public SwClient { SwAutoCompleteWord* pAutoCompleteWord; SwDoc* pDoc; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 static sal_uLong nSwAutoCompleteClientCount; #endif public: @@ -67,7 +67,7 @@ public: SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient); const SwDoc& GetDoc(){return *pDoc;} -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;} #endif protected: @@ -91,7 +91,7 @@ typedef const SwDoc* SwDocPtr; typedef std::vector SwDocPtrVector; class SwAutoCompleteString : public String { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 static sal_uLong nSwAutoCompleteStringCount; #endif SwDocPtrVector aSourceDocs; @@ -102,11 +102,11 @@ class SwAutoCompleteString : public String void AddDocument(const SwDoc& rDoc); //returns true if last document reference has been removed sal_Bool RemoveDocument(const SwDoc& rDoc); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 static sal_uLong GetElementCount() {return nSwAutoCompleteStringCount;} #endif }; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uLong SwAutoCompleteClient::nSwAutoCompleteClientCount = 0; sal_uLong SwAutoCompleteString::nSwAutoCompleteStringCount = 0; #endif @@ -116,7 +116,7 @@ SwAutoCompleteClient::SwAutoCompleteClient(SwAutoCompleteWord& rToTell, SwDoc& r pDoc(&rSwDoc) { pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ++nSwAutoCompleteClientCount; #endif } @@ -127,14 +127,14 @@ SwAutoCompleteClient::SwAutoCompleteClient(const SwAutoCompleteClient& rClient) pDoc(rClient.pDoc) { pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ++nSwAutoCompleteClientCount; #endif } SwAutoCompleteClient::~SwAutoCompleteClient() { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 --nSwAutoCompleteClientCount; #endif } @@ -191,14 +191,14 @@ void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc) SwAutoCompleteString::SwAutoCompleteString(const String& rStr, xub_StrLen nPos, xub_StrLen nLen) : String( rStr, nPos, nLen ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ++nSwAutoCompleteStringCount; #endif } SwAutoCompleteString::~SwAutoCompleteString() { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 --nSwAutoCompleteStringCount; #endif } @@ -247,7 +247,7 @@ SwAutoCompleteWord::~SwAutoCompleteWord() delete pCurrent; } delete pImpl; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uLong nStrings = SwAutoCompleteString::GetElementCount(); sal_uLong nClients = SwAutoCompleteClient::GetElementCount(); OSL_ENSURE(!nStrings && !nClients, "AutoComplete: clients or string count mismatch"); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index f841246b63ba..8160c8d4f59d 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -777,7 +777,7 @@ namespace sw { namespace mark m_vFieldmarks.clear(); m_vBookmarks.clear(); m_aMarkNamesSet.clear(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 for(iterator_t pBkmk = m_vMarks.begin(); pBkmk != m_vMarks.end(); ++pBkmk) diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index bf2dcbbd93cb..f3b02b4d8ea8 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -241,7 +241,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView ) SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); // #i53320# -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwAnchoredDrawObject* pAnchoredDrawObj = static_cast(pContact->GetAnchoredObj( pObj )); OSL_ENSURE( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(), diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index e5cd57e88699..130cb62f621b 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -576,15 +576,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) pFld->CalcField( aPara ); if( aPara.IsStackOverFlow() ) { - if( aPara.CalcWithStackOverflow() ) - pFld->CalcField( aPara ); -#if OSL_DEBUG_LEVEL > 1 - else + bool const bResult = aPara.CalcWithStackOverflow(); + if (bResult) { - // at least one ASSERT - OSL_ENSURE( !this, "the chained formula could no be calculated" ); + pFld->CalcField( aPara ); } -#endif + OSL_ENSURE(bResult, + "the chained formula could no be calculated"); } pCalc->SetCalcError( CALC_NOERR ); } @@ -645,15 +643,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( aPara.IsStackOverFlow() ) { - if( aPara.CalcWithStackOverflow() ) - pFml->Calc( aPara, nValue ); -#if OSL_DEBUG_LEVEL > 1 - else + bool const bResult = aPara.CalcWithStackOverflow(); + if (bResult) { - // at least one ASSERT - OSL_ENSURE( !this, "the chained formula could no be calculated" ); + pFml->Calc( aPara, nValue ); } -#endif + OSL_ENSURE(bResult, + "the chained formula could no be calculated"); } SwFrmFmt* pFmt = pBox->ClaimFrmFmt(); @@ -877,11 +873,9 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm ) SwNodeIndex aIdx( *rFrm.GetNode() ); SwDoc& rDoc = *aIdx.GetNodes().GetDoc(); SwPosition aPos( aIdx ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "Where is the field?" ); -#else - ::GetBodyTxtNode( rDoc, aPos, rFrm ); -#endif + bool const bResult = ::GetBodyTxtNode( rDoc, aPos, rFrm ); + OSL_ENSURE(bResult, "Where is the field?"); + (void) bResult; // unused in non-debug nNode = aPos.nNode.GetIndex(); nCntnt = aPos.nContent.GetIndex(); } @@ -2418,11 +2412,9 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) { // create index to determine the TextNode SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" ); -#else - GetBodyTxtNode( rDoc, aPos, *pFrm ); -#endif + bool const bResult = GetBodyTxtNode( rDoc, aPos, *pFrm ); + OSL_ENSURE(bResult, "where is the Field"); + (void) bResult; // unused in non-debug pNew = new _SetGetExpFld( aPos.nNode, &rTFld, &aPos.nContent ); } @@ -2466,11 +2458,9 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) if( !pFrm ) break; -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" ); -#else - GetBodyTxtNode( rDoc, aPos, *pFrm ); -#endif + bool const bResult = GetBodyTxtNode( rDoc, aPos, *pFrm ); + OSL_ENSURE(bResult, "where is the Field"); + (void) bResult; // unused in non-debug pNew = new _SetGetExpFld( rSectNd, &aPos ); } while( sal_False ); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index b39f329956a5..b0568417f269 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -636,7 +636,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // Continue with next selected object and assert, if this isn't excepted. if ( !pContact ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bool bNoUserCallExcepted = pObj->ISA(SwDrawVirtObj) && !static_cast(pObj)->IsConnected(); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 6ea2f5e8ef55..6057404318dd 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -198,7 +198,7 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ) } break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 case FLY_AT_PAGE: case FLY_AT_CHAR: case FLY_AT_FLY: @@ -1658,7 +1658,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, "Missing FlyInCnt-Hint." ); OSL_ENSURE( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()). diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 11c6e6c64357..072281f4b120 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -254,7 +254,7 @@ inline bool IsPrevPos( const SwPosition rPos1, const SwPosition rPos2 ) : false; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) { int nError = 0; @@ -2716,7 +2716,7 @@ sal_Bool SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, sal_uInt16* pInsP } else aNewStt = *pNew->GetPoint(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 CheckPosition( pNew->GetPoint(), pNew->GetMark() ); #endif if( *pNew->GetPoint() != *pNew->GetMark() && @@ -3674,10 +3674,10 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx ) delete pCntntSect, pCntntSect = 0; bIsVisible = sal_False; } -#if OSL_DEBUG_LEVEL > 1 else - OSL_ENSURE( !this, "das ist keine gueltige Operation" ); -#endif + { + OSL_FAIL("SwRedline::SetContentIdx: invalid state"); + } } sal_Bool SwRedline::CanCombine( const SwRedline& rRedl ) const diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 68ff6b9e6620..737ff129a63d 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -2254,7 +2254,7 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew) delete pNew; return; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_FAIL("Bibliography entries cannot be found here"); #endif diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 177460a70447..f785a3edff07 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -63,9 +63,7 @@ namespace TxtFmtCollFunc SwTxtFmtColl* pTxtFmtColl = dynamic_cast(pFmt); if ( !pTxtFmtColl ) { - #if OSL_DEBUG_LEVEL > 1 OSL_FAIL( " - misuse of method - it's only for instances of " ); - #endif return; } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index c94736a0fe74..6a2838c6349d 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1582,13 +1582,13 @@ static sal_Bool lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara ) static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara ) { sal_uInt16 *pWidth = (sal_uInt16 *)pPara; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 nOldWidth = *pWidth; #endif *pWidth = 0; ((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY, "Zeilen einer Box sind unterschiedlich lang" ); #endif @@ -1699,7 +1699,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail, } } -#if OSL_DEBUG_LEVEL > 1 +#ifdef DBG_UTIL { // steht im tblrwcl.cxx extern void _CheckBoxWidth( const SwTableLine&, SwTwips ); diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index b269451ac512..f501f6938a6e 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -107,11 +107,6 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) // angegeben ist. Dann muss der Doc. Name davor gesetzt werden! sal_Bool SwDoc::IsVisitedURL( const String& rURL ) const { -#if OSL_DEBUG_LEVEL > 1 - static long nTmp = 0; - ++nTmp; -#endif - sal_Bool bRet = sal_False; if( rURL.Len() ) { diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index ab489eb7241b..267db0e9eda5 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -1340,7 +1340,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte aRedlRest.Restore(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { //JP 17.06.99: Bug 66973 - check count only if the selection is in // the same (or no) section. Becaus not full selected diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index 5cbce94d072c..b4689d70b462 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -48,7 +48,7 @@ sal_Bool SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, sal_uInt16* pFndPos //JP 17.03.98: aufgrund des Bug 48592 - wo unter anderem nach Undo/Redo // Nodes aus dem falschen NodesArray im OutlineArray standen, // jetzt mal einen Check eingebaut. -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { for( sal_uInt16 n = 1; n < nO; ++n ) if( &(*this)[ n-1 ]->GetNodes() != diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 98ba0b5ae727..28474df94a8c 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -390,11 +390,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, sal_True, sal_False ); if( pFrmNd && !((SwCntntNode*)pFrmNd)->GetDepends() ) pFrmNd = 0; - -#if OSL_DEBUG_LEVEL > 1 - if( !pFrmNd ) - OSL_ENSURE( !this, "ChgNode() - kein FrameNode gefunden" ); -#endif + OSL_ENSURE( pFrmNd, "ChgNode() - no FrameNode found" ); } if( pFrmNd ) while( aIdx != rInsPos ) diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 43bc062ba10f..cf43e8169195 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -820,9 +820,7 @@ void SwDrawContact::SetMaster( SdrObject* _pNewMaster ) { if ( _pNewMaster ) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "debug notification - master replaced!" ); -#endif maAnchoredDrawObj.SetDrawObj( *_pNewMaster ); } else @@ -1583,7 +1581,7 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { // nothing to do } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_FAIL( " - unhandled attribute? - please inform od@openoffice.org" ); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 503a1cad081d..2aed507e0b7c 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -313,7 +313,7 @@ void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId ) break; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else sTxt = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Action-Text fehlt" )); diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 494f780898df..339b15425a73 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -276,7 +276,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell ) pDestShell->GetCrsr()->SetMark(); pDestShell->GetCrsr()->DeleteMark(); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // pruefe ob die Indizies auch in den richtigen Nodes angemeldet sind { SwPaM* pCmp = (SwPaM*)pDestShell->GetCrsr(); // sicher den Pointer auf Cursor diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 1cf820539fa5..c1cfdd8b86e2 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -278,22 +278,18 @@ const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const if( pGrf->IsSwapOut() || ( pGrfNode->IsLinkedFile() && GRAPHIC_DEFAULT == pGrf->GetType() ) ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); -#else - pGrfNode->SwapIn( bWait ); -#endif + bool const bResult = pGrfNode->SwapIn(bWait); + OSL_ENSURE(bResult || !bWait, "Graphic could not be loaded" ); + (void) bResult; // unused in non-debug } } else { if ( pGrf->IsSwapOut() && !pGrfNode->IsLinkedFile() ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); -#else - pGrfNode->SwapIn( bWait ); -#endif + bool const bResult = pGrfNode->SwapIn(bWait); + OSL_ENSURE(bResult || !bWait, "Graphic could not be loaded" ); + (void) bResult; // unused in non-debug } } } @@ -688,15 +684,14 @@ Graphic SwEditShell::GetIMapGraphic() const SwNode *pNd =pCrsr->GetNode(); if( pNd->IsGrfNode() ) { - const Graphic& rGrf = ((SwGrfNode*)pNd)->GetGrf(); - if( rGrf.IsSwapOut() || ( ((SwGrfNode*)pNd)->IsLinkedFile() && + SwGrfNode & rGrfNode(*static_cast(pNd)); + const Graphic& rGrf = rGrfNode.GetGrf(); + if( rGrf.IsSwapOut() || ( rGrfNode.IsLinkedFile() && GRAPHIC_DEFAULT == rGrf.GetType() ) ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( ((SwGrfNode*)pNd)->SwapIn( sal_True ), "Grafik konnte nicht geladen werden" ); -#else - ((SwGrfNode*)pNd)->SwapIn( sal_True ); -#endif + bool const bResult = rGrfNode.SwapIn(true); + OSL_ENSURE(bResult, "Graphic could not be loaded" ); + (void) bResult; // unused in non-debug } aRet = rGrf; } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 1dba53cbebd2..ab79e2d733f2 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -564,10 +564,10 @@ sal_Bool SwEditShell::IsProtectedOutlinePara() const } } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { - OSL_ENSURE(!this, "Cursor not on an outline node" ); + OSL_FAIL("Cursor not on an outline node"); } #endif return bRet; diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 69d6ddc8306d..40bfe24199ca 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -130,7 +130,7 @@ SwFieldType* SwAuthorityFieldType::Copy() const void SwAuthorityFieldType::RemoveField(long nHandle) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_Bool bRemoved = sal_False; #endif for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++) @@ -139,7 +139,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle) long nRet = (long)(void*)pTemp; if(nRet == nHandle) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bRemoved = sal_True; #endif pTemp->RemoveRef(); @@ -152,7 +152,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle) break; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE(bRemoved, "Field unknown" ); #endif } @@ -307,7 +307,7 @@ long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos) sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) { //find the field in a sorted array of handles, -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_Bool bCurrentFieldWithoutTextNode = sal_False; #endif if(!m_SequArr.empty() && m_SequArr.size() != m_pDataArr->Count()) @@ -324,7 +324,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); if(!pTxtFld || !pTxtFld->GetpTxtNode()) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if(nHandle == ((SwAuthorityField*)pFmtFld->GetFld())->GetHandle()) bCurrentFieldWithoutTextNode = sal_True; #endif @@ -396,7 +396,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) break; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE(bCurrentFieldWithoutTextNode || nRet, "Handle not found"); #endif return nRet; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index e86c80358773..2fce0d0ed322 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2201,12 +2201,9 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) { // einen sdbcx::Index fuers bestimmen vom TextNode anlegen SwPosition aPos( pDoc->GetNodes().GetEndOfPostIts() ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( GetBodyTxtNode( *pDoc, aPos, *pFrm ), - "wo steht das Feld" ); -#else - GetBodyTxtNode( *pDoc, aPos, *pFrm ); -#endif + bool const bResult = GetBodyTxtNode( *pDoc, aPos, *pFrm ); + OSL_ENSURE(bResult, "where is the Field?"); + (void) bResult; // unused in non-debug pNew = new _SetGetExpFld( aPos.nNode, pTFld, &aPos.nContent ); } diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 28becd7069d7..4fea3281af8c 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -64,7 +64,7 @@ sal_uInt16 SwFEShell::GetPageDescCnt() const void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 //Die SS veraendert keinen PageDesc, sondern setzt nur das Attribut. //Der Pagedesc muss im Dokument vorhanden sein! sal_Bool bFound = sal_False; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 94f0062643e5..d3dcc0d2c996 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -217,7 +217,7 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ) SwDoc* pDoc = (SwDoc*)rFmt.GetDoc(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !(nNew == FLY_AT_PAGE && (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) && pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )), @@ -581,7 +581,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) SwRect aTmpRect( aRet, rAbsPos ); if( aTmpRect.HasArea() ) MakeVisible( aTmpRect ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 //TODO: That doesn't seem to be intended if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() ) { @@ -2113,7 +2113,7 @@ void SwFEShell::SetObjDescription( const String& rDescription ) void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedObject >& xObj, SwFlyFrm * pFly ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SvGlobalName aCLSID( xObj->getClassID() ); const bool bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 ); OSL_ENSURE( bStarMath, "AlignFormulaToBaseline should only be called for Math objects" ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 1e2d9ee764da..8858075c378c 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -706,23 +706,19 @@ void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) //mich also bei meinem Format aus. //Dabei werden ich Deletet!!! if( IS_TYPE( SwFmt, pDefinedIn )) -#if OSL_DEBUG_LEVEL > 1 { - sal_Bool bDel = ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC ); - OSL_ENSURE( bDel, ";-) FmtPageDesc nicht zerstoert." ); + bool const bResult = + static_cast(pDefinedIn)->ResetFmtAttr(RES_PAGEDESC); + OSL_ENSURE( bResult, "FmtPageDesc not deleted" ); + (void) bResult; // unused in non-debug } -#else - ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC ); -#endif else if( IS_TYPE( SwCntntNode, pDefinedIn )) -#if OSL_DEBUG_LEVEL > 1 { - sal_Bool bDel = ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC ); - OSL_ENSURE( bDel, ";-) FmtPageDesc nicht zerstoert." ); + bool const bResult = static_cast(pDefinedIn) + ->ResetAttr(RES_PAGEDESC); + OSL_ENSURE( bResult, "FmtPageDesc not deleted" ); + (void) bResult; // unused in non-debug } -#else - ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC ); -#endif break; default: diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 66e8d96a2605..1b2564422bb2 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -840,14 +840,8 @@ void SwPageFrm::MakeAll() if ( Frm() != aOldRect && GetUpper() ) static_cast(GetUpper())->CheckViewLayout( 0, 0 ); -#if OSL_DEBUG_LEVEL > 1 - //Der Upper (Root) muss mindestens so breit - //sein, dass er die breiteste Seite aufnehmen kann. - if ( GetUpper() ) - { - OSL_ENSURE( GetUpper()->Prt().Width() >= aFrm.Width(), "Rootsize" ); - } -#endif + OSL_ENSURE( !GetUpper() || GetUpper()->Prt().Width() >= aFrm.Width(), + "Upper (Root) must be wide enough to contain the widest page"); } /************************************************************************* @@ -1434,7 +1428,7 @@ void SwCntntFrm::MakeAll() { Format(); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_FAIL( "debug assertion: - format of text frame suppressed by fix b6448963" ); @@ -1682,7 +1676,7 @@ void SwCntntFrm::MakeAll() ( !bSct || !FindSctFrm()->IsColLocked() ) ) bMoveOrFit = sal_True; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_FAIL( "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." ); @@ -1737,7 +1731,7 @@ void SwCntntFrm::MakeAll() continue; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_FAIL( "LoopControl in SwCntntFrm::MakeAll" ); #endif } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 3ca26041d87c..002623de0e0b 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2480,9 +2480,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat ) pNextNewUpper->GetType() != rThis.GetUpper()->GetType() ) ) { pNewUpper = 0L; -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( " - layout loop control for layout action applied!" ); -#endif } } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 45da740f338c..58db3de0eac7 100755 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1754,9 +1754,7 @@ void CalcCntnt( SwLayoutFrm *pLay, if ( nLoopControlRuns < nLoopControlMax ) continue; -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "LoopControl in CalcCntnt" ); -#endif } } if ( pFrm->IsTabFrm() ) diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 016f39a1aba9..f005b04dc5b9 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -497,9 +497,7 @@ void SwFlyAtCntFrm::MakeAll() pFmt->SetFmtAttr( aSurround ); pFmt->UnlockModify(); bOsz = false; -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( " - special loop prevention for dedicated document of b6403541 applied" ); -#endif } } } diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 170779683097..170558236609 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -231,9 +231,7 @@ void SwFlyFreeFrm::MakeAll() { ++nLoopControlRuns; -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrm::MakeAll" ); -#endif if ( nLoopControlRuns < nLoopControlMax ) CheckClip( *pSz ); @@ -243,7 +241,7 @@ void SwFlyFreeFrm::MakeAll() } Unlock(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SWRECTFN( this ) OSL_ENSURE( bHeightClipped || ( (Frm().*fnRect->fnGetHeight)() > 0 && (Prt().*fnRect->fnGetHeight)() > 0), @@ -639,14 +637,9 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) if ( !pSortedObjs ) pSortedObjs = new SwSortedObjs(); -#if OSL_DEBUG_LEVEL > 1 - const bool bSucessInserted = -#endif - pSortedObjs->Insert( *pNew ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( bSucessInserted, "Fly nicht in Sorted eingetragen." ); + const bool bSucessInserted = pSortedObjs->Insert( *pNew ); + OSL_ENSURE( bSucessInserted, "Fly not inserted in Sorted." ); (void) bSucessInserted; -#endif // #i87493# OSL_ENSURE( pNew->GetPageFrm() == 0 || pNew->GetPageFrm() == this, @@ -801,14 +794,9 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest ) if ( !pDest->GetSortedObjs() ) pDest->pSortedObjs = new SwSortedObjs(); -#if OSL_DEBUG_LEVEL > 1 - const bool bSucessInserted = -#endif - pDest->GetSortedObjs()->Insert( *pToMove ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( bSucessInserted, "Fly nicht in Sorted eingetragen." ); + const bool bSucessInserted = pDest->GetSortedObjs()->Insert( *pToMove ); + OSL_ENSURE( bSucessInserted, "Fly not inserted in Sorted." ); (void) bSucessInserted; -#endif // #i28701# - use new method pToMove->SetPageFrm( pDest ); @@ -902,10 +890,8 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj ) } if ( !pSortedObjs->Insert( _rNewObj ) ) { -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pSortedObjs->Contains( _rNewObj ), "Drawing object not appended into list ." ); -#endif } // #i87493# OSL_ENSURE( _rNewObj.GetPageFrm() == 0 || _rNewObj.GetPageFrm() == this, diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 4e26ed433f81..f94c6a581c07 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -671,7 +671,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) pDel->Cut(); delete pDel; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwDoc *pDoc = GetFmt()->GetDoc(); if ( GetPrev() ) { @@ -1109,7 +1109,7 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont() while( pFrm && !pFrm->IsFtnContFrm() ) pFrm = pFrm->GetNext(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if ( pFrm ) { SwFrm *pFtn = pFrm->GetLower(); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 57bd8a2971f4..bb3ead50216b 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -690,10 +690,7 @@ void SwLayAction::InternalAction() if ( ++nLoopControlRuns_1 > nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "LoopControl_1 in SwLayAction::InternalAction" ); - -#endif break; } @@ -877,9 +874,7 @@ void SwLayAction::InternalAction() if ( ++nLoopControlRuns_3 > nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "LoopControl_3 in Interrupt formatting in SwLayAction::InternalAction" ); -#endif break; } @@ -900,9 +895,7 @@ void SwLayAction::InternalAction() if ( ++nLoopControlRuns_2 > nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "LoopControl_2 in Interrupt formatting in SwLayAction::InternalAction" ); -#endif break; } diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 9e2c6ac33db3..6f1463626847 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -377,7 +377,7 @@ void _FrmInit() void _FrmFinit() { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // im Chache duerfen nur noch 0-Pointer stehen for( sal_uInt16 n = SwFrm::GetCachePtr()->Count(); n; ) if( (*SwFrm::GetCachePtr())[ --n ] ) diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx index e3f6777f7eb3..0416bee9583b 100644 --- a/sw/source/core/layout/objectformatter.cxx +++ b/sw/source/core/layout/objectformatter.cxx @@ -396,9 +396,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj ) if ( ++nLoopControlRuns >= nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( "LoopControl in SwObjectFormatter::_FormatObj: Stage 3!!!" ); -#endif rFlyFrm.ValidateThisAndAllLowers( 2 ); nLoopControlRuns = 0; } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 5f2637d70543..6ce9f2c8574b 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1205,7 +1205,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields ) if ( pPage->GetFmt() != pFmtWish ) pPage->SetFrmFmt( pFmtWish ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_FAIL( "CheckPageDescs, missing solution" ); @@ -1248,7 +1248,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields ) pDoc->UpdatePageFlds( &aMsgHnt ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 //Ein paar Pruefungen muessen schon erlaubt sein. //1. Keine zwei EmptyPages hintereinander. diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8985a9b4f4e3..68900f124c22 100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1382,7 +1382,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, if ( pRetoucheFly && pRetoucheFly->IsLowerOf( pFly ) ) continue; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 //Flys, die innerhalb des eigenen verankert sind, muessen eine //groessere OrdNum haben oder Zeichengebunden sein. if ( pSelfFly && bLowerOfSelf ) @@ -2039,7 +2039,7 @@ void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &aOut ) io_aSwRect = SwRect( aSizedRect ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 Rectangle aTestOrgPxRect = aOut.LogicToPixel( io_aSwRect.SVRect() ); Rectangle aTestNewPxRect = aOut.LogicToPixel( aSizedRect ); OSL_ENSURE( aTestOrgPxRect == aTestNewPxRect, diff --git a/sw/source/core/layout/sortedobjsimpl.cxx b/sw/source/core/layout/sortedobjsimpl.cxx index 4fe87a15e612..48536d3dd757 100644 --- a/sw/source/core/layout/sortedobjsimpl.cxx +++ b/sw/source/core/layout/sortedobjsimpl.cxx @@ -216,9 +216,7 @@ bool SwSortedObjsImpl::Insert( SwAnchoredObject& _rAnchoredObj ) if ( Contains( _rAnchoredObj ) ) { // list already contains object -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( " - already contains object" ); -#endif return true; } @@ -245,9 +243,7 @@ bool SwSortedObjsImpl::Remove( SwAnchoredObject& _rAnchoredObj ) { // object not found. bRet = false; -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL( " - object not found" ); -#endif } else { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index cfd77c9e2439..502c2d1c42c3 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -405,7 +405,7 @@ SwFrm::~SwFrm() delete pDrawObjs; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // JP 15.10.2001: for detection of access to deleted frames pDrawObjs = (SwSortedObjs*)0x33333333; #endif diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index b139c59065f9..591a5b5bd39e 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2611,7 +2611,7 @@ void SwTabFrm::MakeAll() bLowersFormatted = sal_True; bCalcLowers = sal_False; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_FAIL( "debug assertion: - format of table lowers suppressed by fix i44910" ); @@ -3345,7 +3345,7 @@ SwCntntFrm *SwTabFrm::FindLastCntnt() // Spalten abklappern, dies erledigt SwSectionFrm::FindLastCntnt if( pRet->IsColBodyFrm() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwSectionFrm* pSect = pRet->FindSctFrm(); OSL_ENSURE( pSect, "Wo kommt denn die Spalte her?"); OSL_ENSURE( IsAnLower( pSect ), "Gespaltene Zelle?" ); @@ -4267,7 +4267,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs ) { bValidSize = sal_True; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if ( HasFixSize() ) { const SwFmtFrmSize &rFrmSize = GetFmt()->GetFrmSize(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index d82eb35f80a0..318ab8812e9a 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1329,11 +1329,8 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint, break; } -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pActual, "Keinen Cntnt gefunden." ); - if ( bBodyOnly ) - OSL_ENSURE( pActual->IsInDocBody(), "Cnt nicht im Body." ); -#endif + OSL_ENSURE( pActual, "no Cntnt found." ); + OSL_ENSURE( !bBodyOnly || pActual->IsInDocBody(), "Cntnt not in Body." ); //Spezialfall fuer das selektieren von Tabellen, nicht in wiederholte //TblHedlines. diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index dc3e131838a2..df50676696fc 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -3788,7 +3788,7 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv ) if( pLastSctCnt == pCnt ) pLastSctCnt = NULL; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( !pLastSctCnt, "Where's the last SctCntnt?" ); #endif @@ -3816,7 +3816,7 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv ) pLastSctCnt = NULL; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( !pLastTabCnt, "Where's the last TabCntnt?" ); #endif diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index a7ecdaddfb9d..e5d4c3aea8aa 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -65,7 +65,7 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj ) mbFollowTextFlow( false ), mbDoNotCaptureAnchoredObj( false ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // assert, if object isn't of excepted type const bool bObjOfExceptedType = mrDrawObj.ISA(SwVirtFlyDrawObj) || // object representing fly frame diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index c20402cebf32..a16f2d496db3 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -771,7 +771,7 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, } aFndBox.MakeFrms( *this ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { const SwTableBoxes &rTabBoxes = aLines[0]->GetTabBoxes(); long nNewWidth = 0; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 2f35e82649b5..2d9099f90370 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -887,13 +887,13 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset, aCharBox.Pos().X() = aCharBox.Pos().X() - 150; // siehe Kommentar in SwTxtFrm::GetCrsrOfst() -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex(); #endif // Der Node soll nicht gewechselt werden xub_StrLen nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(), aCharBox.Pos(), sal_False ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(), "SwTxtFrm::UnitUp: illegal node change" ); #endif @@ -1255,7 +1255,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, if( pNextLine || bFirstOfDouble ) { aCharBox.SSize().Width() /= 2; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // siehe Kommentar in SwTxtFrm::GetCrsrOfst() const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex(); #endif @@ -1264,7 +1264,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, xub_StrLen nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(), aCharBox.Pos(), sal_False ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(), "SwTxtFrm::UnitDown: illegal node change" ); #endif diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index aa253bcbc445..4ff584e2b7ca 100755 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -230,7 +230,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst ) ( pMyFollow->IsVertical() && !pMyFollow->Prt().Width() ) || ( ! pMyFollow->IsVertical() && !pMyFollow->Prt().Height() ) ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const SwFrm *pOldUp = GetUpper(); #endif @@ -359,7 +359,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst ) pPage->ValidateCntnt(); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( pOldUp == GetUpper(), "SwTxtFrm::CalcFollow: heavy follow" ); #endif diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index 83c175885486..0e71cb591096 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -262,7 +262,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, xub_StrLen nOldIdx = rInf.GetIdx(); xub_Unicode cFldChr = 0; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 XubString aDebugString; #endif @@ -284,7 +284,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, nCutPos = nCutPos + nFieldDiff; nHyphPos = nHyphPos + nFieldDiff; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 aDebugString = rInf.GetTxt(); #endif @@ -506,7 +506,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, rOldTxt.Insert( cFldChr, nOldIdx - 1 ); rInf.SetIdx( nOldIdx ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( aDebugString == rInf.GetTxt(), "Somebody, somebody, somebody put something in my string" ); #endif diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 04a6705d57ae..53dab16620e4 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -213,7 +213,7 @@ SwTxtInfo::SwTxtInfo( const SwTxtInfo &rInf ) { } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 /************************************************************************* * ChkOutDev() *************************************************************************/ @@ -266,7 +266,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew ) bSnapToGrid( rNew.SnapToGrid() ), nDirection( rNew.GetDirection() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ChkOutDev( *this ); #endif } @@ -303,7 +303,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt, pRef = pOut; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ChkOutDev( *this ); #endif @@ -379,7 +379,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt, bSnapToGrid( rNew.SnapToGrid() ), nDirection( rNew.GetDirection() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ChkOutDev( *this ); #endif SetLen( GetMinLen( *this ) ); diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index f36a2e9d6539..79c869566f1d 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -110,7 +110,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.OnWin() && rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const xub_Unicode cChar = rInf.GetChar( rInf.GetIdx() ); OSL_ENSURE( CH_BLANK == cChar || CH_BULLET == cChar, "SwGluePortion::Paint: blank expected" ); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 23ccc27f2c2e..488732e78619 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1184,7 +1184,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) nLastKashida = nChg; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // check kashida data long nTmpKashidaPos = -1; sal_Bool bWrongKash = sal_False; @@ -1269,7 +1269,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx, ScriptChangeInfo(nEnd, i18n::ScriptType::COMPLEX) ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // Check that ScriptChangeInfos are in increasing order of // position and that we don't have "empty" changes. sal_uInt8 nLastTyp = i18n::ScriptType::WEAK; diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 60625adba76d..e64d0ef2658e 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -39,7 +39,7 @@ #include "pormulti.hxx" #include "porglue.hxx" #include "blink.hxx" -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_Bool ChkChain( SwLinePortion *pStart ) { @@ -208,7 +208,7 @@ SwLinePortion *SwLinePortion::Insert( SwLinePortion *pIns ) { pIns->FindLastPortion()->SetPortion( pPortion ); SetPortion( pIns ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ChkChain( this ); #endif return pIns; @@ -238,7 +238,7 @@ SwLinePortion *SwLinePortion::Append( SwLinePortion *pIns ) SwLinePortion *pPos = FindLastPortion(); pPos->SetPortion( pIns ); pIns->SetPortion( 0 ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ChkChain( this ); #endif return pIns; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 4c4d2738fcce..23a7dd090025 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -493,7 +493,7 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff ) void SwHiddenTextPortion::Paint( const SwTxtPaintInfo & rInf) const { (void)rInf; -#if OSL_DEBUG_LEVEL > 1 +#ifdef DBG_UTIL OutputDevice* pOut = (OutputDevice*)rInf.GetOut(); Color aCol( SwViewOption::GetFieldShadingsColor() ); Color aOldColor( pOut->GetFillColor() ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 1b81ec47aea8..07bfc0887fb0 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -360,7 +360,7 @@ SwTwips SwTxtFrm::_GetFtnFrmHeight() const SwTwips nTmp = (*fnRect->fnYDiff)( (pCont->*fnRect->fnGetPrtBottom)(), (Frm().*fnRect->fnGetTop)() ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( nTmp < 0 ) { sal_Bool bInvalidPos = sal_False; diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 341bde27d0c5..f8513daa8bde 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -339,12 +339,7 @@ SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillCh : SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab ) { nLineLength = 1; -#if OSL_DEBUG_LEVEL > 1 - if( IsFilled() ) - { - OSL_ENSURE( ' ' != cFill, "SwTabPortion::CTOR: blanks ?!" ); - } -#endif + OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!"); SetWhichPor( POR_TAB ); } @@ -647,9 +642,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const // Tabs mit Fuellung XubString aTxt( cFill ); const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" ); -#endif // robust: if( nCharWidth ) { diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index b13f59b117fe..dc8007e9b1a7 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -552,14 +552,14 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen ) ++iLoop; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const int nOldSize = Count(); (void) nOldSize; #endif maList.erase(i1, i2); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( Count() + nLen == nOldSize, "SwWrongList::Remove() trouble" ); #endif } diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx index 9e9b261ad04e..f977f17c704e 100644 --- a/sw/source/core/tox/toxhlp.cxx +++ b/sw/source/core/tox/toxhlp.cxx @@ -58,12 +58,12 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper() } } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("IndexEntrySupplierWrapper: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); @@ -84,12 +84,12 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt, sRet = xIES->getIndexKey( rTxt, rTxtReading, rLocale ); } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexKey: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); @@ -105,12 +105,12 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const sRet = xIES->getIndexFollowPageWord( bMorePages, aLcl ); } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexFollowPageWord: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); @@ -128,12 +128,12 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc sRet = xIES->getAlgorithmList( rLcl ); } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getAlgorithmList: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); @@ -151,12 +151,12 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm( bRet = xIES->loadAlgorithm( rLcl, sSortAlgorithm, nOptions ); } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("loadAlgorithm: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); @@ -177,12 +177,12 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry( rTxt2, rTxtReading2, rLocale2 ); } catch ( UNO_NMSPC::Exception& -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 e #endif ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("compareIndexEntry: Exception caught\n")); aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); OSL_FAIL( aMsg.getStr() ); diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index ee3d247db41f..e28c3da9d6de 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -186,12 +186,9 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, { SwPosition aPos( *pNd ); const SwDoc& rDoc = *pNd->GetDoc(); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), - "wo steht der Absatz" ); -#else - GetBodyTxtNode( rDoc, aPos, *pFrm ); -#endif + bool const bResult = GetBodyTxtNode( rDoc, aPos, *pFrm ); + OSL_ENSURE(bResult, "where is the text node"); + (void) bResult; // unused in non-debug nPos = aPos.nNode.GetIndex(); nCntPos = aPos.nContent.GetIndex(); } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 6957230c48ef..b545acb11b0e 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -356,7 +356,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rO ((OutputDevice&)rRefDev).SetFont( *pPrtFont ); nPrtHeight = static_cast(rRefDev.GetTextHeight()); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // Check if vcl did not change the meading of GetTextHeight const FontMetric aOutMet( rRefDev.GetFontMetric() ); long nTmpPrtHeight = (sal_uInt16)aOutMet.GetAscent() + aOutMet.GetDescent(); @@ -840,7 +840,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) // a window. Therefore bUseSrcFont is always 0 in this case. // -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const sal_Bool bNoAdjust = bPrt || ( pWin && diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index a703f6fd4c8e..9e807118b93b 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -210,7 +210,7 @@ sal_Bool SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, sal_uInt16 *pPos ) con void SwpHintsArray::Insert( const SwTxtAttr *pHt ) { Resort(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 nPos; OSL_ENSURE(!m_HintStarts.Seek_Entry( pHt, &nPos ), "Insert: hint already in HtStart"); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index dc5cca5db7e4..fb3275229d89 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -338,7 +338,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode ) ((SwTxtFrm*)pFrm)->SetFtn( sal_True ); } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 while( 0 != (pCntnt = aIter.Next()) ) { SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm(); @@ -3500,10 +3500,8 @@ SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl ) { SetCalcHiddenCharFlags(); SwCntntNode::ChgFmtColl( pNewColl ); -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( !mbInSetOrResetAttr, "DEBUG OSL_ENSURE(ON - called during " ); -#endif if ( !mbInSetOrResetAttr ) { SwFmtChg aTmp1( pOldColl ); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 54ef401f2ecf..a26b2c93a0e6 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -113,7 +113,7 @@ sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) case 2700 : nDir = 1800; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default : OSL_FAIL( "Unsupported direction" ); break; @@ -140,7 +140,7 @@ sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) case 2700 : nDir = 0; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default : OSL_FAIL( "Unsupported direction" ); break; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 18f6daaf3bc8..f623df574fcd 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1414,13 +1414,9 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // FussNote im Redline-Bereich NICHT ins FtnArray einfuegen! if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() ) { -#if OSL_DEBUG_LEVEL > 1 - const sal_Bool bSuccess = -#endif - pDoc->GetFtnIdxs().Insert( pTxtFtn ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( bSuccess, "FtnIdx nicht eingetragen." ); -#endif + const bool bSuccess = pDoc->GetFtnIdxs().Insert(pTxtFtn); + OSL_ENSURE( bSuccess, "FtnIdx not inserted." ); + (void) bSuccess; // unused in non-debug } SwNodeIndex aTmpIndex( *this ); pDoc->GetFtnIdxs().UpdateFtn( aTmpIndex); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 8fe6051f4fb8..27b58fc9a5ad 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1476,9 +1476,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf ) // 4935: Seit der Trennung ueber Sonderbereiche sind Faelle // moeglich, in denen kein Frame zum Node vorliegt. // Also keinOSL_ENSURE -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pFrm, "!SwTxtNode::Hyphenate: can't find any frame" ); -#endif return sal_False; } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 904aebde6b31..59b99de4606d 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -64,7 +64,7 @@ public: SwNodeIndex* GetMvSttIdx() const { return SwUndoSaveSection::GetMvSttIdx(); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 nRedlineCount; #endif }; @@ -1019,7 +1019,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos, OSL_ENSURE( !this, "keine gueltigen Daten!" ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl().Count(); #endif } @@ -1053,12 +1053,10 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam ) if (rDoc.GetDocShell() && (pRedl->GetComment() != String()) ) rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED)); // -#if OSL_DEBUG_LEVEL > 0 - bool const bSuccess = -#endif - rDoc.AppendRedline( pRedl, true ); + bool const bSuccess = rDoc.AppendRedline( pRedl, true ); OSL_ENSURE(bSuccess, "SwRedlineSaveData::RedlineToDoc: insert redline failed"); + (void) bSuccess; // unused in non-debug rDoc.SetRedlineMode_intern( eOld ); } @@ -1133,7 +1131,7 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData ) for( sal_uInt16 n = rSData.Count(); n; ) rSData[ --n ]->RedlineToDoc( aPam ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // check redline count against count saved in RedlineSaveData object OSL_ENSURE( (rSData.Count() == 0) || (rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()), diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 537d4ad48efc..bf6378212c1a 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -193,7 +193,7 @@ public: void InsertSort( std::vector& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 #include "shellio.hxx" void CheckTable( const SwTable& ); #define CHECKTABLE(t) CheckTable( t ); @@ -3206,9 +3206,7 @@ void InsertSort( std::vector& rArr, sal_uInt16 nIdx, sal_uInt16* pIn *pInsPos = nU; } -#if OSL_DEBUG_LEVEL > 1 - - +#if OSL_DEBUG_LEVEL > 0 void CheckTable( const SwTable& rTbl ) { const SwNodes& rNds = rTbl.GetFrmFmt()->GetDoc()->GetNodes(); diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 2c4feef7dacd..06182ca234b8 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -1260,7 +1260,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // do some extra sanity checking that the length of the sequences // matches their range representation { @@ -1966,7 +1966,7 @@ SwChartDataSequence::SwChartDataSequence( } release(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OUString aRangeStr( getSourceRangeRepresentation() ); // check if it can properly convert into a SwUnoTableCrsr @@ -2016,7 +2016,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) : } release(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OUString aRangeStr( getSourceRangeRepresentation() ); // check if it can properly convert into a SwUnoTableCrsr diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index eab043ad200f..44bea6b2496d 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2685,7 +2685,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) : SwXShape(xShape) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 uno::Reference xShapes(xShapeAgg, uno::UNO_QUERY); 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 578a8390751a..2b64ed1bd742 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -197,7 +197,7 @@ sal_uInt16 lcl_ServiceIdToResId(sal_uInt16 nServiceId) const ServiceIdResId* pMap = aServiceToRes; while( USHRT_MAX != pMap->nServiceId && nServiceId != pMap->nServiceId ) ++pMap; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( USHRT_MAX == pMap->nServiceId ) OSL_FAIL("service id not found"); #endif @@ -277,7 +277,7 @@ sal_uInt16 lcl_GetServiceForField( const SwField& rFld ) break; } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( USHRT_MAX == nSrvId ) OSL_FAIL("resid not found"); #endif diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index ce1da24326ec..2d79a7dfcac1 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -380,9 +380,7 @@ void lcl_GetCellPosition( const String &rCellName, } } } -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( rColumn != -1 && rRow != -1, "failed to get column or row index" ); -#endif } // arguments: must be non-empty strings with valid cell names @@ -461,7 +459,7 @@ int lcl_CompareCellRanges( // (note that the indices nColumn and nRow are 0 based here) String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { sal_Int32 nCol, nRow2; lcl_GetCellPosition( String::CreateFromAscii("z1"), nCol, nRow2); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index c9d02d5c1ec9..4093d0d6ef19 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1977,7 +1977,7 @@ lcl_ApplyRowProperties( } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 //-->debug cell properties of all rows static void lcl_DebugCellProperties( @@ -2077,7 +2077,7 @@ lcl_ApplyCellProperties( { std::vector::iterator aMergedIter = rMergedCells.begin(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bool bDbgFound = false; #endif while (aMergedIter != rMergedCells.end()) @@ -2087,13 +2087,13 @@ lcl_ApplyCellProperties( nLeftPos)) { aMergedIter->aCells.push_back( xCellPS ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bDbgFound = true; #endif } ++aMergedIter; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( bDbgFound, "couldn't find first vertically merged cell" ); #endif @@ -2262,7 +2262,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) xRows->getByIndex(nRow), aRowSeparators[nRow]); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 lcl_DebugCellProperties(rCellProperties); #endif diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index d3f410557623..eca947b7bd28 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -94,9 +94,7 @@ void ViewShell::PrintProspect( ) { const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagePairsForProspectPrinting().size() - 1; -#if OSL_DEBUG_LEVEL > 1 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) return; @@ -107,10 +105,8 @@ void ViewShell::PrintProspect( std::pair< sal_Int32, sal_Int32 > rPagesToPrint = rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ]; -#if OSL_DEBUG_LEVEL > 1 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 ViewShell aShell( *this, 0, pPrinter ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index f1b4b5f03aa3..b02b26f78ba0 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -536,7 +536,7 @@ void ViewShell::MakeVisible( const SwRect &rRect ) EndAction(); } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); //swmod 071108//swmod 071225 } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_ENSURE( !this, "MakeVisible fuer Drucker wird doch gebraucht?" ); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index f920ac21cd52..d5c096ee3222 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -463,9 +463,7 @@ sal_Bool ViewShell::PrintOrPDFExport( { const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagesToPrint().size() - 1; -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds"); -#endif if (!pOutDev || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer) return sal_False; diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 2b0e1da86a23..3854aa0cc7d4 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1779,15 +1779,10 @@ sal_Bool SwHTMLParser::FileDownload( const String& rURL, pStream = 0; } - // View wieder anlgen -#if OSL_DEBUG_LEVEL > 1 - ViewShell *pVSh = -#endif - CallStartAction( pOldVSh ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pOldVSh == pVSh, "FileDownload: ViewShell wurde ausgetauscht" ); + // recreate View + ViewShell *const pVSh = CallStartAction( pOldVSh ); + OSL_ENSURE( pOldVSh == pVSh, "FileDownload: ViewShell changed on us" ); (void) pVSh; -#endif return pStream!=0; } diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 6512f987891f..ca556357d8cd 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -349,7 +349,7 @@ void SwHTMLWriter::OutFootEndNotes() if( !pFootEndNotes ) return; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 nFtn = nFootNote, nEn = nEndNote; #endif nFootNote = 0, nEndNote = 0; @@ -415,7 +415,7 @@ void SwHTMLWriter::OutFootEndNotes() } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( nFtn == nFootNote, "SwHTMLWriter::OutFootEndNotes: Anzahl Fussnoten stimmt nicht" ); OSL_ENSURE( nEn == nEndNote, diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index de92f0755bad..99ac79a00509 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -885,7 +885,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) { OSL_ENSURE( nCells < pCells->Count(), "Anzahl Zellen falsch" ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 nEnd = pCells->Count(); #endif // The colspan of empty cells at the end has to be fixed to the new @@ -896,7 +896,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) HTMLTableCell *pCell = (*pCells)[--i]; if( !pCell->GetContents() ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( pCell->GetColSpan() == nEnd - i, "invalid col span for empty cell at row end" ); #endif @@ -905,7 +905,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) else break; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 for( i=nCells; iGetColSpan(); -#if OSL_DEBUG_LEVEL > 1 - if( nCol == nRightCol-1 ) - { - OSL_ENSURE( bSplit, "Split-Flag falsch" ); - } -#endif + OSL_ENSURE((nCol != nRightCol-1) || bSplit, "Split-Flag wrong"); if( bSplit ) { SwTableBox* pBox = 0; @@ -3353,7 +3348,7 @@ void _CellSaveStruct::AddContents( HTMLTableCnts *pNewCnts ) void _CellSaveStruct::InsertCell( SwHTMLParser& rParser, HTMLTable *pCurTable ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // Die Attribute muessen schon beim Auefrauemen des Kontext-Stacks // entfernt worden sein, sonst ist etwas schiefgelaufen. Das // Checken wir mal eben ... diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 94f1d28b5371..05b83f1ad632 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -35,7 +35,7 @@ #include #include #include -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 #include #endif #include @@ -721,7 +721,7 @@ void SwHTMLParser::Continue( int nToken ) pPam->GetPoint()->nContent.Assign( pTxtNode, nStt ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // !!! sollte nicht moeglich sein, oder ?? OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( sal_True ).nNode.GetIndex(), "Pam.Bound1 steht noch im Node" ); @@ -975,7 +975,7 @@ void SwHTMLParser::NextToken( int nToken ) return ; } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( pPendStack ) { switch( nToken ) @@ -2481,11 +2481,11 @@ ViewShell *SwHTMLParser::CallStartAction( ViewShell *pVSh, sal_Bool bChkPtr ) if( !pVSh || bChkPtr ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 ViewShell *pOldVSh = pVSh; #endif pDoc->GetEditShell( &pVSh ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( !pVSh || !pOldVSh || pOldVSh == pVSh, "CallStartAction: Wer hat die ViewShell ausgetauscht?" ); if( pOldVSh && !pVSh ) pVSh = 0; @@ -2512,7 +2512,7 @@ ViewShell *SwHTMLParser::CallEndAction( sal_Bool bChkAction, sal_Bool bChkPtr ) pDoc->GetEditShell( &pVSh ); OSL_ENSURE( !pVSh || pActionViewShell == pVSh, "CallEndAction: Wer hat die ViewShell ausgetauscht?" ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( pActionViewShell && !pVSh ) pVSh = 0; #endif @@ -2578,7 +2578,7 @@ ViewShell *SwHTMLParser::CheckActionViewShell() pDoc->GetEditShell( &pVSh ); OSL_ENSURE( !pVSh || pActionViewShell == pVSh, "CheckActionViewShell: Wer hat die ViewShell ausgetauscht?" ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( pActionViewShell && !pVSh ) pVSh = 0; #endif @@ -3883,7 +3883,7 @@ void SwHTMLParser::EndPara( sal_Bool bReal ) { if( HTML_LI_ON==nOpenParaToken && pTable ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 const SwNumRule *pNumRule = pPam->GetNode()->GetTxtNode()->GetNumRule(); OSL_ENSURE( pNumRule, "Wo ist die Numrule geblieben" ); #endif diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index 95242b8d3607..eec156d6a049 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -679,7 +679,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule ) } pDoc->DelNumRule( pRule->GetName() ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else { OSL_ENSURE( pRule, "NumRulePointer 0 kann nicht geloescht werden" ); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index b381ad08fba6..bd9cccb04797 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -412,7 +412,7 @@ void SwRTFParser::Continue( int nToken ) pPam->GetPoint()->nContent.Assign( pTxtNode, nStt ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // !!! sollte nicht moeglich sein, oder ?? OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( sal_True ).nNode.GetIndex(), "Pam.Bound1 steht noch im Node" ); @@ -2144,7 +2144,7 @@ void SwRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) SwPaM aPam( *pPam->GetPoint() ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE( nSNd <= nENd, "Start groesser als Ende" ); SwNode* pDebugNd = pDoc->GetNodes()[ nSNd ]; OSL_ENSURE( pDebugNd->IsCntntNode(), "Start kein ContentNode" ); diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index db16bad29296..8832920e3030 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -428,7 +428,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, sal_Bool bSubExpanded = sal_False; sal_uInt16 nLines = rLines.Count(); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt32 nEndCPos = 0; #endif @@ -464,11 +464,11 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } else { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 long nCheckPos = nRPos + GetLineHeight( pLine ); #endif nRPos = nStartRPos + nParentLineHeight; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwWriteTableRow aRow( nStartRPos + nParentLineHeight, bUseLayoutHeights ); OSL_ENSURE( aRows.Seek_Entry(&aRow), "Parent-Zeile nicht gefunden" ); @@ -511,7 +511,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } else { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt32 nCheckPos = nCPos + GetBoxWidth( pBox ); if( !nEndCPos ) { @@ -525,7 +525,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } #endif nCPos = nStartCPos + nParentLineWidth; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwWriteTableCol aCol( nStartCPos + nParentLineWidth ); OSL_ENSURE( aCols.Seek_Entry(&aCol), "Parent-Zelle nicht gefunden" ); @@ -591,13 +591,9 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, // Und ihren Index sal_uInt16 nOldRow = nRow; SwWriteTableRow aRow( nRPos,bUseLayoutHeights ); -#if OSL_DEBUG_LEVEL > 1 - sal_Bool bFound = -#endif - aRows.Seek_Entry( &aRow, &nRow ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( bFound, "Wo ist die Zeile geblieben?" ); -#endif + bool const bFound = aRows.Seek_Entry( &aRow, &nRow ); + OSL_ENSURE( bFound, "missing row" ); + (void) bFound; // unused in non-debug OSL_ENSURE( nOldRow <= nRow, "Don't look back!" ); if( nOldRow > nRow ) @@ -677,13 +673,9 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, // Und ihren Index sal_uInt16 nOldCol = nCol; SwWriteTableCol aCol( nCPos ); -#if OSL_DEBUG_LEVEL > 1 - sal_Bool bFound2 = -#endif - aCols.Seek_Entry( &aCol, &nCol ); -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( bFound2, "Wo ist die Spalte geblieben?" ); -#endif + bool const bFound2 = aCols.Seek_Entry( &aCol, &nCol ); + OSL_ENSURE( bFound2, "missing column" ); + (void) bFound2; // unused in non-debug if( !ShouldExpandSub( pBox, bSubExpanded, nDepth ) ) { diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index 357e45083b8f..0f047c42ef64 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -1727,15 +1727,10 @@ SfxItemSet* SwFltOutBase::NewFlyDefaults() sal_Bool SwFltOutBase::BeginFly( RndStdIds eAnchor /*= FLY_AT_PARA*/, sal_Bool bAbsolutePos /*= sal_False*/, - const SfxItemSet* -#if OSL_DEBUG_LEVEL > 1 - pMoreAttrs /*= 0*/ -#endif - ) + const SfxItemSet* pMoreAttrs /*= 0*/) { -#if OSL_DEBUG_LEVEL > 1 + (void) pMoreAttrs; // unused in non-debug OSL_ENSURE(!pMoreAttrs, "SwFltOutBase:BeginFly mit pMoreAttrs" ); -#endif eFlyAnchor = eAnchor; bFlyAbsPos = bAbsolutePos; // Bloedsinn eigentlich return sal_True; diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 373760dd850e..7699b2486b5b 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -69,7 +69,7 @@ #include #include #include -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 #include #endif @@ -1771,28 +1771,28 @@ void Ww1Picture::WriteBmp(SvStream& rOut) p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 x = SVBT16ToShort(p); (void) x; #endif p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 y = SVBT16ToShort(p); (void) y; #endif p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 planes = SVBT16ToShort(p); (void) planes; #endif p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt16 bitcount = SVBT16ToShort(p); (void) bitcount; #endif p+= sizeof(SVBT16); nSize -= sizeof(SVBT16); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 OSL_ENSURE(x==maxx, "Ww1Picture"); OSL_ENSURE(y==maxy, "Ww1Picture"); OSL_ENSURE(planes==1, "Ww1Picture"); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index e7bf299cc5e6..4dffb33868bd 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2015,7 +2015,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) if (bSwapInPage) (const_cast(pSdrObj))->SetPage(0); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( !this, "Where is the SDR-Object?" ); #endif diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c7c5fe5659f3..65dc01d350c0 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -766,7 +766,7 @@ sal_uLong SwWW8Writer::FillUntil( SvStream& rStrm, sal_uLong nEndPos ) if( nEndPos > nCurPos ) SwWW8Writer::FillCount( rStrm, nEndPos - nCurPos ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( nEndPos == nCurPos, "Falsches FillUntil()" ); #endif diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 550a925ea9ed..7db017b4390b 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -279,11 +279,10 @@ void sw::util::RedlineStack::close( const SwPosition& rPos, { if( pTabDesc && pTabDesc->getOldRedlineStack() ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pTabDesc->getOldRedlineStack()->close(rPos, eType), "close without open!"); -#else - pTabDesc->getOldRedlineStack()->close( rPos, eType ); -#endif + bool const bResult = + pTabDesc->getOldRedlineStack()->close(rPos, eType); + OSL_ENSURE( bResult, "close without open!"); + (void) bResult; // unused in non-debug } } } @@ -1483,7 +1482,7 @@ void WW8TabBandDesc::ProcessSpacing(const sal_uInt8* pParams) if (nLen != 6) return; mbHasSpacing=true; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt8 nWhichCell = *pParams; OSL_ENSURE(nWhichCell == 0, "Expected cell to be 0!"); #endif @@ -1537,10 +1536,9 @@ void WW8TabBandDesc::ProcessSpecificSpacing(const sal_uInt8* pParams) OSL_ENSURE(nOverrideSpacing[nWhichCell] < 0x10, "Unexpected value for nSideBits"); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt8 nUnknown2 = *pParams; OSL_ENSURE(nUnknown2 == 0x3, "Unexpected value for spacing2"); - #endif ++pParams; sal_uInt16 nValue = SVBT16ToShort( pParams ); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index bc47bc8b661b..4aba958eaa04 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -4657,16 +4657,10 @@ void SwWW8ImplReader::Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, sho } } -sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, - bool -#if OSL_DEBUG_LEVEL > 1 - bVer67 -#endif - ) -{ -#if OSL_DEBUG_LEVEL > 1 +sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67) +{ + (void) bVer67; // unused in non-debug OSL_ENSURE(bVer67 == false, "Impossible"); -#endif sal_uInt32 nFore = wwUtility::BGRToRGB(SVBT32ToUInt32(rpData)); rpData+=4; sal_uInt32 nBack = wwUtility::BGRToRGB(SVBT32ToUInt32(rpData)); @@ -6146,9 +6140,7 @@ short SwWW8ImplReader::ImportSprm(const sal_uInt8* pPos,sal_uInt16 nId) if (!nId) nId = mpSprmParser->GetSprmId(pPos); -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( nId != 0xff, "Sprm FF !!!!" ); -#endif const SprmReadInfo& rSprm = GetSprmReadInfo(nId); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index a379900a0298..593fc737eca2 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -228,7 +228,7 @@ sal_Int32 ReadThroughComponent( if( bEncrypted ) return ERRCODE_SFX_WRONGPASSWORD; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( "SAX parse exception caught while importing:\n")); aError.append(rtl::OUStringToOString(r.Message, @@ -264,7 +264,7 @@ sal_Int32 ReadThroughComponent( if( bEncrypted ) return ERRCODE_SFX_WRONGPASSWORD; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( "SAX exception caught while importing:\n")); aError.append(rtl::OUStringToOString(r.Message, @@ -277,7 +277,7 @@ sal_Int32 ReadThroughComponent( catch( packages::zip::ZipIOException& r) { (void)r; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( "Zip exception caught while importing:\n")); aError.append(rtl::OUStringToOString(r.Message, @@ -289,7 +289,7 @@ sal_Int32 ReadThroughComponent( catch( io::IOException& r) { (void)r; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( "IO exception caught while importing:\n")); aError.append(rtl::OUStringToOString(r.Message, @@ -301,7 +301,7 @@ sal_Int32 ReadThroughComponent( catch( uno::Exception& r) { (void)r; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( "uno exception caught while importing:\n")); aError.append(rtl::OUStringToOString(r.Message, diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index b7d016ecd51b..75d661152f56 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -83,7 +83,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) if( eFamily != XML_TOKEN_INVALID ) AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, eFamily ); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // style:parent-style-name="..." (if its not the default only) const SwFmt* pParent = rFmt.DerivedFrom(); // Parent-Namen nur uebernehmen, wenn kein Default diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 1552f6f75634..6537e71664c1 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -791,7 +791,7 @@ void SwXMLImport::endDocument( void ) pTxtNode->GetTxt().Len() ); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 // !!! This should be impossible !!!! OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPaM->GetBound( sal_True ).nNode.GetIndex(), diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index e3c0ea3dc2e5..a617db55d4f7 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -137,7 +137,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : pLines( &rLines ), nWidth( 0UL ) { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt32 nEndCPos = 0U; #endif sal_uInt16 nLines = rLines.Count(); @@ -171,7 +171,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : } else { -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 sal_uInt32 nCheckPos = nCPos + SwWriteTable::GetBoxWidth( pBox ); if( !nEndCPos ) @@ -180,7 +180,7 @@ SwXMLTableLines_Impl::SwXMLTableLines_Impl( const SwTableLines& rLines ) : } #endif nCPos = nWidth; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 SwXMLTableColumn_Impl aCol( nWidth ); OSL_ENSURE( aCols.Seek_Entry(&aCol), "couldn't find last column" ); OSL_ENSURE( SwXMLTableColumn_Impl(nCheckPos) == @@ -685,13 +685,9 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, // Und ihren Index sal_uInt16 nOldCol = nCol; SwXMLTableColumn_Impl aCol( nCPos ); -#if OSL_DEBUG_LEVEL > 1 - sal_Bool bFound = -#endif - pLines->GetColumns().Seek_Entry( &aCol, &nCol ); -#if OSL_DEBUG_LEVEL > 1 + bool const bFound = pLines->GetColumns().Seek_Entry( &aCol, &nCol ); OSL_ENSURE( bFound, "couldn't find column" ); -#endif + (void) bFound; // unused in non-debug const SwStartNode *pBoxSttNd = pBox->GetSttNd(); if( pBoxSttNd ) @@ -976,13 +972,10 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const sal_uInt16 nOldCol = nCol; { SwXMLTableColumn_Impl aCol( nCPos ); -#if OSL_DEBUG_LEVEL > 1 - const sal_Bool bFound = -#endif + const bool bFound = rLines.GetColumns().Seek_Entry( &aCol, &nCol ); -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( bFound, "couldn't find column" ); -#endif + (void) bFound; // unused in non-debug } // #i95726# - Some fault tolerance, if table is somehow corrupted. diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 5305e72138dd..5a413abb3133 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2299,7 +2299,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, bSplit = 1UL == pCell->GetColSpan(); } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 if( nCol == nRightCol-1UL ) { OSL_ENSURE( bSplit, "Split-Flag falsch" ); @@ -2880,9 +2880,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( const SwEndNode *pEndNd = pPrevSttNd ? pPrevSttNd->EndOfSectionNode() : pTableNode->EndOfSectionNode(); // #i78921# - make code robust -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pDoc, " - no at instance - doesn't seem to be registered at a instance." ); -#endif if ( !pDoc ) { pDoc = const_cast(pEndNd->GetDoc()); diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 0183d955ea18..0893ad498315 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -420,16 +420,10 @@ void SwMailMergeWizardExecutor::ExecuteWizard() LINK( this, SwMailMergeWizardExecutor, EndDialogHdl ) ); } -#if OSL_DEBUG_LEVEL > 1 IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, pDialog ) -#else -IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EMPTYARG ) -#endif { -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" ); (void) pDialog; -#endif long nRet = m_pWizard->GetResult(); sal_uInt16 nRestartPage = m_pWizard->GetRestartPage(); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 71827e6f860d..1c649e1ef7c1 100755 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -923,12 +923,10 @@ void SwDocShell::Execute(SfxRequest& rReq) break; } } -#if OSL_DEBUG_LEVEL > 1 - { - sal_Bool bWeb = 0 != dynamic_cast(this); - OSL_ENSURE(bWeb == sal_True, "SourceView only in WebDocShell"); - } -#endif + + OSL_ENSURE(dynamic_cast(this), + "SourceView only in WebDocShell"); + // the SourceView is not the 1 for SwWebDocShell sal_uInt16 nSlot = SID_VIEWSHELL1; sal_Bool bSetModified = sal_False; diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 350cf749c54b..d8a5fb254566 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -612,7 +612,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( !this, "it won't do without Sw3Reader" ); #endif diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index f829db963e21..bd58608a7855 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1178,11 +1178,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence& rSelection, } catch (const Exception& rExcept) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL(rtl::OUStringToOString(rExcept.Message, osl_getThreadTextEncoding()).getStr()); -#else (void)rExcept; -#endif } } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a01bc6ef7f90..a80ff4a3c27d 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -596,15 +596,10 @@ long AbstractMailMergeWizard_Impl::GetResult() return pDlg->GetResult(); } -#if OSL_DEBUG_LEVEL > 1 IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog ) -#else -IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG ) -#endif { -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" ); -#endif + (void) pDialog; // unused in non-debug aEndDlgHdl.Call( this ); aEndDlgHdl = Link(); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index d3b5e0aaabe0..d2f977baa3bc 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -4909,7 +4909,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_ENSURE( !this, "unknown speech command." ); #endif @@ -5177,7 +5177,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } } break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_ENSURE( !this, "unknown command." ); #endif diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index b4b7348d60f6..13e054610021 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -113,12 +113,11 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) aRowField.Enable(bEnable); aSynchronCB.Enable(!bEnable); + OSL_ENSURE(!bEnable || pButton == &aPageButton, "NewButton?" ); if ( bEnable ) + { aColField.GrabFocus(); -#if OSL_DEBUG_LEVEL > 1 - else - OSL_ENSURE( pButton == &aPageButton, "NewButton?" ); -#endif + } return 0; } diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index fee905ac8119..3b7a909c9469 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -299,7 +299,7 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) case FTNNUM_CHAPTER: sSelect = aNumChapter; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_FAIL("Which numbering type?"); #endif diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index 3421f3c58788..202ead362a41 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -148,7 +148,7 @@ sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType() sal_uInt16 nSelPos = GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nSelPos) nRet = (sal_Int16)(sal_uLong)GetEntryData(nSelPos); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_FAIL("SwNumberingTypeListBox not selected"); #endif diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 0235915e5a9d..38816bab6cea 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -1406,13 +1406,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) } else rSh.GetCurAttr( aSet ); -#if OSL_DEBUG_LEVEL > 1 const SvxShadowItem& rShItem = (const SvxShadowItem&)aSet.Get(nWhich); rSet.Put(rShItem); -#else - rSet.Put((const SvxShadowItem&)aSet.Get(nWhich)); -#endif } break; case SID_IMAP: diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index 8732d0dbe84b..0cb186535b2e 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -722,12 +722,8 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) { SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); rSh.GetCurAttr(aSet); -#if OSL_DEBUG_LEVEL > 1 const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT, sal_True); rSet.Put(rItem); -#else - rSet.Put(aSet.Get( RES_TXTATR_INETFMT, sal_True)); -#endif nSlot = 0; } break; diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 269e57c12b59..d453e0304274 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1730,7 +1730,7 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0 }; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { const sal_uInt16* pPtr = aInval + 1; do { diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 53e047cd462a..b55cc3f4f463 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3817,7 +3817,7 @@ Reference SwXDocumentPropertyHelper::GetDrawTable(short nWhich) xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc); xRet = xDrawDefaults; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_FAIL("which table?"); #endif } -- cgit v1.2.3