diff options
Diffstat (limited to 'sw/source/core/docnode')
-rw-r--r-- | sw/source/core/docnode/finalthreadmanager.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 27 | ||||
-rw-r--r-- | sw/source/core/docnode/ndindex.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/docnode/ndnotxt.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/docnode/ndnum.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 78 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl1.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/docnode/node2lay.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 26 | ||||
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/docnode/threadmanager.cxx | 4 |
14 files changed, 144 insertions, 153 deletions
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx index feb8d9b327..1517b00b08 100644 --- a/sw/source/core/docnode/finalthreadmanager.cxx +++ b/sw/source/core/docnode/finalthreadmanager.cxx @@ -241,14 +241,14 @@ void TerminateOfficeThread::PerformOfficeTermination() css::uno::UNO_QUERY ); if ( !xTasksSupplier.is() ) { - ASSERT( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XFramesSupplier!" ); + OSL_ENSURE( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XFramesSupplier!" ); return; } css::uno::Reference< css::container::XElementAccess > xList( xTasksSupplier->getFrames(), css::uno::UNO_QUERY ); if ( !xList.is() ) { - ASSERT( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XElementAccess!" ); + OSL_ENSURE( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XElementAccess!" ); return; } @@ -317,7 +317,7 @@ FinalThreadManager::~FinalThreadManager() if ( !maThreads.empty() ) { - ASSERT( false, "<FinalThreadManager::~FinalThreadManager()> - still registered jobs are existing -> perform cancellation" ); + OSL_ENSURE( false, "<FinalThreadManager::~FinalThreadManager()> - still registered jobs are existing -> perform cancellation" ); cancelAllJobs(); } @@ -325,7 +325,7 @@ FinalThreadManager::~FinalThreadManager() { if ( !mpCancelJobsThread->allJobsCancelled() ) { - ASSERT( false, "<FinalThreadManager::~FinalThreadManager()> - cancellation of registered jobs not yet finished -> wait for its finish" ); + OSL_ENSURE( false, "<FinalThreadManager::~FinalThreadManager()> - cancellation of registered jobs not yet finished -> wait for its finish" ); } mpCancelJobsThread->stopWhenAllJobsCancelled(); @@ -397,7 +397,7 @@ void SAL_CALL FinalThreadManager::cancelAllJobs() throw (css::uno::RuntimeExcept if ( !mpCancelJobsThread->create() ) { // error handling - // ASSERT( false, "<FinalThreadManager::cancelAllJobs()> - thread to cancel jobs can't be setup --> synchron cancellation of jobs" ); + // OSL_ENSURE( false, "<FinalThreadManager::cancelAllJobs()> - thread to cancel jobs can't be setup --> synchron cancellation of jobs" ); delete mpCancelJobsThread; mpCancelJobsThread = 0; while ( !aThreads.empty() ) @@ -450,7 +450,7 @@ void SAL_CALL FinalThreadManager::queryTermination( const css::lang::EventObject m_xContext ); if ( !mpTerminateOfficeThread->create() ) { - // ASSERT( false, "FinalThreadManager::queryTermination(..) - thread to terminate office can't be started!" ); + // OSL_ENSURE( false, "FinalThreadManager::queryTermination(..) - thread to terminate office can't be started!" ); delete mpTerminateOfficeThread; mpTerminateOfficeThread = 0; } @@ -480,7 +480,7 @@ void SAL_CALL FinalThreadManager::notifyTermination( const css::lang::EventObjec { if ( mpTerminateOfficeThread->isRunning() ) { - // ASSERT( false, "<FinalThreadManager::notifyTermination()> - office termination thread still running!" ); + // OSL_ENSURE( false, "<FinalThreadManager::notifyTermination()> - office termination thread still running!" ); mpTerminateOfficeThread->StopOfficeTermination(); // thread kills itself. } else @@ -492,7 +492,7 @@ void SAL_CALL FinalThreadManager::notifyTermination( const css::lang::EventObjec if ( !maThreads.empty() ) { - // ASSERT( false, "<FinalThreadManager::notifyTermination()> - still registered jobs are existing" ); + // OSL_ENSURE( false, "<FinalThreadManager::notifyTermination()> - still registered jobs are existing" ); cancelAllJobs(); } @@ -500,7 +500,7 @@ void SAL_CALL FinalThreadManager::notifyTermination( const css::lang::EventObjec { if ( !mpCancelJobsThread->allJobsCancelled() ) { - // ASSERT( false, "<FinalThreadManager::notifyTermination()> - cancellation of registered jobs not yet finished -> wait for its finish" ); + // OSL_ENSURE( false, "<FinalThreadManager::notifyTermination()> - cancellation of registered jobs not yet finished -> wait for its finish" ); } mpCancelJobsThread->stopWhenAllJobsCancelled(); diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 78d9d22b64..8427d30a58 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -57,15 +57,12 @@ #include <pagedesc.hxx> #include <poolfmt.hxx> #include <SwNodeNum.hxx> -#ifndef DBG_UTIL -#define CHECK_TABLE(t) -#else -#ifdef DEBUG + +#if OSL_DEBUG_LEVEL > 1 #define CHECK_TABLE(t) (t).CheckConsistency(); #else #define CHECK_TABLE(t) #endif -#endif namespace { @@ -364,7 +361,7 @@ BOOL lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara ) { SwNodeIndex aNewIdx( *pCT->pTblNd, rpBox->GetSttIdx() - pCT->nOldTblSttIdx ); - ASSERT( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" ); + OSL_ENSURE( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" ); pNewBox = new SwTableBox( pBoxFmt, aNewIdx, pCT->pInsLine ); pNewBox->setRowSpan( rpBox->getRowSpan() ); } @@ -472,7 +469,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const pDoc->InsDeletedFldType( *pDDEType ); else pDDEType = (SwDDEFieldType*)pDoc->InsertFldType( *pDDEType ); - ASSERT( pDDEType, "unbekannter FieldType" ); + OSL_ENSURE( pDDEType, "unbekannter FieldType" ); // tauschen am Node den Tabellen-Pointer aus SwDDETable* pNewTable = new SwDDETable( pTblNd->GetTable(), pDDEType ); @@ -733,8 +730,8 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const } else { - ASSERT( this == pDoc, " falscher Copy-Zweig!" ); - ASSERT(false, "mst: i thought this could be dead code;" + OSL_ENSURE( this == pDoc, " falscher Copy-Zweig!" ); + OSL_ENSURE(false, "mst: i thought this could be dead code;" "please tell me what you did to get here!"); pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE)); @@ -1331,7 +1328,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte aRedlRest.Restore(); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 { //JP 17.06.99: Bug 66973 - check count only if the selection is in // the same (or no) section. Becaus not full selected @@ -1343,9 +1340,9 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte !rRg.aStart.GetNode().IsSectionNode() && !aTmpI.GetNode().IsEndNode() ) { - ASSERT( rInsPos.GetIndex() - aSavePos.GetIndex() == + OSL_ENSURE( rInsPos.GetIndex() - aSavePos.GetIndex() == rRg.aEnd.GetIndex() - rRg.aStart.GetIndex(), - "Es wurden zu wenig Nodes kopiert!" ) + "Es wurden zu wenig Nodes kopiert!" ); } } #endif @@ -1508,7 +1505,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, { // This case can *not* happen, but to be robust take the first // text node in the destination document. - ASSERT( false, + OSL_ENSURE( false, "<SwDoc::_CopyFlyInFly(..)> - anchor text node in copied range not found" ); nAnchorTxtNdNumInRange = 1; } @@ -1534,7 +1531,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, { // This case can *not* happen, but to be robust take the first // text node in the destination document. - ASSERT( false, + OSL_ENSURE( false, "<SwDoc::_CopyFlyInFly(..)> - found anchor node index isn't a text node" ); aAnchorNdIdx = rStartIdx; while ( !aAnchorNdIdx.GetNode().IsTxtNode() ) @@ -1590,7 +1587,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, //Alle chains, die im Original vorhanden sind, soweit wie moeglich wieder //aufbauen. - ASSERT( aArr.Count() == aNewArr.Count(), "Missing new Flys" ); + OSL_ENSURE( aArr.Count() == aNewArr.Count(), "Missing new Flys" ); if ( aArr.Count() == aNewArr.Count() ) { for ( USHORT n = 0; n < aArr.Count(); ++n ) diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx index 94105fc7e7..3b5e5ecef6 100644 --- a/sw/source/core/docnode/ndindex.cxx +++ b/sw/source/core/docnode/ndindex.cxx @@ -35,7 +35,7 @@ #include "error.h" // fuers ASSERT #include "ndindex.hxx" -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 int SwNodeIndex::nSerial = 0; #endif @@ -69,7 +69,7 @@ SwNodeIndex::SwNodeIndex( SwNodes& rNds, ULONG nIdx ) { rNds.RegisterIndex( *this ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } @@ -84,7 +84,7 @@ SwNodeIndex::SwNodeIndex( const SwNodeIndex& rIdx, long nDiff ) pNd = rIdx.pNd; pNd->GetNodes().RegisterIndex( *this ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } @@ -99,7 +99,7 @@ SwNodeIndex::SwNodeIndex( const SwNode& rNd, long nDiff ) pNd = (SwNode*)&rNd; pNd->GetNodes().RegisterIndex( *this ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 MySerial = ++nSerial; // nur in der nicht PRODUCT-Version #endif } diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index d4f0661051..001394d43c 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -76,7 +76,7 @@ SwNoTxtNode::~SwNoTxtNode() // fuer Frame- und Grafik-Attributen void SwNoTxtNode::NewAttrSet( SwAttrPool& rPool ) { - ASSERT( !mpAttrSet.get(), "AttrSet ist doch gesetzt" ); + OSL_ENSURE( !mpAttrSet.get(), "AttrSet ist doch gesetzt" ); SwAttrSet aNewAttrSet( rPool, aNoTxtNodeSetRange ); // put names of parent style and conditional style: @@ -121,7 +121,7 @@ void SwNoTxtNode::SetContour( const PolyPolygon *pPoly, BOOL bAutomatic ) void SwNoTxtNode::CreateContour() { - ASSERT( !pContour, "Contour available." ); + OSL_ENSURE( !pContour, "Contour available." ); pContour = new PolyPolygon(SvxContourDlg::CreateAutoContour(GetGraphic())); bAutomaticContour = TRUE; bContourMapModeValid = TRUE; @@ -137,7 +137,7 @@ const PolyPolygon *SwNoTxtNode::HasContour() const const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM ); if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap ) { - ASSERT( !bPixelGrf || aGrfMap == aContourMap, + OSL_ENSURE( !bPixelGrf || aGrfMap == aContourMap, "scale factor for pixel unsupported" ); OutputDevice* pOutDev = (bPixelGrf || bPixelContour) ? Application::GetDefaultDevice() @@ -171,7 +171,7 @@ const PolyPolygon *SwNoTxtNode::HasContour() const void SwNoTxtNode::GetContour( PolyPolygon &rPoly ) const { - ASSERT( pContour, "Contour not available." ); + OSL_ENSURE( pContour, "Contour not available." ); rPoly = *HasContour(); } @@ -195,7 +195,7 @@ BOOL SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const { const MapMode aGrfMap( GetGraphic().GetPrefMapMode() ); const MapMode aContourMap( MAP_100TH_MM ); - ASSERT( aGrfMap.GetMapUnit() != MAP_PIXEL || + OSL_ENSURE( aGrfMap.GetMapUnit() != MAP_PIXEL || aGrfMap == MapMode( MAP_PIXEL ), "scale factor for pixel unsupported" ); if( aGrfMap.GetMapUnit() != MAP_PIXEL && @@ -246,7 +246,7 @@ Graphic SwNoTxtNode::GetGraphic() const } else { - ASSERT( GetOLENode(), "new type of Node?" ); + OSL_ENSURE( GetOLENode(), "new type of Node?" ); aRet = *((SwOLENode*)this)->SwOLENode::GetGraphic(); } return aRet; @@ -257,7 +257,7 @@ void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast ) { // Title attribute of <SdrObject> replaces own AlternateText attribute SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); - ASSERT( pFlyFmt, + OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" ); if ( !pFlyFmt ) { @@ -270,7 +270,7 @@ void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast ) const String SwNoTxtNode::GetTitle() const { const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); - ASSERT( pFlyFmt, + OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" ); if ( !pFlyFmt ) { @@ -283,7 +283,7 @@ const String SwNoTxtNode::GetTitle() const void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast ) { SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); - ASSERT( pFlyFmt, + OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" ); if ( !pFlyFmt ) { @@ -296,7 +296,7 @@ void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast ) const String SwNoTxtNode::GetDescription() const { const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); - ASSERT( pFlyFmt, + OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" ); if ( !pFlyFmt ) { diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index ade8161b8a..cde6cbc5f5 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -48,13 +48,13 @@ BOOL SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, USHORT* pFndPos ) const //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. -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 { for( USHORT n = 1; n < nO; ++n ) if( &(*this)[ n-1 ]->GetNodes() != &(*this)[ n ]->GetNodes() ) { - ASSERT( !this, "Node im falschen Outline-Array" ); + OSL_ENSURE( !this, "Node im falschen Outline-Array" ); } } #endif @@ -106,7 +106,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd) } else { - ASSERT( false, + OSL_ENSURE( false, "<SwNodes::UpdateOutlineNode(..)> - given text node isn't in the correct nodes array. This is a serious defect -> inform OD" ); } // <-- @@ -136,7 +136,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd) // if( 0 == nOldLevel ) //<-end, zhaojianwei // { // // nicht vorhanden, also einfuegen -// //ASSERT( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" ); +// / OSL_ENSURE( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" ); // // //JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen // ULONG nNd = rNd.GetIndex(); @@ -155,7 +155,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd) // } // else // { -// ASSERT( false, +// OSL_ENSURE( false, // "<SwNodes::UpdateOutlineNode(..)> - node <pSrch> isn't in correct nodes array. This is a serious defect -> inform OD" ); // } // // <-- diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index b648ff33f6..4ce74c6b85 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -93,7 +93,7 @@ bool lcl_IsInSameTblBox( SwNodes& _rNds, ? !_rNds.GoPrevSection( &aChkIdx, FALSE, FALSE ) : !_rNds.GoNextSection( &aChkIdx, FALSE, FALSE ) ) { - ASSERT( false, "<lcl_IsInSameTblBox(..)> - no previous/next!" ); + OSL_ENSURE( false, "<lcl_IsInSameTblBox(..)> - no previous/next!" ); return false; } else @@ -166,7 +166,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if( rRange.HasMark() && 0 == ( nRegionRet = IsInsRegionAvailable( rRange, &pPrvNd ) )) { - ASSERT( !this, "Selection ueber verschiedene Sections" ); + OSL_ENSURE( !this, "Selection ueber verschiedene Sections" ); return 0; } @@ -212,7 +212,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, *pEndPos = (SwPosition*)rRange.End(); if( pPrvNd && 3 == nRegionRet ) { - ASSERT( pPrvNd, "der SectionNode fehlt" ); + OSL_ENSURE( pPrvNd, "der SectionNode fehlt" ); SwNodeIndex aStt( pSttPos->nNode ), aEnd( pEndPos->nNode, +1 ); while( pPrvNd != aStt.GetNode().StartOfSectionNode() ) aStt--; @@ -833,7 +833,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, if( !pEnde ) // kein Bereich also neue Section davor/hinter anlegen { // #i26762# - ASSERT(!pEnde || rNdIdx <= *pEnde, + OSL_ENSURE(!pEnde || rNdIdx <= *pEnde, "Section start and end in wrong order!"); if( bInsAtStart ) @@ -1056,7 +1056,7 @@ SwFrm* SwClearDummies( SwFrm* pFrm ) SwFrm* pTmp = pFrm; while( pTmp ) { - ASSERT( !pTmp->GetUpper(), "SwClearDummies: No Upper allowed!" ); + OSL_ENSURE( !pTmp->GetUpper(), "SwClearDummies: No Upper allowed!" ); if( pTmp->IsSctFrm() ) { SwSectionFrm* pSectFrm = (SwSectionFrm*)pFrm; @@ -1150,7 +1150,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) SwFrm *pFrm, *pNew; while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { - ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." ); + OSL_ENSURE( pFrm->IsSctFrm(), "Depend von Section keine Section." ); pNew = rIdx.GetNode().GetCntntNode()->MakeFrm(); SwSectionNode* pS = rIdx.GetNode().FindSectionNode(); @@ -1180,7 +1180,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) SwLayoutFrm* pUp = pSct; while( pUp->Lower() ) // for columned sections { - ASSERT( pUp->Lower()->IsLayoutFrm(),"Who's in there?" ); + OSL_ENSURE( pUp->Lower()->IsLayoutFrm(),"Who's in there?" ); pUp = (SwLayoutFrm*)pUp->Lower(); } pNew->Paste( pUp, NULL ); @@ -1240,7 +1240,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) void SwSectionNode::MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx ) { - ASSERT( pIdxBehind, "kein Index" ); + OSL_ENSURE( pIdxBehind, "kein Index" ); SwNodes& rNds = GetNodes(); SwDoc* pDoc = rNds.GetDoc(); @@ -1310,7 +1310,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c ::std::auto_ptr<SwTOXBase> pTOXBase; if (TOX_CONTENT_SECTION == GetSection().GetType()) { - ASSERT( GetSection().ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); + OSL_ENSURE( GetSection().ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); SwTOXBaseSection const& rTBS( dynamic_cast<SwTOXBaseSection const&>(GetSection())); pTOXBase.reset( new SwTOXBase(rTBS, pDoc) ); @@ -1378,7 +1378,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c BOOL SwSectionNode::IsCntntHidden() const { - ASSERT( !m_pSection->IsHidden(), + OSL_ENSURE( !m_pSection->IsHidden(), "That's simple: Hidden Section => Hidden Content" ); SwNodeIndex aTmp( *this, 1 ); ULONG nEnd = EndOfSectionIndex(); @@ -1395,7 +1395,7 @@ BOOL SwSectionNode::IsCntntHidden() const { if( aTmp.GetNode().IsCntntNode() || aTmp.GetNode().IsTableNode() ) return FALSE; // Nicht versteckter Inhalt wurde gefunden - ASSERT( aTmp.GetNode().IsEndNode(), "EndNode expected" ); + OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" ); } aTmp++; } @@ -1439,7 +1439,7 @@ void SwSectionNode::NodesArrChgd() // verschieben vom Nodes- ins UndoNodes-Array? if( rNds.IsDocNodes() ) { - ASSERT( pDoc == GetDoc(), + OSL_ENSURE( pDoc == GetDoc(), "verschieben in unterschiedliche Documente?" ); if (m_pSection->IsLinkType()) { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 53e8f1cc31..6d5912419e 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -100,17 +100,11 @@ // <-- #include <fldupde.hxx> - -#ifndef DBG_UTIL -#define CHECK_TABLE(t) -#else -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 #define CHECK_TABLE(t) (t).CheckConsistency(); #else #define CHECK_TABLE(t) #endif -#endif - using namespace ::com::sun::star; @@ -278,7 +272,7 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd, { if( !nCnt ) return FALSE; - ASSERT( pLine, "keine gueltige Zeile" ); + OSL_ENSURE( pLine, "keine gueltige Zeile" ); // Index hinter die letzte Box der Line ULONG nIdxPos = 0; @@ -373,8 +367,8 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, BOOL bCalledFromShell, BOOL bNewModel ) { - ASSERT( nRows, "Tabelle ohne Zeile?" ); - ASSERT( nCols, "Tabelle ohne Spalten?" ); + OSL_ENSURE( nRows, "Tabelle ohne Zeile?" ); + OSL_ENSURE( nCols, "Tabelle ohne Spalten?" ); { // nicht in Fussnoten kopieren !! @@ -732,7 +726,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() ) { - ASSERT( FALSE, "Kein Bereich" ); + OSL_ENSURE( FALSE, "Kein Bereich" ); aRg.aEnd++; } @@ -773,7 +767,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, GetTxtCollFromPool( RES_POOLCOLL_STANDARD ), pUndo ); SwTable * pNdTbl = &pTblNd->GetTable(); - ASSERT( pNdTbl, "kein Tabellen-Node angelegt." ) + OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." ); const USHORT nRowsToRepeat = tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? @@ -950,7 +944,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, aSttIdx += 2, nLines++, nBoxes = 0 ) { SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode(); - ASSERT( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" ); + OSL_ENSURE( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" ); if( !nLines && 0x0b == cCh ) { @@ -1111,7 +1105,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, // damit die Tabelle die richtige Groesse bekommt, im BoxFormat die // Groesse nach "oben" transportieren. - ASSERT( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" ); + OSL_ENSURE( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" ); pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos )); } else @@ -1186,7 +1180,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() ) { - ASSERT( FALSE, "Kein Bereich" ); + OSL_ENSURE( FALSE, "Kein Bereich" ); aRg.aEnd++; } @@ -1227,7 +1221,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > GetTxtCollFromPool( RES_POOLCOLL_STANDARD )/*, pUndo*/ ); SwTable * pNdTbl = &pTblNd->GetTable(); - ASSERT( pNdTbl, "kein Tabellen-Node angelegt." ) + OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." ); pTableFmt->Add( pNdTbl ); // das Frame-Format setzen // const USHORT nRowsToRepeat = @@ -1425,7 +1419,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, ++aRowIter, /*aSttIdx += 2, */nLines++, nBoxes = 0 ) { // SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode(); -// ASSERT( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" ); +// OSL_ENSURE( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" ); pLine = new SwTableLine( pLineFmt, 1, 0 ); pTable->GetTabLines().C40_INSERT( SwTableLine, pLine, nLines ); @@ -1496,7 +1490,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, // damit die Tabelle die richtige Groesse bekommt, im BoxFormat die // Groesse nach "oben" transportieren. - ASSERT( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" ); + OSL_ENSURE( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" ); pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos )); } else @@ -1579,7 +1573,7 @@ BOOL lcl_DelBox( const SwTableBox*&, void *pPara ); BOOL lcl_DelLine( const SwTableLine*& rpLine, void* pPara ) { - ASSERT( pPara, "die Parameter fehlen" ); + OSL_ENSURE( pPara, "die Parameter fehlen" ); _DelTabPara aPara( *(_DelTabPara*)pPara ); ((SwTableLine*&)rpLine)->GetTabBoxes().ForEach( &lcl_DelBox, &aPara ); if( rpLine->GetUpper() ) // gibt es noch eine uebergeordnete Box ?? @@ -1591,7 +1585,7 @@ BOOL lcl_DelLine( const SwTableLine*& rpLine, void* pPara ) BOOL lcl_DelBox( const SwTableBox*& rpBox, void* pPara ) { - ASSERT( pPara, "die Parameter fehlen" ); + OSL_ENSURE( pPara, "die Parameter fehlen" ); // loesche erstmal die Lines der Box _DelTabPara* pDelPara = (_DelTabPara*)pPara; @@ -1787,7 +1781,7 @@ BOOL SwDoc::InsertCol( const SwCursor& rCursor, USHORT nCnt, BOOL bBehind ) BOOL SwDoc::InsertCol( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind ) { // uebers SwDoc fuer Undo !! - ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -1852,7 +1846,7 @@ BOOL SwDoc::InsertRow( const SwCursor& rCursor, USHORT nCnt, BOOL bBehind ) BOOL SwDoc::InsertRow( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind ) { // uebers SwDoc fuer Undo !! - ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -2043,7 +2037,7 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) return FALSE; // uebers SwDoc fuer Undo !! - ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -2258,7 +2252,7 @@ BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt, sal_Bool bSameHeight ) { // uebers SwDoc fuer Undo !! - ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -2472,7 +2466,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) SwFrm *pFrm, *pNew; SwCntntNode * pNode = rIdx.GetNode().GetCntntNode(); - ASSERT( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch."); + OSL_ENSURE( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch."); BOOL bBefore = rIdx < GetIndex(); @@ -2496,7 +2490,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) { - ASSERT( pIdxBehind, "kein Index" ); + OSL_ENSURE( pIdxBehind, "kein Index" ); *pIdxBehind = *this; SwNode *pNd = GetNodes().FindPrvNxtFrmNode( *pIdxBehind, EndOfSectionNode() ); if( !pNd ) @@ -2621,7 +2615,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, } else if( !pCrsr && !pBoxFrm ) { - ASSERT( !this, "einer von beiden muss angegeben werden!" ); + OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" ); return ; } @@ -2675,7 +2669,7 @@ bool lcl_IsFrmInColumn( const SwCellFrm& rFrm, SwSelBoxes& rBoxes ) void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , const SwCellFrm* pBoxFrm ) const { - ASSERT( pBoxFrm, "GetTabRows called without pBoxFrm" ) + OSL_ENSURE( pBoxFrm, "GetTabRows called without pBoxFrm" ); // --> FME 2005-09-12 #121591# Make code robust: if ( !pBoxFrm ) @@ -2700,14 +2694,14 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , // --> FME 2005-09-12 #121591# Make code robust: if ( aDelCheck.HasBeenDeleted() ) { - ASSERT( false, "Current box has been deleted during GetTabRows()" ) + OSL_ENSURE( false, "Current box has been deleted during GetTabRows()" ); return; } // <-- // --> FME 2005-09-12 #121591# Make code robust: const SwTabFrm* pTab = pBoxFrm->FindTabFrm(); - ASSERT( pTab, "GetTabRows called without a table" ) + OSL_ENSURE( pTab, "GetTabRows called without a table" ); if ( !pTab ) return; // <-- @@ -2804,7 +2798,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , } // delete first and last entry - ASSERT( rFill.Count(), "Deleting from empty vector. Fasten your seatbelts!" ) + OSL_ENSURE( rFill.Count(), "Deleting from empty vector. Fasten your seatbelts!" ); // --> FME 2006-01-19 #i60818# There may be only one entry in rFill. Make // code robust by checking count of rFill. if ( rFill.Count() ) rFill.Remove( 0, 1 ); @@ -2846,7 +2840,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly, } else if( !pCrsr && !pBoxFrm ) { - ASSERT( !this, "einer von beiden muss angegeben werden!" ); + OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" ); return ; } @@ -2895,7 +2889,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor* const SwTableBox* pBox; SwTabFrm *pTab; - ASSERT( pBoxFrm, "SetTabRows called without pBoxFrm" ) + OSL_ENSURE( pBoxFrm, "SetTabRows called without pBoxFrm" ); pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); @@ -2932,7 +2926,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor* // check for differences between aOld and rNew: const USHORT nCount = rNew.Count(); const SwTable* pTable = pTab->GetTable(); - ASSERT( pTable, "My colleague told me, this couldn't happen" ); + OSL_ENSURE( pTable, "My colleague told me, this couldn't happen" ); for ( USHORT i = 0; i <= nCount; ++i ) { @@ -3507,7 +3501,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter, SwTableNode * pNewTblNd; { SwEndNode* pOldTblEndNd = (SwEndNode*)pTNd->EndOfSectionNode()->GetEndNode(); - ASSERT( pOldTblEndNd, "wo ist der EndNode?" ) + OSL_ENSURE( pOldTblEndNd, "wo ist der EndNode?" ); SwNodeIndex aIdx( *pBox->GetSttNd() ); new SwEndNode( aIdx, *pTNd ); @@ -3519,7 +3513,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter, SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { - ASSERT( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); + OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); pBoxNd->pStartOfSection = pNewTblNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; } while( pBoxNd != pOldTblEndNd ); @@ -3647,10 +3641,10 @@ BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev, USHORT nMode, SwHistory* ) { SwTableNode* pDelTblNd = rPos.GetNode().GetTableNode(); - ASSERT( pDelTblNd, "wo ist der TableNode geblieben?" ); + OSL_ENSURE( pDelTblNd, "wo ist der TableNode geblieben?" ); SwTableNode* pTblNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode(); - ASSERT( pTblNd, "wo ist der TableNode geblieben?" ); + OSL_ENSURE( pTblNd, "wo ist der TableNode geblieben?" ); if( !pDelTblNd || !pTblNd ) return FALSE; @@ -3721,7 +3715,7 @@ BOOL SwNodes::MergeTable( const SwNodeIndex& rPos, BOOL bWithPrev, SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { - ASSERT( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); + OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); pBoxNd->pStartOfSection = pTblNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; } while( pBoxNd != pTblEndNd ); @@ -3844,7 +3838,7 @@ BOOL lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara ) // AutoFormat fuer die Tabelle/TabellenSelection BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew ) { - ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -3919,7 +3913,7 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe // Erfrage wie attributiert ist BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) { - ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" ); + OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return FALSE; @@ -4463,7 +4457,7 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, { SwTableBox* pBox = pInsTblNd->GetTable().GetTblBox( pSttNd->GetIndex() ); - ASSERT( pBox, "Box steht nicht in dieser Tabelle" ); + OSL_ENSURE( pBox, "Box steht nicht in dieser Tabelle" ); aBoxes.Insert( pBox ); pBoxes = &aBoxes; } diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index d801c05a1e..35d0cd1332 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -111,7 +111,7 @@ void SwTblFmtCmp::Delete( SvPtrarr &rArr ) void lcl_GetStartEndCell( const SwCursor& rCrsr, SwLayoutFrm *&prStart, SwLayoutFrm *&prEnd ) { - ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( FALSE ), + OSL_ENSURE( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( FALSE ), "Tabselection nicht auf Cnt." ); Point aPtPos, aMkPos; @@ -573,7 +573,7 @@ void lcl_CollectCells( SvPtrarr &rArr, const SwRect &rUnion, // uns erst wieder zur Zelle hochhangeln while ( !pCell->IsCellFrm() ) pCell = pCell->GetUpper(); - ASSERT( pCell, "Frame ist keine Zelle." ); + OSL_ENSURE( pCell, "Frame ist keine Zelle." ); if ( rUnion.IsOver( pCell->Frm() ) ) ::InsertCell( rArr, (SwCellFrm*)pCell ); //Dafuer sorgen, dass die Zelle auch verlassen wird (Bereiche) @@ -1234,7 +1234,7 @@ BOOL SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const #***********************************************************************/ void SwDoc::SetBoxAlign( const SwCursor& rCursor, USHORT nAlign ) { - ASSERT( nAlign == text::VertOrientation::NONE || + OSL_ENSURE( nAlign == text::VertOrientation::NONE || nAlign == text::VertOrientation::CENTER || nAlign == text::VertOrientation::BOTTOM, "wrong alignment" ); SwFmtVertOrient aVertOri( 0, nAlign ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 7b3576ea58..37d6e58108 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -116,8 +116,8 @@ void SetParent( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwFmt* pConditionalFmt ) { const SwAttrSet* pAttrSet = static_cast<const SwAttrSet*>(mrpAttrSet.get()); - ASSERT( pAttrSet, "no SwAttrSet" ) - ASSERT( pParentFmt || !pConditionalFmt, "ConditionalFmt without ParentFmt?" ) + OSL_ENSURE( pAttrSet, "no SwAttrSet" ); + OSL_ENSURE( pParentFmt || !pConditionalFmt, "ConditionalFmt without ParentFmt?" ); const SwAttrSet* pParentSet = pParentFmt ? &pParentFmt->GetAttrSet() : 0; @@ -337,7 +337,7 @@ USHORT SwNode::GetSectionLevel() const |* *******************************************************************/ -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 long SwNode::nSerial = 0; #endif @@ -369,7 +369,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType ) pStartOfSection = (SwStartNode*)this; } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 nMySerial = nSerial; nSerial++; #endif @@ -402,7 +402,7 @@ SwNode::SwNode( SwNodes& rNodes, ULONG nPos, const BYTE nNdType ) pStartOfSection = (SwStartNode*)this; } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 nMySerial = nSerial; nSerial++; #endif @@ -641,7 +641,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, } if( n >= rFmts.Count() ) { - ASSERT( !this, "Fly-Section aber kein Format gefunden" ); + OSL_ENSURE( !this, "Fly-Section aber kein Format gefunden" ); return FALSE; } } @@ -727,7 +727,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, // kann jetzt nur noch ein Seitengebundener Fly sein // oder irgendetwas neueres. // Hier koennen wir nur noch den Standard returnen - ASSERT( pNd->FindFlyStartNode(), + OSL_ENSURE( pNd->FindFlyStartNode(), "wo befindet sich dieser Node?" ); pPgDesc = &pDoc->GetPageDesc( 0 ); @@ -1195,7 +1195,7 @@ xub_StrLen SwCntntNode::Len() const { return 0; } SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) { - ASSERT( pNewColl, "Collectionpointer ist 0." ); + OSL_ENSURE( pNewColl, "Collectionpointer ist 0." ); SwFmtColl *pOldColl = GetFmtColl(); if( pNewColl != pOldColl ) @@ -1339,7 +1339,7 @@ BOOL SwCntntNode::GoPrevious(SwIndex * pIdx, USHORT nMode ) const void SwCntntNode::MakeFrms( SwCntntNode& rNode ) { - ASSERT( &rNode != this, + OSL_ENSURE( &rNode != this, "Kein Contentnode oder Copy-Node und neuer Node identisch." ); if( !GetDepends() || &rNode == this ) // gibt es ueberhaupt Frames ?? @@ -1348,7 +1348,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) SwFrm *pFrm, *pNew; SwLayoutFrm *pUpper; // Frames anlegen fuer Nodes, die vor oder hinter der Tabelle stehen ?? - ASSERT( FindTableNode() == rNode.FindTableNode(), "Table confusion" ) + OSL_ENSURE( FindTableNode() == rNode.FindTableNode(), "Table confusion" ); SwNode2Layout aNode2Layout( *this, rNode.GetIndex() ); @@ -1430,12 +1430,12 @@ void SwCntntNode::DelFrms() !pFrm->GetIndPrev() ) { SwFtnFrm *pFtn = pFrm->FindFtnFrm(); - ASSERT( pFtn, "You promised a FtnFrm?" ); + OSL_ENSURE( pFtn, "You promised a FtnFrm?" ); SwCntntFrm* pCFrm; if( !pFtn->GetFollow() && !pFtn->GetMaster() && 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) { - ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); + OSL_ENSURE( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); } } @@ -1527,7 +1527,7 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen - ASSERT( GetpSwAttrSet(), "warum wurde kein AttrSet angelegt?" ); + OSL_ENSURE( GetpSwAttrSet(), "warum wurde kein AttrSet angelegt?" ); if ( IsInCache() ) { @@ -1568,7 +1568,7 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) const SfxPoolItem* pFnd = 0; if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, FALSE, &pFnd ) ) { - ASSERT( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" ); + OSL_ENSURE( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" ); const SwFmtAutoFmt* pTmp = static_cast<const SwFmtAutoFmt*>(pFnd); // If there already is an attribute set (usually containing a numbering @@ -1784,7 +1784,7 @@ USHORT SwCntntNode::ClearItemsFromAttrSet( const std::vector<USHORT>& rWhichIds if ( 0 == rWhichIds.size() ) return nRet; - ASSERT( GetpSwAttrSet(), "no item set" ) + OSL_ENSURE( GetpSwAttrSet(), "no item set" ); SwAttrSet aNewAttrSet( *GetpSwAttrSet() ); for ( std::vector<USHORT>::const_iterator aIter = rWhichIds.begin(); aIter != rWhichIds.end(); diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 89cde23623..3ff7287a3a 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -115,7 +115,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch ) pMod = (SwModify*)pNd->GetCntntNode(); else { - ASSERT( pNd->IsTableNode(), "For Tablenodes only" ); + OSL_ENSURE( pNd->IsTableNode(), "For Tablenodes only" ); pMod = pNd->GetTableNode()->GetTable().GetFrmFmt(); } pIter = new SwClientIter( *pMod ); @@ -150,7 +150,7 @@ SwFrm* SwNode2LayImpl::NextFrm() while( pRet ) { SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet ); - ASSERT( pFlow, "Cntnt or Table expected?!" ); + OSL_ENSURE( pFlow, "Cntnt or Table expected?!" ); // Follows sind fluechtige Gestalten, deshalb werden sie ignoriert. // Auch wenn wir hinter dem Frame eingefuegt werden sollen, nehmen wir // zunaechst den Master, hangeln uns dann aber zum letzten Follow durch. @@ -172,9 +172,9 @@ SwFrm* SwNode2LayImpl::NextFrm() // und nicht ausserhalb liegt. if( !pRet->IsInFtn() || pSct->IsInFtn() ) { - ASSERT( pSct && pSct->GetSection(), "Where's my section?" ); + OSL_ENSURE( pSct && pSct->GetSection(), "Where's my section?" ); SwSectionNode* pNd = pSct->GetSection()->GetFmt()->GetSectionNode(); - ASSERT( pNd, "Lost SectionNode" ); + OSL_ENSURE( pNd, "Lost SectionNode" ); // Wenn der erhaltene Frame in einem Bereichsframe steht, // dessen Bereich den Ausgangsnode nicht umfasst, so kehren // wir mit dem SectionFrm zurueck, sonst mit dem Cntnt/TabFrm @@ -247,11 +247,11 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode ) { pFrm = static_cast<SwLayoutFrm*>(pFrm)->Lower(); } - ASSERT( pFrm->IsLayoutFrm(), + OSL_ENSURE( pFrm->IsLayoutFrm(), "<SwNode2LayImpl::UpperFrm(..)> - expected upper frame isn't a layout frame." ); rpFrm = bMaster ? NULL : static_cast<SwLayoutFrm*>(pFrm)->Lower(); - ASSERT( !rpFrm || rpFrm->IsFlowFrm(), + OSL_ENSURE( !rpFrm || rpFrm->IsFlowFrm(), "<SwNode2LayImpl::UpperFrm(..)> - expected sibling isn't a flow frame." ); return static_cast<SwLayoutFrm*>(pFrm); } @@ -280,7 +280,7 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode ) void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) { - ASSERT( pUpperFrms, "RestoreUpper without SaveUpper?" ) + OSL_ENSURE( pUpperFrms, "RestoreUpper without SaveUpper?" ); SwNode* pNd; SwDoc *pDoc = rNds.GetDoc(); BOOL bFirst = TRUE; @@ -316,7 +316,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) else pNxt = pUp->Lower(); pNew = ((SwTableNode*)pNd)->MakeFrm(); - ASSERT( pNew->IsTabFrm(), "Table exspected" ); + OSL_ENSURE( pNew->IsTabFrm(), "Table exspected" ); pNew->Paste( pUp, pNxt ); ((SwTabFrm*)pNew)->RegistFlys(); (*pUpperFrms)[x-2] = pNew; @@ -330,7 +330,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) if( bFirst && pNxt && pNxt->IsSctFrm() ) ((SwSectionFrm*)pNxt)->UnlockJoin(); pUp = (SwLayoutFrm*)(*pUpperFrms)[x++]; - ASSERT( pUp->GetUpper() || pUp->IsFlyFrm(), "Lost Upper" ); + OSL_ENSURE( pUp->GetUpper() || pUp->IsFlyFrm(), "Lost Upper" ); ::_InsertCnt( pUp, pDoc, pNd->GetIndex(), FALSE, nStt+1, pNxt ); pNxt = pUp->GetLastLower(); (*pUpperFrms)[x-2] = pNxt; @@ -377,7 +377,7 @@ SwNode2Layout::SwNode2Layout( const SwNode& rNd ) void SwNode2Layout::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd ) { - ASSERT( pImpl, "RestoreUpperFrms without SaveUpperFrms" ); + OSL_ENSURE( pImpl, "RestoreUpperFrms without SaveUpperFrms" ); pImpl->RestoreUpperFrms( rNds, nStt, nEnd ); } diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 7260f1865d..e47a094dd9 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -81,7 +81,7 @@ SwNodes::SwNodes( SwDoc* pDocument ) { bInNodesDel = bInDelUpdOutl = bInDelUpdNum = FALSE; - ASSERT( pMyDoc, "in welchem Doc stehe ich denn?" ); + OSL_ENSURE( pMyDoc, "in welchem Doc stehe ich denn?" ); ULONG nPos = 0; SwStartNode* pSttNd = new SwStartNode( *this, nPos++ ); @@ -407,15 +407,15 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, if( !pFrmNd && aFrmNdIdx > rNds.GetEndOfExtras().GetIndex() ) { - ASSERT( !this, "ob das so richtig ist ??" ); + OSL_ENSURE( !this, "ob das so richtig ist ??" ); aFrmNdIdx = rNds.GetEndOfContent(); pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, TRUE, FALSE ); if( pFrmNd && !((SwCntntNode*)pFrmNd)->GetDepends() ) pFrmNd = 0; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 if( !pFrmNd ) - ASSERT( !this, "ChgNode() - kein FrameNode gefunden" ); + OSL_ENSURE( !this, "ChgNode() - kein FrameNode gefunden" ); #endif } if( pFrmNd ) @@ -837,7 +837,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, } else // es wurden alle Nodes innerhalb eines { // Start- und End-Nodes verschoben - ASSERT( pAktNode == aSttNdStack[nLevel] || + OSL_ENSURE( pAktNode == aSttNdStack[nLevel] || ( pAktNode->IsStartNode() && aSttNdStack[nLevel]->IsSectionNode()), "falscher StartNode" ); @@ -919,13 +919,13 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, } } else { - ASSERT( FALSE, "wie kommt diser Node ins Nodes-Array??" ); + OSL_ENSURE( FALSE, "wie kommt diser Node ins Nodes-Array??" ); } aRg.aEnd--; break; default: - ASSERT( FALSE, "was ist das fuer ein Node??" ); + OSL_ENSURE( FALSE, "was ist das fuer ein Node??" ); break; } @@ -2007,7 +2007,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) if ( &pStt->nNode.GetNode() == &GetEndOfContent() ) { const bool bSuccess = GoPrevious( &pStt->nNode ); - ASSERT( bSuccess, "Move() - no ContentNode here" ); + OSL_ENSURE( bSuccess, "Move() - no ContentNode here" ); (void) bSuccess; } pStt->nContent.Assign( (*this)[ pStt->nNode ]->GetCntntNode(), @@ -2226,12 +2226,12 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, aInsPos++; // ueberspringen } else { - ASSERT( FALSE, "wie kommt diser Node ins Nodes-Array??" ); + OSL_ENSURE( FALSE, "wie kommt diser Node ins Nodes-Array??" ); } break; default: - ASSERT( FALSE, "weder Start-/End-/Content-Node, unbekannter Typ" ); + OSL_ENSURE( FALSE, "weder Start-/End-/Content-Node, unbekannter Typ" ); } aRg.aStart++; } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 687aa103b7..2474b0f094 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -323,7 +323,7 @@ bool SwSection::DataEquals(SwSectionData const& rCmp) const void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) { SwSectionFmt* pFmt = GetFmt(); - ASSERT(pFmt, "ImplSetHiddenFlag: no format?"); + OSL_ENSURE(pFmt, "ImplSetHiddenFlag: no format?"); if( pFmt ) { const bool bHide = bTmpHidden && bCondition; @@ -376,7 +376,7 @@ BOOL SwSection::CalcHiddenFlag() const bool SwSection::IsProtect() const { SwSectionFmt *const pFmt( GetFmt() ); - ASSERT(pFmt, "SwSection::IsProtect: no format?"); + OSL_ENSURE(pFmt, "SwSection::IsProtect: no format?"); return (pFmt) ? pFmt->GetProtect().IsCntntProtected() : IsProtectFlag(); @@ -386,7 +386,7 @@ bool SwSection::IsProtect() const bool SwSection::IsEditInReadonly() const { SwSectionFmt *const pFmt( GetFmt() ); - ASSERT(pFmt, "SwSection::IsEditInReadonly: no format?"); + OSL_ENSURE(pFmt, "SwSection::IsEditInReadonly: no format?"); return (pFmt) ? pFmt->GetEditInReadonly().GetValue() : IsEditInReadonlyFlag(); @@ -406,7 +406,7 @@ void SwSection::SetHidden(bool const bFlag) void SwSection::SetProtect(bool const bFlag) { SwSectionFmt *const pFormat( GetFmt() ); - ASSERT(pFormat, "SwSection::SetProtect: no format?"); + OSL_ENSURE(pFormat, "SwSection::SetProtect: no format?"); if (pFormat) { SvxProtectItem aItem( RES_PROTECT ); @@ -424,7 +424,7 @@ void SwSection::SetProtect(bool const bFlag) void SwSection::SetEditInReadonly(bool const bFlag) { SwSectionFmt *const pFormat( GetFmt() ); - ASSERT(pFormat, "SwSection::SetEditInReadonly: no format?"); + OSL_ENSURE(pFormat, "SwSection::SetEditInReadonly: no format?"); if (pFormat) { SwFmtEditInReadonly aItem; @@ -733,7 +733,7 @@ SwSection * SwSectionFmt::GetSection() const return (SwSectionPtr)aIter.First( TYPE(SwSection) ); } - ASSERT( FALSE, "keine Section als Client." ) + OSL_ENSURE( FALSE, "keine Section als Client." ); return 0; } @@ -992,7 +992,7 @@ extern "C" { { const SwSectionFmt* pFSectFmt = (*(SwSectionPtr*)pFirst)->GetFmt(); const SwSectionFmt* pSSectFmt = (*(SwSectionPtr*)pSecond)->GetFmt(); - ASSERT( pFSectFmt && pSSectFmt && + OSL_ENSURE( pFSectFmt && pSSectFmt && pFSectFmt->GetCntnt(FALSE).GetCntntIdx() && pSSectFmt->GetCntnt(FALSE).GetCntntIdx(), "ungueltige Sections" ); @@ -1011,7 +1011,7 @@ extern "C" { { const SwSectionPtr pFSect = *(SwSectionPtr*)pFirst; const SwSectionPtr pSSect = *(SwSectionPtr*)pSecond; - ASSERT( pFSect && pSSect, "ungueltige Sections" ); + OSL_ENSURE( pFSect && pSSect, "ungueltige Sections" ); StringCompare const eCmp = pFSect->GetSectionName().CompareTo( pSSect->GetSectionName() ); return eCmp == COMPARE_EQUAL ? 0 @@ -1234,14 +1234,14 @@ void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd ) { if ( !rSectNd.GetDoc() ) { - ASSERT( false, + OSL_ENSURE( false, "method <lcl_RemoveSectionLinksInSect(..)> - no Doc at SectionNode" ); return; } if ( !rSectNd.GetSection().IsConnected() ) { - ASSERT( false, + OSL_ENSURE( false, "method <lcl_RemoveSectionLinksInSect(..)> - no Link at Section of SectionNode" ); return; } @@ -1751,7 +1751,7 @@ void SwIntrnlSectRefLink::Closed() void SwSection::CreateLink( LinkCreateType eCreateType ) { SwSectionFmt* pFmt = GetFmt(); - ASSERT(pFmt, "SwSection::CreateLink: no format?"); + OSL_ENSURE(pFmt, "SwSection::CreateLink: no format?"); if (!pFmt || (CONTENT_SECTION == m_Data.GetType())) return ; @@ -1797,7 +1797,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) } break; default: - ASSERT( !this, "Was ist das fuer ein Link?" ) + OSL_ENSURE( !this, "Was ist das fuer ein Link?" ); } switch( eCreateType ) @@ -1829,7 +1829,7 @@ void SwSection::BreakLink() if (m_RefLink.Is()) { SwSectionFmt *const pFormat( GetFmt() ); - ASSERT(pFormat, "SwSection::BreakLink: no format?"); + OSL_ENSURE(pFormat, "SwSection::BreakLink: no format?"); if (pFormat) { pFormat->GetDoc()->GetLinkManager().Remove( m_RefLink ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index d0d2b89d2b..32dabad9bb 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -100,7 +100,7 @@ void SwBaseLink::DataChanged( const String& rMimeType, { if( !pCntntNode ) { - ASSERT(!this, "DataChanged ohne ContentNode" ); + OSL_ENSURE(!this, "DataChanged ohne ContentNode" ); return ; } @@ -437,7 +437,7 @@ BOOL SwBaseLink::SwapIn( BOOL bWaitForData, BOOL bNativFormat ) if( bWaitForData && !GetObj() ) { - ASSERT( !this, "das SvxFileObject wurde in einem GetData geloescht!" ); + OSL_ENSURE( !this, "das SvxFileObject wurde in einem GetData geloescht!" ); bRes = FALSE; } else if( 0 != ( bRes = aValue.hasValue() ) ) @@ -506,7 +506,7 @@ const SwNode* SwBaseLink::GetAnchor() const } } - ASSERT( !this, "GetAnchor nicht ueberlagert" ); + OSL_ENSURE( !this, "GetAnchor nicht ueberlagert" ); return 0; } diff --git a/sw/source/core/docnode/threadmanager.cxx b/sw/source/core/docnode/threadmanager.cxx index e33c9049df..c42f476b4b 100644 --- a/sw/source/core/docnode/threadmanager.cxx +++ b/sw/source/core/docnode/threadmanager.cxx @@ -148,7 +148,7 @@ void ThreadManager::RemoveThread( const oslInterlockedCount nThreadID, } else { - ASSERT( false, "<ThreadManager::RemoveThread(..)> - ThreadJoiner already gone!" ); + OSL_ENSURE( false, "<ThreadManager::RemoveThread(..)> - ThreadJoiner already gone!" ); } } @@ -201,7 +201,7 @@ bool ThreadManager::StartThread( const tThreadData& rThreadData ) } else { - ASSERT( false, "<ThreadManager::StartThread(..)> - ThreadJoiner already gone!" ); + OSL_ENSURE( false, "<ThreadManager::StartThread(..)> - ThreadJoiner already gone!" ); } } else |