diff options
author | Jacek Wolszczak <shutdownrunner@gmail.com> | 2011-05-21 13:29:51 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-27 06:03:37 +0200 |
commit | 45df4e385910e1006d4bad4f674167c495b75673 (patch) | |
tree | ff5555958d1d61fdace85806bae6bf5a7d94c6a2 | |
parent | a64076a0699d7a5f56c38530bedfd8d8fb6aef4e (diff) |
Replace DBG_* with OSL_* in sc/source/core
92 files changed, 528 insertions, 582 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index ae5c3e7b880e..26b20967b10d 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -192,7 +192,7 @@ public: /** Cell takes ownership of the passed note and broadcaster. */ explicit ScNoteCell( ScPostIt* pNote, SvtBroadcaster* pBC = 0 ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ~ScNoteCell(); #endif @@ -209,7 +209,7 @@ public: ScValueCell(); explicit ScValueCell( double fValue ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ~ScValueCell(); #endif @@ -230,7 +230,7 @@ public: ScStringCell(); explicit ScStringCell( const String& rString ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ~ScStringCell(); #endif diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 9872f01cda62..e8f7da17e4f5 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -276,7 +276,7 @@ enum CellType CELLTYPE_NOTE, CELLTYPE_EDIT, CELLTYPE_SYMBOLS // for load/save -#if DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ,CELLTYPE_DESTROYED #endif }; diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index d0685130155e..f32553720338 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1054,7 +1054,7 @@ sal_Bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem, SCROW nStartRow, SCROW nEndRow, sal_Bool bLeft, SCCOL nDistRight, sal_Bool bTop, SCROW nDistBottom ) { - DBG_ASSERT( pBoxItem && pBoxInfoItem, "Linienattribute fehlen!" ); + OSL_ENSURE( pBoxItem && pBoxInfoItem, "Linienattribute fehlen!" ); const ScPatternAttr* pPattern = GetPattern( nStartRow ); const SvxBoxItem* pOldFrame = (const SvxBoxItem*) @@ -1146,7 +1146,7 @@ long lcl_LineSize( const SvxBorderLine& rLine ) sal_uInt16 nDist = rLine.GetDistance(); if (nDist) { - DBG_ASSERT( rLine.GetOutWidth() && rLine.GetInWidth(), + OSL_ENSURE( rLine.GetOutWidth() && rLine.GetInWidth(), "Line has a distance, but only a width?" ); nTotal += ( nDist > 20 ) ? nDist : 20; @@ -1441,7 +1441,7 @@ sal_Bool ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) const ScMergeFlagAttr* pFlagAttr = (const ScMergeFlagAttr*) &pDocument->GetPool()->GetDefaultItem( ATTR_MERGE_FLAG ); - DBG_ASSERT( nCountY==1 || nThisStart==nThisEnd, "What's up?" ); + OSL_ENSURE( nCountY==1 || nThisStart==nThisEnd, "What's up?" ); SCCOL nThisCol = nCol; SCCOL nMergeEndCol = nThisCol + nCountX - 1; @@ -1810,7 +1810,7 @@ sal_Bool ScAttrArray::IsEmpty() const sal_Bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const { - DBG_ASSERT( nCount, "nCount == 0" ); + OSL_ENSURE( nCount, "nCount == 0" ); sal_Bool bFound = false; SCSIZE nStart = 0; @@ -2384,7 +2384,7 @@ SCsROW ScAttrArray::SearchStyle( SCsROW nRow, const ScStyleSheet* pSearchStyle, } } - DBG_ASSERT( bFound || !ValidRow(nRow), "Internal failure in in ScAttrArray::SearchStyle" ); + OSL_ENSURE( bFound || !ValidRow(nRow), "Internal failure in in ScAttrArray::SearchStyle" ); return nRow; } diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 5de173eec222..ccc78bb74434 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -155,7 +155,7 @@ String ScMergeAttr::GetValueText() const int ScMergeAttr::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" ); + OSL_ENSURE( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" ); return (Which() == rItem.Which()) && (nColMerge == ((ScMergeAttr&)rItem).nColMerge) && (nRowMerge == ((ScMergeAttr&)rItem).nRowMerge); @@ -378,7 +378,7 @@ SfxItemPresentation ScProtectionAttr::GetPresentation int ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" ); + OSL_ENSURE( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" ); return (Which() == rItem.Which()) && (bProtection == ((ScProtectionAttr&)rItem).bProtection) && (bHideFormula == ((ScProtectionAttr&)rItem).bHideFormula) @@ -448,7 +448,7 @@ sal_Bool ScProtectionAttr::SetHidePrint( sal_Bool bHPrint) int ScRangeItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" ); return ( aRange == ( (ScRangeItem&)rAttr ).aRange ); } @@ -549,7 +549,7 @@ ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy ) int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" ); ScTableListItem& rCmp = (ScTableListItem&)rAttr; sal_Bool bEqual = (nCount == rCmp.nCount); @@ -731,7 +731,7 @@ String ScPageHFItem::GetValueText() const int ScPageHFItem::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); + OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); const ScPageHFItem& r = (const ScPageHFItem&)rItem; @@ -815,7 +815,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const EditTextObject* pCenter = EditTextObject::Create(rStream); EditTextObject* pRight = EditTextObject::Create(rStream); - DBG_ASSERT( pLeft && pCenter && pRight, "Error reading ScPageHFItem" ); + OSL_ENSURE( pLeft && pCenter && pRight, "Error reading ScPageHFItem" ); if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 || pCenter == NULL || pCenter->GetParagraphCount() == 0 || @@ -1007,7 +1007,7 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation String ScViewObjectModeItem::GetValueText( sal_uInt16 nVal ) const { - DBG_ASSERT( nVal <= VOBJ_MODE_HIDE, "enum overflow!" ); + OSL_ENSURE( nVal <= VOBJ_MODE_HIDE, "enum overflow!" ); return ScGlobal::GetRscString( STR_VOBJ_MODE_SHOW + (nVal % 2)); } @@ -1085,7 +1085,7 @@ String ScDoubleItem::GetValueText() const int ScDoubleItem::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); + OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); const ScDoubleItem& _rItem = (const ScDoubleItem&)rItem; return int(nValue == _rItem.nValue); } @@ -1143,7 +1143,7 @@ ScPageScaleToItem* ScPageScaleToItem::Clone( SfxItemPool* ) const int ScPageScaleToItem::operator==( const SfxPoolItem& rCmp ) const { - DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "ScPageScaleToItem::operator== - unequal wid or type" ); + OSL_ENSURE( SfxPoolItem::operator==( rCmp ), "ScPageScaleToItem::operator== - unequal wid or type" ); const ScPageScaleToItem& rPageCmp = static_cast< const ScPageScaleToItem& >( rCmp ); return ((mnWidth == rPageCmp.mnWidth) && (mnHeight == rPageCmp.mnHeight)) ? 1 : 0; } @@ -1194,7 +1194,7 @@ SfxItemPresentation ScPageScaleToItem::GetPresentation( break; default: - DBG_ERRORFILE( "ScPageScaleToItem::GetPresentation - unknown presentation mode" ); + OSL_FAIL( "ScPageScaleToItem::GetPresentation - unknown presentation mode" ); ePres = SFX_ITEM_PRESENTATION_NONE; } return ePres; @@ -1208,7 +1208,7 @@ bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const case SC_MID_PAGE_SCALETO_WIDTH: rAny <<= mnWidth; break; case SC_MID_PAGE_SCALETO_HEIGHT: rAny <<= mnHeight; break; default: - DBG_ERRORFILE( "ScPageScaleToItem::QueryValue - unknown member ID" ); + OSL_FAIL( "ScPageScaleToItem::QueryValue - unknown member ID" ); bRet = false; } return bRet; @@ -1222,7 +1222,7 @@ bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId ) case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break; case SC_MID_PAGE_SCALETO_HEIGHT: bRet = rAny >>= mnHeight; break; default: - DBG_ERRORFILE( "ScPageScaleToItem::PutValue - unknown member ID" ); + OSL_FAIL( "ScPageScaleToItem::PutValue - unknown member ID" ); } return bRet; } diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx index 039aedf2735c..44f5cd58019e 100644 --- a/sc/source/core/data/autonamecache.cxx +++ b/sc/source/core/data/autonamecache.cxx @@ -92,7 +92,7 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rN case CELLTYPE_VALUE: case CELLTYPE_NOTE: case CELLTYPE_SYMBOLS: -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 case CELLTYPE_DESTROYED: #endif ; // nothing, prevent compiler warning diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index f31bd26958e2..29eb38c54c96 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -159,7 +159,7 @@ bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const pDoc->SetHardRecalcState( 1 ); SfxObjectShell* pShell = pDoc->GetDocumentShell(); - DBG_ASSERT( pShell, "Missing DocShell :-/" ); + OSL_ENSURE( pShell, "Missing DocShell :-/" ); if ( pShell ) pShell->SetError( SCWARN_CORE_HARD_RECALC, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); @@ -177,7 +177,7 @@ bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange, SvtListener* pListener, ScBroadcastArea*& rpArea ) { bool bNewArea = false; - DBG_ASSERT(pListener, "StartListeningArea: pListener Null"); + OSL_ENSURE(pListener, "StartListeningArea: pListener Null"); if (CheckHardRecalcStateCondition()) return false; if ( !rpArea ) @@ -199,7 +199,7 @@ bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange, } else { - DBG_ERRORFILE("StartListeningArea: area not found and not inserted in slot?!?"); + OSL_FAIL("StartListeningArea: area not found and not inserted in slot?!?"); delete rpArea; rpArea = 0; } @@ -218,7 +218,7 @@ bool ScBroadcastAreaSlot::StartListeningArea( const ScRange& rRange, void ScBroadcastAreaSlot::InsertListeningArea( ScBroadcastArea* pArea ) { - DBG_ASSERT( pArea, "InsertListeningArea: pArea NULL"); + OSL_ENSURE( pArea, "InsertListeningArea: pArea NULL"); if (CheckHardRecalcStateCondition()) return; if (aBroadcastAreaTbl.insert( pArea).second) @@ -231,7 +231,7 @@ void ScBroadcastAreaSlot::InsertListeningArea( ScBroadcastArea* pArea ) void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange, SvtListener* pListener, ScBroadcastArea*& rpArea ) { - DBG_ASSERT(pListener, "EndListeningArea: pListener Null"); + OSL_ENSURE(pListener, "EndListeningArea: pListener Null"); if ( !rpArea ) { ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange)); @@ -256,7 +256,7 @@ void ScBroadcastAreaSlot::EndListeningArea( const ScRange& rRange, ScBroadcastAreas::iterator aIter( FindBroadcastArea( rRange)); if (aIter == aBroadcastAreaTbl.end()) return; - DBG_ASSERT( *aIter == rpArea, "EndListeningArea: area pointer mismatch"); + OSL_ENSURE( *aIter == rpArea, "EndListeningArea: area pointer mismatch"); aBroadcastAreaTbl.erase( aIter); if ( !rpArea->DecRef() ) { @@ -408,7 +408,7 @@ void ScBroadcastAreaSlot::UpdateRemoveArea( ScBroadcastArea* pArea ) if (aIter == aBroadcastAreaTbl.end()) return; if (*aIter != pArea) - DBG_ERRORFILE( "UpdateRemoveArea: area pointer mismatch"); + OSL_FAIL( "UpdateRemoveArea: area pointer mismatch"); else { aBroadcastAreaTbl.erase( aIter); @@ -490,7 +490,7 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset( SCCOL nCol = rAddress.Col(); if ( !ValidRow(nRow) || !ValidCol(nCol) ) { - DBG_ERRORFILE( "Row/Col invalid, using first slot!" ); + OSL_FAIL( "Row/Col invalid, using first slot!" ); return 0; } for (size_t i=0; i < aSlotDistribution.size(); ++i) @@ -503,7 +503,7 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset( static_cast<SCSIZE>(nCol) / BCA_SLOT_COLS * nBcaSlotsRow; } } - DBG_ERRORFILE( "No slot found, using last!" ); + OSL_FAIL( "No slot found, using last!" ); return nBcaSlots - 1; } @@ -590,7 +590,7 @@ void ScBroadcastAreaSlotMachine::EndListeningArea( const ScRange& rRange, { if ( rRange == BCA_LISTEN_ALWAYS ) { - DBG_ASSERT( pBCAlways, "ScBroadcastAreaSlotMachine::EndListeningArea: BCA_LISTEN_ALWAYS but none established"); + OSL_ENSURE( pBCAlways, "ScBroadcastAreaSlotMachine::EndListeningArea: BCA_LISTEN_ALWAYS but none established"); if ( pBCAlways ) { pListener->EndListening( *pBCAlways); @@ -781,7 +781,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( TableSlotsMap::iterator iTab( aTableSlotsMap.find( nTab)); if (iTab == aTableSlotsMap.end()) { - DBG_ERRORFILE( "UpdateBroadcastAreas: Where's the TableSlot?!?"); + OSL_FAIL( "UpdateBroadcastAreas: Where's the TableSlot?!?"); continue; // for } ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots(); diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index d3e9cb8db5a5..d744c16758f9 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -106,7 +106,7 @@ ScBaseCell::~ScBaseCell() { delete mpNote; delete mpBroadcaster; - DBG_ASSERT( eCellType == CELLTYPE_DESTROYED, "BaseCell Destructor" ); + OSL_ENSURE( eCellType == CELLTYPE_DESTROYED, "BaseCell Destructor" ); } namespace { @@ -573,7 +573,7 @@ ScNoteCell::ScNoteCell( ScPostIt* pNote, SvtBroadcaster* pBC ) : TakeBroadcaster( pBC ); } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ScNoteCell::~ScNoteCell() { eCellType = CELLTYPE_DESTROYED; @@ -594,7 +594,7 @@ ScValueCell::ScValueCell( double fValue ) : { } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ScValueCell::~ScValueCell() { eCellType = CELLTYPE_DESTROYED; @@ -614,7 +614,7 @@ ScStringCell::ScStringCell( const String& rString ) : { } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ScStringCell::~ScStringCell() { eCellType = CELLTYPE_DESTROYED; @@ -834,7 +834,7 @@ ScFormulaCell::~ScFormulaCell() pDocument->GetExternalRefManager()->removeRefCell(this); delete pCode; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 eCellType = CELLTYPE_DESTROYED; #endif } @@ -1092,7 +1092,7 @@ void ScFormulaCell::CalcAfterLoad() // hier fuer alle Systeme ausbuegeln, damit da auch Err503 steht if ( aResult.IsValue() && !::rtl::math::isFinite( aResult.GetDouble() ) ) { - DBG_ERRORFILE("Formelzelle INFINITY !!! Woher kommt das Dokument?"); + OSL_FAIL("Formelzelle INFINITY !!! Woher kommt das Dokument?"); aResult.SetResultError( errIllegalFPOperation ); bDirty = sal_True; } @@ -1400,7 +1400,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) pCode->SetCodeError( errNoCode ); // This is worth an assertion; if encountered in daily work // documents we might need another solution. Or just confirm correctness. - DBG_ERRORFILE( "ScFormulaCell::Interpret: no UPN, no error, no token, but string" ); + OSL_FAIL( "ScFormulaCell::Interpret: no UPN, no error, no token, but string" ); return; } CompileTokenArray(); @@ -1668,7 +1668,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) else { // Zelle bei Compiler-Fehlern nicht ewig auf dirty stehenlassen - DBG_ASSERT( pCode->GetCodeError(), "kein UPN-Code und kein Fehler ?!?!" ); + OSL_ENSURE( pCode->GetCodeError(), "kein UPN-Code und kein Fehler ?!?!" ); bDirty = false; bTableOpDirty = false; } diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index af99ddf3cf9f..7948676d3e9c 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -88,7 +88,7 @@ ScEditCell::ScEditCell( const String& rString, ScDocument* pDocP ) : pString( NULL ), pDoc( pDocP ) { - DBG_ASSERT( rString.Search('\n') != STRING_NOTFOUND || + OSL_ENSURE( rString.Search('\n') != STRING_NOTFOUND || rString.Search(CHAR_CR) != STRING_NOTFOUND, "EditCell mit einfachem Text !?!?" ); @@ -102,7 +102,7 @@ ScEditCell::~ScEditCell() delete pData; delete pString; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 eCellType = CELLTYPE_DESTROYED; #endif } @@ -651,7 +651,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) } else { -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 String aTmp; ByteString aMsg( "broken Matrix, no MatFormula at origin, Pos: " ); aPos.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument ); @@ -659,7 +659,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) aMsg += ", MatOrg: "; aOrg.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument ); aMsg += ByteString( aTmp, RTL_TEXTENCODING_ASCII_US ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + OSL_FAIL( aMsg.GetBuffer() ); #endif return 0; // bad luck ... } @@ -681,7 +681,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) if ( !nEdges ) nEdges = 1; // mittendrin } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 else { String aTmp; @@ -699,7 +699,7 @@ sal_uInt16 ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) aMsg += ByteString::CreateFromInt32( dC ); aMsg += ", DiffRows: "; aMsg += ByteString::CreateFromInt32( dR ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + OSL_FAIL( aMsg.GetBuffer() ); } #endif return nEdges; diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 6aa581f6b2a7..6cd863afd560 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1199,7 +1199,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize ) for (i = 0; i < nDelCount; i++) { ScBaseCell* pCell = ppDelCells[i]; - DBG_ASSERT( pCell->IsBlank(), "sichtbare Zelle weggeschoben" ); + OSL_ENSURE( pCell->IsBlank(), "sichtbare Zelle weggeschoben" ); SvtBroadcaster* pBC = pCell->GetBroadcaster(); if (pBC) { @@ -2042,7 +2042,7 @@ void ScColumn::CalcAll() nNewVal = pFCell->GetValue(); else nNewVal = nOldVal; // random(), jetzt() etc. - DBG_ASSERT( nOldVal==nNewVal, "CalcAll: nOldVal != nNewVal" ); + OSL_ENSURE( nOldVal==nNewVal, "CalcAll: nOldVal != nNewVal" ); #endif } } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 0cf30010f35b..9c7d2fa3f982 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -619,7 +619,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag) if ( nDelFlag & IDF_EDITATTR ) { - DBG_ASSERT( nContFlag == 0, "DeleteArea: falsche Flags" ); + OSL_ENSURE( nContFlag == 0, "DeleteArea: falsche Flags" ); RemoveEditAttribs( nStartRow, nEndRow ); } @@ -816,7 +816,7 @@ void ScColumn::CopyFromClip(SCROW nRow1, SCROW nRow2, long nDy, const ScPostIt* pSourceNote = pSourceCell ? pSourceCell->GetNote() : 0; if (pSourceNote) { - DBG_ASSERT( !pAddNoteCell->HasNote(), "ScColumn::CopyFromClip - unexpected note at destination cell" ); + OSL_ENSURE( !pAddNoteCell->HasNote(), "ScColumn::CopyFromClip - unexpected note at destination cell" ); bool bCloneCaption = (nInsFlag & IDF_NOCAPTIONS) == 0; // #i52342# if caption is cloned, the note must be constructed with the destination document ScAddress aSourcePos( rColumn.nCol, rColumn.pItems[i].nRow, rColumn.nTab ); @@ -948,7 +948,7 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rD } break; - default: DBG_ERRORFILE( "ScColumn::CloneCell - unknown cell type" ); + default: OSL_FAIL( "ScColumn::CloneCell - unknown cell type" ); } // clone the cell note @@ -1064,7 +1064,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, if ( nIndex < nCount && nNextThis == nRow ) pDest = pItems[nIndex].pCell; - DBG_ASSERT( pSrc || pDest, "Nanu ?" ); + OSL_ENSURE( pSrc || pDest, "Nanu ?" ); CellType eSrcType = pSrc ? pSrc->GetCellType() : CELLTYPE_NONE; CellType eDestType = pDest ? pDest->GetCellType() : CELLTYPE_NONE; diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 2668893ed4d3..ce6327c33bcd 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -449,7 +449,7 @@ void ScConditionEntry::CompileXML() void ScConditionEntry::SetSrcString( const String& rNew ) { // aSrcString is only evaluated in CompileXML - DBG_ASSERT( pDoc->IsImportingXML(), "SetSrcString is only valid for XML import" ); + OSL_ENSURE( pDoc->IsImportingXML(), "SetSrcString is only valid for XML import" ); aSrcString = rNew; } @@ -1294,7 +1294,7 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const pNewDoc = pDoc; ScConditionalFormat* pNew = new ScConditionalFormat(nKey, pNewDoc); - DBG_ASSERT(!pNew->ppEntries, "wo kommen die Eintraege her?"); + OSL_ENSURE(!pNew->ppEntries, "wo kommen die Eintraege her?"); if (nEntryCount) { @@ -1382,7 +1382,7 @@ const String& ScConditionalFormat::GetCellStyle( ScBaseCell* pCell, const ScAddr void lcl_Extend( ScRange& rRange, ScDocument* pDoc, sal_Bool bLines ) { SCTAB nTab = rRange.aStart.Tab(); - DBG_ASSERT(rRange.aEnd.Tab() == nTab, "lcl_Extend - mehrere Tabellen?"); + OSL_ENSURE(rRange.aEnd.Tab() == nTab, "lcl_Extend - mehrere Tabellen?"); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index c8602214f506..4bb8299d8bc6 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1223,7 +1223,7 @@ void ScQueryCellIterator::AdvanceQueryParamEntryField() rEntry.nField++; else { - DBG_ERRORFILE( "AdvanceQueryParamEntryField: ++rEntry.nField > MAXCOL" ); + OSL_FAIL( "AdvanceQueryParamEntryField: ++rEntry.nField > MAXCOL" ); } } else @@ -1676,7 +1676,7 @@ ScBaseCell* ScHorizontalCellIterator::GetNext( SCCOL& rCol, SCROW& rRow ) ScColumn* pCol = &pDoc->pTab[nTab]->aCol[nCol]; SCSIZE nIndex = pNextIndices[nCol-nStartCol]; - DBG_ASSERT( nIndex < pCol->nCount, "ScHorizontalCellIterator::GetNext: nIndex out of range" ); + OSL_ENSURE( nIndex < pCol->nCount, "ScHorizontalCellIterator::GetNext: nIndex out of range" ); ScBaseCell* pCell = pCol->pItems[nIndex].pCell; if ( ++nIndex < pCol->nCount ) { @@ -1747,7 +1747,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB nEndCol( nCol2 ), nEndRow( nRow2 ) { - DBG_ASSERT( pDoc->pTab[nTab], "Tabelle nicht da" ); + OSL_ENSURE( pDoc->pTab[nTab], "Tabelle nicht da" ); SCCOL i; @@ -1765,7 +1765,7 @@ ScHorizontalAttrIterator::ScHorizontalAttrIterator( ScDocument* pDocument, SCTAB { SCCOL nPos = i - nStartCol; ScAttrArray* pArray = pDoc->pTab[nTab]->aCol[i].pAttrArray; - DBG_ASSERT( pArray, "pArray == 0" ); + OSL_ENSURE( pArray, "pArray == 0" ); SCSIZE nIndex; pArray->Search( nStartRow, nIndex ); @@ -1851,7 +1851,7 @@ const ScPatternAttr* ScHorizontalAttrIterator::GetNext( SCCOL& rCol1, SCCOL& rCo pNextEnd[nPos] = nThisEnd; ppPatterns[nPos] = pPattern; - DBG_ASSERT( pNextEnd[nPos] >= nRow, "Reihenfolge durcheinander" ); + OSL_ENSURE( pNextEnd[nPos] >= nRow, "Reihenfolge durcheinander" ); } else { diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index cb9b8044efc3..234ac869daba 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -396,7 +396,7 @@ ScDocumentPool::~ScDocumentPool() void ScDocumentPool::InitVersionMaps() { - DBG_ASSERT( !pVersionMap1 && !pVersionMap2 && + OSL_PRECOND( !pVersionMap1 && !pVersionMap2 && !pVersionMap3 && !pVersionMap4 && !pVersionMap5 && !pVersionMap6 && !pVersionMap7 && !pVersionMap8 && @@ -555,7 +555,7 @@ void ScDocumentPool::InitVersionMaps() void ScDocumentPool::DeleteVersionMaps() { - DBG_ASSERT( pVersionMap1 && pVersionMap2 && + OSL_PRECOND( pVersionMap1 && pVersionMap2 && pVersionMap3 && pVersionMap4 && pVersionMap5 && pVersionMap6 && pVersionMap7 && pVersionMap8 && @@ -637,7 +637,7 @@ void ScDocumentPool::CheckRef( const SfxPoolItem& rItem ) { // beim Apply vom Cache wird evtl. um 2 hochgezaehlt (auf MAX+1 oder SAFE+2), // heruntergezaehlt wird nur einzeln (in LoadCompleted) - DBG_ASSERT( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2), + OSL_ENSURE( nRef<=(sal_uLong)SC_MAX_POOLREF+1 || (nRef>=(sal_uLong)SC_SAFE_POOLREF-1 && nRef<=(sal_uLong)SC_SAFE_POOLREF+2), "ScDocumentPool::CheckRef" ); SetRefCount( (SfxPoolItem&)rItem, (sal_uLong) SC_SAFE_POOLREF ); } diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 32c383e4be2d..a1e630d42aa2 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -277,7 +277,7 @@ sfx2::LinkManager* ScDocument::GetLinkManager() const void ScDocument::SetStorageGrammar( formula::FormulaGrammar::Grammar eGram ) { - DBG_ASSERT( + OSL_PRECOND( eGram == formula::FormulaGrammar::GRAM_ODFF || eGram == formula::FormulaGrammar::GRAM_PODF, "ScDocument::SetStorageGrammar: wrong storage grammar"); @@ -325,7 +325,7 @@ void ScDocument::EndChangeTracking() void ScDocument::SetChangeTrack( ScChangeTrack* pTrack ) { - DBG_ASSERT( pTrack->GetDocument() == this, "SetChangeTrack: different documents" ); + OSL_ENSURE( pTrack->GetDocument() == this, "SetChangeTrack: different documents" ); if ( !pTrack || pTrack == pChangeTrack || pTrack->GetDocument() != this ) return ; EndChangeTracking(); @@ -370,7 +370,7 @@ void ScDocument::StartTrackTimer() ScDocument::~ScDocument() { - DBG_ASSERT( !bInLinkUpdate, "bInLinkUpdate in dtor" ); + OSL_PRECOND( !bInLinkUpdate, "bInLinkUpdate in dtor" ); bInDtorClear = sal_True; @@ -463,12 +463,12 @@ ScDocument::~ScDocument() delete pOtherObjects; delete pRecursionHelper; - DBG_ASSERT( !pAutoNameCache, "AutoNameCache still set in dtor" ); + OSL_POSTCOND( !pAutoNameCache, "AutoNameCache still set in dtor" ); } void ScDocument::InitClipPtrs( ScDocument* pSourceDoc ) { - DBG_ASSERT(bIsClip, "InitClipPtrs und nicht bIsClip"); + OSL_ENSURE(bIsClip, "InitClipPtrs und nicht bIsClip"); if (pCondFormList) { @@ -803,7 +803,7 @@ sal_Bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pO // vorneweg testen, ob der Prefix als gueltig erkannt wird // wenn nicht, nur doppelte vermeiden sal_Bool bPrefix = ValidTabName( aName ); - DBG_ASSERT(bPrefix, "ungueltiger Tabellenname"); + OSL_ENSURE(bPrefix, "ungueltiger Tabellenname"); SCTAB nDummy; CreateValidTabName(aName); @@ -1147,7 +1147,7 @@ void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew) if (pChangeViewSettings==NULL) pChangeViewSettings = new ScChangeViewSettings; - DBG_ASSERT( pChangeViewSettings, "Oops. No ChangeViewSettings :-( by!" ); + OSL_ENSURE( pChangeViewSettings, "Oops. No ChangeViewSettings :-( by!" ); *pChangeViewSettings=rNew; } @@ -1220,7 +1220,7 @@ void ScDocument::AddLookupCache( ScLookupCache & rCache ) if (!pLookupCacheMapImpl->aCacheMap.insert( ::std::pair< const ScRange, ScLookupCache*>( rCache.getRange(), &rCache)).second) { - DBG_ERRORFILE( "ScDocument::AddLookupCache: couldn't add to hash map"); + OSL_FAIL( "ScDocument::AddLookupCache: couldn't add to hash map"); } else StartListeningArea( rCache.getRange(), &rCache); @@ -1232,7 +1232,7 @@ void ScDocument::RemoveLookupCache( ScLookupCache & rCache ) rCache.getRange())); if (it == pLookupCacheMapImpl->aCacheMap.end()) { - DBG_ERRORFILE( "ScDocument::RemoveLookupCache: range not found in hash map"); + OSL_FAIL( "ScDocument::RemoveLookupCache: range not found in hash map"); } else { diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 9e01f96ecc24..2720ca16008f 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -476,7 +476,7 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, { if ( IsClipboard() ) { - DBG_ERRORFILE( "LinkExternalTab in Clipboard" ); + OSL_FAIL( "LinkExternalTab in Clipboard" ); return false; } rTab = 0; @@ -494,7 +494,7 @@ sal_Bool ScDocument::LinkExternalTab( SCTAB& rTab, const String& aDocTab, { if ( !InsertTab( SC_TAB_APPEND, aDocTab, sal_True ) ) { - DBG_ERRORFILE("can't insert external document table"); + OSL_FAIL("can't insert external document table"); return false; } rTab = GetTableCount() - 1; @@ -827,7 +827,7 @@ void ScDocument::RemoveUnoObject( SfxListener& rObject ) { // BroadcastUno is always called with the SolarMutex locked, so if it // can be acquired, this is within the same thread (should not happen) - DBG_ERRORFILE( "RemoveUnoObject called from BroadcastUno" ); + OSL_FAIL( "RemoveUnoObject called from BroadcastUno" ); rSolarMutex.release(); } else @@ -877,7 +877,7 @@ void ScDocument::BroadcastUno( const SfxHint &rHint ) void ScDocument::AddUnoListenerCall( const uno::Reference<util::XModifyListener>& rListener, const lang::EventObject& rEvent ) { - DBG_ASSERT( bInUnoBroadcast, "AddUnoListenerCall is supposed to be called from BroadcastUno only" ); + OSL_ENSURE( bInUnoBroadcast, "AddUnoListenerCall is supposed to be called from BroadcastUno only" ); if ( !pUnoListenerCalls ) pUnoListenerCalls = new ScUnoListenerCalls; @@ -886,7 +886,7 @@ void ScDocument::AddUnoListenerCall( const uno::Reference<util::XModifyListener> void ScDocument::BeginUnoRefUndo() { - DBG_ASSERT( !pUnoRefUndoList, "BeginUnoRefUndo twice" ); + OSL_ENSURE( !pUnoRefUndoList, "BeginUnoRefUndo twice" ); delete pUnoRefUndoList; pUnoRefUndoList = new ScUnoRefList; @@ -997,7 +997,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode, void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDoc, const ScMarkData& rMark, ScDocument* pUndoDoc ) { - DBG_ASSERT(pClipDoc->bIsClip, "UpdateTranspose: kein Clip"); + OSL_ENSURE(pClipDoc->bIsClip, "UpdateTranspose: kein Clip"); ScRange aSource; ScClipParam& rClipParam = GetClipParam(); @@ -1850,13 +1850,13 @@ void ScDocument::CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest) const ScDocOptions& ScDocument::GetDocOptions() const { - DBG_ASSERT( pDocOptions, "No DocOptions! :-(" ); + OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); return *pDocOptions; } void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) { - DBG_ASSERT( pDocOptions, "No DocOptions! :-(" ); + OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); bool bUpdateFuncNames = pDocOptions->GetUseEnglishFuncName() != rOpt.GetUseEnglishFuncName(); *pDocOptions = rOpt; @@ -1891,13 +1891,13 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) const ScViewOptions& ScDocument::GetViewOptions() const { - DBG_ASSERT( pViewOptions, "No ViewOptions! :-(" ); + OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); return *pViewOptions; } void ScDocument::SetViewOptions( const ScViewOptions& rOpt ) { - DBG_ASSERT( pViewOptions, "No ViewOptions! :-(" ); + OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); *pViewOptions = rOpt; } diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index b9c79e1c9ebf..5364ae2992c8 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -109,7 +109,7 @@ sal_Bool ScDocument::Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, if (pCell) { // FIXME FIXME FIXME this might need to be reworked now that we have formula::FormulaErrorToken and ScFormulaResult, double check !!! - DBG_ERRORFILE("ScDocument::Solver: -> ScFormulaCell::GetValueAlways might need reimplementation"); + OSL_FAIL("ScDocument::Solver: -> ScFormulaCell::GetValueAlways might need reimplementation"); pCell->Interpret(); sal_uInt16 nErrCode = pCell->GetErrCode(); nX = pCell->GetValueAlways(); @@ -316,7 +316,7 @@ bool setCacheTableReferenced(ScToken& rToken, ScExternalRefManager& rRefMgr) /* TODO: external names aren't supported yet, but would * have to be marked as well, if so. Mechanism would be * different. */ - DBG_ERRORFILE("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); + OSL_FAIL("ScDocument::MarkUsedExternalReferences: implement the svExternalName case!"); default: ; } @@ -818,7 +818,7 @@ sal_uInt16 ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab, if (nUsed > 0) return static_cast<sal_uInt16>((nDif*64)/nUsed); // max.256 (SC_DOCCOMP_MAXDIFF) - DBG_ASSERT(!nDif,"Diff ohne Used"); + OSL_ENSURE(!nDif,"Diff ohne Used"); return 0; } @@ -859,7 +859,7 @@ sal_uInt16 ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab, if (nUsed > 0) return static_cast<sal_uInt16>((nDif*64)/nUsed); // max.256 - DBG_ASSERT(!nDif,"Diff ohne Used"); + OSL_ENSURE(!nDif,"Diff ohne Used"); return 0; } diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index a737a5966764..a05fd0d29aa3 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -141,7 +141,7 @@ void ScDocument::UpdateAllCharts() if (pTab[nTab]) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); ScRange aRange; SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); @@ -209,7 +209,7 @@ sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pNa if (pDrawLayer && pTab[nTab]) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -255,7 +255,7 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const Strin for (sal_uInt16 nTab=0; nTab<nCount; nTab++) { SdrPage* pPage = pDrawLayer->GetPage(nTab); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -320,7 +320,7 @@ void ScDocument::GetOldChartParameters( const String& rName, for (sal_uInt16 nTab=0; nTab<nCount; nTab++) { SdrPage* pPage = pDrawLayer->GetPage(nTab); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -367,7 +367,7 @@ void ScDocument::UpdateChartArea( const String& rChartName, for (SCTAB nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -602,7 +602,7 @@ void ScDocument::SetChartRangeList( const String& rChartName, for (SCTAB nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -659,7 +659,7 @@ uno::Reference< embed::XEmbeddedObject > for (sal_uInt16 nTab=0; nTab<nCount; nTab++) { SdrPage* pPage = pDrawLayer->GetPage(nTab); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); @@ -706,7 +706,7 @@ void ScDocument::UpdateChartListenerCollection() if (pTab[nTab]) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) continue; @@ -734,7 +734,7 @@ void ScDocument::UpdateChartListenerCollection() bool bIsChart = false; uno::Reference< embed::XEmbeddedObject > xIPObj = ((SdrOle2Obj*)pObject)->GetObjRef(); - DBG_ASSERT( xIPObj.is(), "No embedded object is given!"); + OSL_ENSURE( xIPObj.is(), "No embedded object is given!"); uno::Reference< ::com::sun::star::chart2::data::XDataReceiver > xReceiver; uno::Reference< embed::XComponentSupplier > xCompSupp( xIPObj, uno::UNO_QUERY ); if( xCompSupp.is()) diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index f747788977cf..089997ad6d14 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -65,7 +65,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator() uno::Reference< uno::XInterface > xInterface = xServiceManager->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_BREAKITER_SERVICE )) ); pScriptTypeData->xBreakIter = uno::Reference< i18n::XBreakIterator >( xInterface, uno::UNO_QUERY ); - DBG_ASSERT( pScriptTypeData->xBreakIter.is(), "can't get BreakIterator" ); + OSL_ENSURE( pScriptTypeData->xBreakIter.is(), "can't get BreakIterator" ); } return pScriptTypeData->xBreakIter; } diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 3bbfde5b31a1..c9513a511318 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -191,7 +191,7 @@ void ScDocument::DelBroadcastAreasInRange( const ScRange& rRange ) void ScDocument::StartListeningCell( const ScAddress& rAddress, SvtListener* pListener ) { - DBG_ASSERT(pListener, "StartListeningCell: pListener Null"); + OSL_ENSURE(pListener, "StartListeningCell: pListener Null"); SCTAB nTab = rAddress.Tab(); if (pTab[nTab]) pTab[nTab]->StartListening( rAddress, pListener ); @@ -200,7 +200,7 @@ void ScDocument::StartListeningCell( const ScAddress& rAddress, void ScDocument::EndListeningCell( const ScAddress& rAddress, SvtListener* pListener ) { - DBG_ASSERT(pListener, "EndListeningCell: pListener Null"); + OSL_ENSURE(pListener, "EndListeningCell: pListener Null"); SCTAB nTab = rAddress.Tab(); if (pTab[nTab]) pTab[nTab]->EndListening( rAddress, pListener ); @@ -209,7 +209,7 @@ void ScDocument::EndListeningCell( const ScAddress& rAddress, void ScDocument::PutInFormulaTree( ScFormulaCell* pCell ) { - DBG_ASSERT( pCell, "PutInFormulaTree: pCell Null" ); + OSL_ENSURE( pCell, "PutInFormulaTree: pCell Null" ); RemoveFromFormulaTree( pCell ); // anhaengen if ( pEOFormulaTree ) @@ -225,7 +225,7 @@ void ScDocument::PutInFormulaTree( ScFormulaCell* pCell ) void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) { - DBG_ASSERT( pCell, "RemoveFromFormulaTree: pCell Null" ); + OSL_ENSURE( pCell, "RemoveFromFormulaTree: pCell Null" ); ScFormulaCell* pPrev = pCell->GetPrevious(); // wenn die Zelle die erste oder sonstwo ist if ( pPrev || pFormulaTree == pCell ) @@ -246,13 +246,13 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* pCell ) nFormulaCodeInTree -= nRPN; else { - DBG_ERRORFILE( "RemoveFromFormulaTree: nFormulaCodeInTree < nRPN" ); + OSL_FAIL( "RemoveFromFormulaTree: nFormulaCodeInTree < nRPN" ); nFormulaCodeInTree = 0; } } else if ( !pFormulaTree && nFormulaCodeInTree ) { - DBG_ERRORFILE( "!pFormulaTree && nFormulaCodeInTree != 0" ); + OSL_FAIL( "!pFormulaTree && nFormulaCodeInTree != 0" ); nFormulaCodeInTree = 0; } } @@ -266,7 +266,7 @@ sal_Bool ScDocument::IsInFormulaTree( ScFormulaCell* pCell ) const void ScDocument::CalcFormulaTree( sal_Bool bOnlyForced, sal_Bool bNoProgress ) { - DBG_ASSERT( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" ); + OSL_ENSURE( !IsCalculatingFormulaTree(), "CalcFormulaTree recursion" ); // never ever recurse into this, might end up lost in infinity if ( IsCalculatingFormulaTree() ) return ; @@ -386,7 +386,7 @@ void ScDocument::ClearFormulaTree() void ScDocument::AppendToFormulaTrack( ScFormulaCell* pCell ) { - DBG_ASSERT( pCell, "AppendToFormulaTrack: pCell Null" ); + OSL_ENSURE( pCell, "AppendToFormulaTrack: pCell Null" ); // Zelle kann nicht in beiden Listen gleichzeitig sein RemoveFromFormulaTrack( pCell ); RemoveFromFormulaTree( pCell ); @@ -403,7 +403,7 @@ void ScDocument::AppendToFormulaTrack( ScFormulaCell* pCell ) void ScDocument::RemoveFromFormulaTrack( ScFormulaCell* pCell ) { - DBG_ASSERT( pCell, "RemoveFromFormulaTrack: pCell Null" ); + OSL_ENSURE( pCell, "RemoveFromFormulaTrack: pCell Null" ); ScFormulaCell* pPrev = pCell->GetPreviousTrack(); // wenn die Zelle die erste oder sonstwo ist if ( pPrev || pFormulaTrack == pCell ) @@ -482,7 +482,7 @@ void ScDocument::TrackFormulas( sal_uLong nHintId ) SetForcedFormulaPending( sal_True ); } } - DBG_ASSERT( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" ); + OSL_ENSURE( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" ); } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 955e1c9eb3a5..5919a3e2dfb5 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -185,7 +185,7 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter ) void ScDocument::SetPrintOptions() { if ( !pPrinter ) GetPrinter(); // setzt pPrinter - DBG_ASSERT( pPrinter, "Error in printer creation :-/" ); + OSL_ENSURE( pPrinter, "Error in printer creation :-/" ); if ( pPrinter ) { @@ -490,7 +490,7 @@ sal_Bool ScDocument::IdleCalcTextWidth() // sal_True = demnaechst wie pStyle = (ScStyleSheet*)pStylePool->Find( pTable->aPageStyle, SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyle, "Missing StyleSheet :-/" ); + OSL_ENSURE( pStyle, "Missing StyleSheet :-/" ); sal_Bool bProgress = false; if ( pStyle && 0 == GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALETOPAGES) ) @@ -1005,7 +1005,7 @@ void ScDocument::SetInLinkUpdate(sal_Bool bSet) { // called from TableLink and AreaLink - DBG_ASSERT( bInLinkUpdate != bSet, "SetInLinkUpdate twice" ); + OSL_ENSURE( bInLinkUpdate != bSet, "SetInLinkUpdate twice" ); bInLinkUpdate = bSet; } @@ -1302,7 +1302,7 @@ bool ScDocument::CreateDdeLink( const String& rAppl, const String& rTopic, const unwanted connections. First try to find existing link. Set result array on existing and new links. */ //! store DDE links additionally at document (for efficiency)? - DBG_ASSERT( nMode != SC_DDE_IGNOREMODE, "ScDocument::CreateDdeLink - SC_DDE_IGNOREMODE not allowed here" ); + OSL_ENSURE( nMode != SC_DDE_IGNOREMODE, "ScDocument::CreateDdeLink - SC_DDE_IGNOREMODE not allowed here" ); if( GetLinkManager() && (nMode != SC_DDE_IGNOREMODE) ) { ScDdeLink* pDdeLink = lclGetDdeLink( pLinkManager, rAppl, rTopic, rItem, nMode ); @@ -1552,7 +1552,7 @@ void lcl_TransliterateEditEngine( ScEditEngineDefaulter& rEngine, void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType ) { - DBG_ASSERT( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); + OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); utl::TransliterationWrapper aTranslitarationWrapper( xServiceManager, nType ); sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index b8ba53f22d4d..d893dc06d85b 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -312,7 +312,7 @@ sal_Bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkDat rRange.aEnd.Col(), rRange.aEnd.Row(), nTab ); SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -338,7 +338,7 @@ void ScDocument::StartAnimations( SCTAB nTab, Window* pWin ) if (!pDrawLayer) return; SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) return; @@ -370,7 +370,7 @@ sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) if (!pDrawLayer) return false; SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) return false; @@ -397,7 +397,7 @@ sal_Bool ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ) if (!pDrawLayer) return false; SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) return false; @@ -429,7 +429,7 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos ) if (pDrawLayer && pTab[nTab]) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -548,7 +548,7 @@ sal_Bool ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect ) if (pDrawLayer) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); @@ -575,7 +575,7 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle& if (pDrawLayer) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); @@ -611,7 +611,7 @@ sal_Bool ScDocument::HasDetectiveObjects(SCTAB nTab) const if (pDrawLayer) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 3734b806a41d..64ba9adf536f 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3152,7 +3152,7 @@ void ScDocument::CompileXML() STR_PROGRESS_CALCULATING ), GetXMLImportedFormulaCount() ); // set AutoNameCache to speed up automatic name lookup - DBG_ASSERT( !pAutoNameCache, "AutoNameCache already set" ); + OSL_ENSURE( !pAutoNameCache, "AutoNameCache already set" ); pAutoNameCache = new ScAutoNameCache( this ); for (SCTAB i=0; i<=MAXTAB; i++) @@ -4236,7 +4236,7 @@ ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, sal_ aRange.aEnd.Col(), aRange.aEnd.Row(), bDeep ); } - DBG_ASSERT( aState.pItemSet, "SelectionPattern Null" ); + OSL_ENSURE( aState.pItemSet, "SelectionPattern Null" ); if (aState.pItemSet) return new ScPatternAttr( aState.pItemSet ); else @@ -4390,7 +4390,7 @@ void ScDocument::FindMaxRotCol( SCTAB nTab, RowInfo* pRowInfo, SCSIZE nArrCount, pTab[nTab]->FindMaxRotCol( pRowInfo, nArrCount, nX1, nX2 ); else { - DBG_ERRORFILE("FindMaxRotCol: falsche Tabelle"); + OSL_FAIL("FindMaxRotCol: falsche Tabelle"); } } @@ -4401,7 +4401,7 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, //! Seitengrenzen fuer Druck beruecksichtigen !!!!! const SvxBoxItem* pThisAttr = (const SvxBoxItem*) GetEffItem( nCol, nRow, nTab, ATTR_BORDER ); - DBG_ASSERT(pThisAttr,"wo ist das Attribut?"); + OSL_ENSURE(pThisAttr,"wo ist das Attribut?"); const SvxBorderLine* pLeftLine = pThisAttr->GetLeft(); const SvxBorderLine* pTopLine = pThisAttr->GetTop(); @@ -4648,7 +4648,7 @@ sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, SCROW nAttrPos = nOldRow; while (nAttrPos<=nEndRow) { - DBG_ASSERT( nIndex < pAttrArray->nCount, "Falscher Index im AttrArray" ); + OSL_ENSURE( nIndex < pAttrArray->nCount, "Falscher Index im AttrArray" ); if (((ScMergeFlagAttr&)pAttrArray->pData[nIndex].pPattern-> GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped()) @@ -5060,7 +5060,7 @@ void ScDocument::FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY, sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark ) { - DBG_ASSERT( !nMovX || !nMovY, "GetNextPos: nur X oder Y" ); + OSL_ENSURE( !nMovX || !nMovY, "GetNextPos: nur X oder Y" ); ScMarkData aCopyMark = rMark; aCopyMark.SetMarking(false); diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index 03a176c65f2f..537f08c01dfd 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp> #include <svl/zforlist.hxx> -#include <tools/debug.hxx> #include <rtl/math.hxx> #include <algorithm> @@ -377,7 +376,7 @@ bool ScDPDimensionSaveData::operator==( const ScDPDimensionSaveData& ) const void ScDPDimensionSaveData::AddGroupDimension( const ScDPSaveGroupDimension& rGroupDim ) { - DBG_ASSERT( ::std::find_if( maGroupDims.begin(), maGroupDims.end(), ScDPSaveGroupDimNameFunc( rGroupDim.GetGroupDimName() ) ) == maGroupDims.end(), + OSL_ENSURE( ::std::find_if( maGroupDims.begin(), maGroupDims.end(), ScDPSaveGroupDimNameFunc( rGroupDim.GetGroupDimName() ) ) == maGroupDims.end(), "ScDPDimensionSaveData::AddGroupDimension - group dimension exists already" ); // ReplaceGroupDimension() adds new or replaces existing ReplaceGroupDimension( rGroupDim ); @@ -403,7 +402,7 @@ void ScDPDimensionSaveData::RemoveGroupDimension( const String& rGroupDimName ) void ScDPDimensionSaveData::AddNumGroupDimension( const ScDPSaveNumGroupDimension& rGroupDim ) { - DBG_ASSERT( maNumGroupDims.count( rGroupDim.GetDimensionName() ) == 0, + OSL_ENSURE( maNumGroupDims.count( rGroupDim.GetDimensionName() ) == 0, "ScDPDimensionSaveData::AddNumGroupDimension - numeric group dimension exists already" ); // ReplaceNumGroupDimension() adds new or replaces existing ReplaceNumGroupDimension( rGroupDim ); @@ -577,7 +576,7 @@ String ScDPDimensionSaveData::CreateDateGroupDimName( sal_Int32 nDatePart, const case QUARTERS: aPartName = String::CreateFromAscii( "Quarters" ); break; case YEARS: aPartName = String::CreateFromAscii( "Years" ); break; } - DBG_ASSERT( aPartName.Len() > 0, "ScDPDimensionSaveData::CreateDateGroupDimName - invalid date part" ); + OSL_ENSURE( aPartName.Len() > 0, "ScDPDimensionSaveData::CreateDateGroupDimName - invalid date part" ); return CreateGroupDimName( aPartName, rObject, bAllowSource, pDeletedNames ); } diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index ab2094707a86..6df1db32f290 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -35,7 +35,6 @@ #include <com/sun/star/i18n/CalendarDisplayIndex.hpp> -#include <tools/debug.hxx> #include <rtl/math.hxx> #include <unotools/localedatawrapper.hxx> #include <svl/zforlist.hxx> @@ -164,7 +163,7 @@ namespace String lcl_GetNumGroupName( double fStartValue, const ScDPNumGroupInfo& rInfo, bool bHasNonInteger, sal_Unicode cDecSeparator, SvNumberFormatter* pFormatter ) { - DBG_ASSERT( cDecSeparator != 0, "cDecSeparator not initialized" ); + OSL_ENSURE( cDecSeparator != 0, "cDecSeparator not initialized" ); double fStep = rInfo.Step; double fEndValue = fStartValue + fStep; @@ -208,7 +207,7 @@ namespace String lcl_GetSpecialNumGroupName( double fValue, bool bFirst, sal_Unicode cDecSeparator, bool bDateValues, SvNumberFormatter* pFormatter ) { - DBG_ASSERT( cDecSeparator != 0, "cDecSeparator not initialized" ); + OSL_ENSURE( cDecSeparator != 0, "cDecSeparator not initialized" ); rtl::OUStringBuffer aBuffer; aBuffer.append((sal_Unicode)( bFirst ? '<' : '>' )); @@ -1013,7 +1012,7 @@ ScDPGroupTableData::ScDPGroupTableData( const shared_ptr<ScDPTableData>& pSource pSourceData( pSource ), pDoc( pDocument ) { - DBG_ASSERT( pSource, "ScDPGroupTableData: pSource can't be NULL" ); + OSL_ENSURE( pSource, "ScDPGroupTableData: pSource can't be NULL" ); CreateCacheTable(); nSourceCount = pSource->GetColumnCount(); // real columns, excluding data layout diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 0c919515d074..8401b264f920 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -456,7 +456,7 @@ void ScDPObject::CreateObjects() { //! cache DPSource and/or Output? - DBG_ASSERT( bAlive, "CreateObjects on non-inserted DPObject" ); + OSL_ENSURE( bAlive, "CreateObjects on non-inserted DPObject" ); DELETEZ( pOutput ); // not valid when xSource is changed @@ -467,7 +467,7 @@ void ScDPObject::CreateObjects() if ( !xSource.is() ) // database or sheet data, or error in CreateSource { - DBG_ASSERT( !pServDesc, "DPSource could not be created" ); + OSL_ENSURE( !pServDesc, "DPSource could not be created" ); ScDPTableData* pData = GetTableData(); if (pData) { @@ -922,7 +922,7 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) //! convert field index to dimension index? - DBG_ASSERT( xSource.is(), "no source" ); + OSL_ENSURE( xSource.is(), "no source" ); if ( !xSource.is() ) return; uno::Reference<container::XNamed> xDim; @@ -935,7 +935,7 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) xIntDims->getByIndex(nField) ); xDim = uno::Reference<container::XNamed>( xIntDim, uno::UNO_QUERY ); } - DBG_ASSERT( xDim.is(), "dimension not found" ); + OSL_ENSURE( xDim.is(), "dimension not found" ); if ( !xDim.is() ) return; uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY ); @@ -955,7 +955,7 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) uno::Reference<uno::XInterface> xHier; if ( nHierarchy < nHierCount ) xHier = ScUnoHelpFunctions::AnyToInterface( xHiers->getByIndex(nHierarchy) ); - DBG_ASSERT( xHier.is(), "hierarchy not found" ); + OSL_ENSURE( xHier.is(), "hierarchy not found" ); if ( !xHier.is() ) return; long nLevCount = 0; @@ -970,14 +970,14 @@ void ScDPObject::FillPageList( TypedScStrCollection& rStrings, long nField ) uno::Reference<uno::XInterface> xLevel; if ( nLevel < nLevCount ) xLevel = ScUnoHelpFunctions::AnyToInterface( xLevels->getByIndex(nLevel) ); - DBG_ASSERT( xLevel.is(), "level not found" ); + OSL_ENSURE( xLevel.is(), "level not found" ); if ( !xLevel.is() ) return; uno::Reference<container::XNameAccess> xMembers; uno::Reference<sheet::XMembersSupplier> xMbrSupp( xLevel, uno::UNO_QUERY ); if ( xMbrSupp.is() ) xMembers = xMbrSupp->getMembers(); - DBG_ASSERT( xMembers.is(), "members not found" ); + OSL_ENSURE( xMembers.is(), "members not found" ); if ( !xMembers.is() ) return; uno::Sequence<rtl::OUString> aNames = xMembers->getElementNames(); @@ -1372,7 +1372,7 @@ sal_Bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, SCSIZE nDataFields = aDataNames.size(); SCSIZE nFieldCount = aFieldNames.size(); - DBG_ASSERT( aGivenNames.size() == nDataFields && aFieldValues.size() == nFieldCount, "wrong count" ); + OSL_ENSURE( aGivenNames.size() == nDataFields && aFieldValues.size() == nFieldCount, "wrong count" ); bool bError = false; bool bHasData = false; @@ -1517,7 +1517,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb xIntDims->getByIndex(rElemDesc.Dimension) ); xDim = uno::Reference<container::XNamed>( xIntDim, uno::UNO_QUERY ); } - DBG_ASSERT( xDim.is(), "dimension not found" ); + OSL_ENSURE( xDim.is(), "dimension not found" ); if ( !xDim.is() ) return; String aDimName = xDim->getName(); @@ -1545,7 +1545,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb uno::Reference<uno::XInterface> xHier; if ( rElemDesc.Hierarchy < nHierCount ) xHier = ScUnoHelpFunctions::AnyToInterface( xHiers->getByIndex(rElemDesc.Hierarchy) ); - DBG_ASSERT( xHier.is(), "hierarchy not found" ); + OSL_ENSURE( xHier.is(), "hierarchy not found" ); if ( !xHier.is() ) return; long nLevCount = 0; @@ -1560,7 +1560,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb uno::Reference<uno::XInterface> xLevel; if ( rElemDesc.Level < nLevCount ) xLevel = ScUnoHelpFunctions::AnyToInterface( xLevels->getByIndex(rElemDesc.Level) ); - DBG_ASSERT( xLevel.is(), "level not found" ); + OSL_ENSURE( xLevel.is(), "level not found" ); if ( !xLevel.is() ) return; uno::Reference<container::XNameAccess> xMembers; @@ -1588,14 +1588,14 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb } } - DBG_ASSERT( bFound, "member not found" ); + OSL_ENSURE( bFound, "member not found" ); (void)bFound; //! use Hierarchy and Level in SaveData !!!! // modify pDestObj if set, this object otherwise ScDPSaveData* pModifyData = pDestObj ? ( pDestObj->pSaveData ) : pSaveData; - DBG_ASSERT( pModifyData, "no data?" ); + OSL_ENSURE( pModifyData, "no data?" ); if ( pModifyData ) { const String aName = rElemDesc.MemberName; @@ -2146,7 +2146,7 @@ void ScDPObject::ConvertOrientation( vector<PivotField>* pRefColFields, vector<PivotField>* pRefRowFields, vector<PivotField>* pRefPageFields ) { // xSource must be set - DBG_ASSERT( xSource.is(), "missing string source" ); + OSL_ENSURE( xSource.is(), "missing string source" ); vector<PivotField>::const_iterator itr, itrBeg = rFields.begin(), itrEnd = rFields.end(); for (itr = itrBeg; itr != itrEnd; ++itr) @@ -2476,7 +2476,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache(sal_Int32 nSdbType, const OU rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_ROWSET )) ), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xRowProp( xRowSet, uno::UNO_QUERY ); - DBG_ASSERT( xRowProp.is(), "can't get RowSet" ); + OSL_ENSURE( xRowProp.is(), "can't get RowSet" ); if ( xRowProp.is() ) { // @@ -2623,7 +2623,7 @@ void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const // Matching objects are found by their names. size_t nSrcSize = maTables.size(); size_t nDestSize = r.maTables.size(); - DBG_ASSERT( nSrcSize >= nDestSize, "WriteRefsTo: missing entries in document" ); + OSL_ENSURE( nSrcSize >= nDestSize, "WriteRefsTo: missing entries in document" ); for (size_t nSrcPos = 0; nSrcPos < nSrcSize; ++nSrcPos) { const ScDPObject& rSrcObj = maTables[nSrcPos]; @@ -2648,7 +2648,7 @@ void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const r.InsertNewTable(pDestObj); } } - DBG_ASSERT( maTables.size() == r.maTables.size(), "WriteRefsTo: couldn't restore all entries" ); + OSL_ENSURE( maTables.size() == r.maTables.size(), "WriteRefsTo: couldn't restore all entries" ); } } diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 8351c2f3dd28..e52fbed66432 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -677,7 +677,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS if (bRowFieldHasMember) mbHasDataLayout = true; - DBG_ASSERT( nLevCount == 1, "data layout: multiple levels?" ); + OSL_ENSURE( nLevCount == 1, "data layout: multiple levels?" ); if ( eDimOrient == sheet::DataPilotFieldOrientation_COLUMN ) lcl_FillNumberFormats( pColNumFmt, nColFmtCount, xLevRes, xDims ); else if ( eDimOrient == sheet::DataPilotFieldOrientation_ROW ) @@ -760,7 +760,7 @@ void ScDPOutput::DataCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::Data // use number formats from source - DBG_ASSERT( bSizesValid, "DataCell: !bSizesValid" ); + OSL_ENSURE( bSizesValid, "DataCell: !bSizesValid" ); sal_uInt32 nFormat = 0; if ( pColNumFmt ) { @@ -971,7 +971,7 @@ void ScDPOutput::Output() SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow const sheet::DataResult* pColAry = pRowAry[nRow].getConstArray(); long nThisColCount = pRowAry[nRow].getLength(); - DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? + OSL_ENSURE( nThisColCount == nColCount, "count mismatch" ); //! ??? for (long nCol=0; nCol<nThisColCount; nCol++) { SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow @@ -1032,7 +1032,7 @@ void ScDPOutput::Output() const uno::Sequence<sheet::MemberResult> rSequence = pColFields[nField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); long nThisColCount = rSequence.getLength(); - DBG_ASSERT( nThisColCount == nColCount, "count mismatch" ); //! ??? + OSL_ENSURE( nThisColCount == nColCount, "count mismatch" ); //! ??? for (long nCol=0; nCol<nThisColCount; nCol++) { SCCOL nColPos = nDataStartCol + (SCCOL)nCol; //! check for overflow @@ -1083,7 +1083,7 @@ void ScDPOutput::Output() const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); long nThisRowCount = rSequence.getLength(); - DBG_ASSERT( nThisRowCount == nRowCount, "count mismatch" ); //! ??? + OSL_ENSURE( nThisRowCount == nRowCount, "count mismatch" ); //! ??? for (long nRow=0; nRow<nThisRowCount; nRow++) { SCROW nRowPos = nDataStartRow + (SCROW)nRow; //! check for overflow @@ -1135,7 +1135,7 @@ ScRange ScDPOutput::GetOutputRange( sal_Int32 nRegionType ) case DataPilotOutputRangeType::TABLE: return ScRange(aStartPos.Col(), nTabStartRow, nTab, nTabEndCol, nTabEndRow, nTab); default: - DBG_ASSERT(nRegionType == DataPilotOutputRangeType::WHOLE, "ScDPOutput::GetOutputRange: unknown region type"); + OSL_ENSURE(nRegionType == DataPilotOutputRangeType::WHOLE, "ScDPOutput::GetOutputRange: unknown region type"); break; } return ScRange(aStartPos.Col(), aStartPos.Row(), nTab, nTabEndCol, nTabEndRow, nTab); @@ -1437,7 +1437,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>& const uno::Sequence<sheet::MemberResult> rSequence = pColFields[nColField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); - DBG_ASSERT(nDataStartCol + rSequence.getLength() - 1 == nTabEndCol, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); + OSL_ENSURE(nDataStartCol + rSequence.getLength() - 1 == nTabEndCol, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); long nItem = nCol - nDataStartCol; // get origin of "continue" fields @@ -1461,7 +1461,7 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>& const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nRowField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); - DBG_ASSERT(nDataStartRow + rSequence.getLength() - 1 == nTabEndRow, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); + OSL_ENSURE(nDataStartRow + rSequence.getLength() - 1 == nTabEndRow, "ScDPOutput::GetDataFieldCellData: error in geometric assumption"); long nItem = nRow - nDataStartRow; // get origin of "continue" fields @@ -1538,7 +1538,7 @@ uno::Sequence<sheet::GeneralFunction> lcl_GetSubTotals( xIntDims->getByIndex( rField.nDim ) ); xHierSupp = uno::Reference<sheet::XHierarchiesSupplier>( xIntDim, uno::UNO_QUERY ); } - DBG_ASSERT( xHierSupp.is(), "dimension not found" ); + OSL_ENSURE( xHierSupp.is(), "dimension not found" ); sal_Int32 nHierCount = 0; uno::Reference<container::XIndexAccess> xHiers; @@ -1551,7 +1551,7 @@ uno::Sequence<sheet::GeneralFunction> lcl_GetSubTotals( uno::Reference<uno::XInterface> xHier; if ( rField.nHier < nHierCount ) xHier = ScUnoHelpFunctions::AnyToInterface( xHiers->getByIndex( rField.nHier ) ); - DBG_ASSERT( xHier.is(), "hierarchy not found" ); + OSL_ENSURE( xHier.is(), "hierarchy not found" ); sal_Int32 nLevCount = 0; uno::Reference<container::XIndexAccess> xLevels; @@ -1565,7 +1565,7 @@ uno::Sequence<sheet::GeneralFunction> lcl_GetSubTotals( uno::Reference<uno::XInterface> xLevel; if ( rField.nLevel < nLevCount ) xLevel = ScUnoHelpFunctions::AnyToInterface( xLevels->getByIndex( rField.nLevel ) ); - DBG_ASSERT( xLevel.is(), "level not found" ); + OSL_ENSURE( xLevel.is(), "level not found" ); uno::Reference<beans::XPropertySet> xLevelProp( xLevel, uno::UNO_QUERY ); if ( xLevelProp.is() ) @@ -1594,7 +1594,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 { // returns true if a filter was given for the field - DBG_ASSERT( rFilters.size() == rFilterUsed.size(), "wrong size" ); + OSL_ENSURE( rFilters.size() == rFilterUsed.size(), "wrong size" ); const bool bIsDataLayout = ( rField.nDim == nDataLayoutIndex ); if (bIsDataLayout) @@ -1626,7 +1626,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 const sheet::MemberResult* pArray = rSequence.getConstArray(); sal_Int32 nSize = rSequence.getLength(); - DBG_ASSERT( (sal_Int32)rResult.size() == nSize, "Number of fields do not match result count" ); + OSL_ENSURE( (sal_Int32)rResult.size() == nSize, "Number of fields do not match result count" ); sal_Int32 nContCount = 0; sal_Int32 nSubTotalCount = 0; @@ -1656,7 +1656,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 { // grand total is always automatic sal_Int32 nDataPos = j - ( nSize - nGrandTotals ); - DBG_ASSERT( nDataPos < (sal_Int32)rDataNames.size(), "wrong data count" ); + OSL_ENSURE( nDataPos < (sal_Int32)rDataNames.size(), "wrong data count" ); String aSourceName( rDataNames[nDataPos] ); // vector contains source names String aGivenName( rGivenNames[nDataPos] ); @@ -1667,7 +1667,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 // treat "grand total" columns/rows as empty description, as if they were marked // in a previous field - DBG_ASSERT( ( aResultEntry.Flags & + OSL_ENSURE( ( aResultEntry.Flags & ( sheet::MemberResultFlags::HASMEMBER | sheet::MemberResultFlags::SUBTOTAL ) ) == 0 || ( aResultEntry.Flags & ( sheet::MemberResultFlags::HASMEMBER | sheet::MemberResultFlags::SUBTOTAL ) ) == @@ -1696,7 +1696,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 String aSourceName( rDataNames[nDataPos] ); // vector contains source names String aGivenName( rGivenNames[nDataPos] ); - DBG_ASSERT( nFuncPos < aSubTotals.getLength(), "wrong subtotal count" ); + OSL_ENSURE( nFuncPos < aSubTotals.getLength(), "wrong subtotal count" ); rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, aGivenName ) && aSubTotals[nFuncPos] == aFilter.meFunction; } @@ -1704,7 +1704,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 { // manual subtotals for a single data field - DBG_ASSERT( nSubTotalCount < aSubTotals.getLength(), "wrong subtotal count" ); + OSL_ENSURE( nSubTotalCount < aSubTotals.getLength(), "wrong subtotal count" ); rResult[j] = ( aSubTotals[nSubTotalCount] == aFilter.meFunction ); } } @@ -1712,7 +1712,7 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 { if ( rBeforeDataLayout ) { - DBG_ASSERT( nSubTotalCount < (sal_Int32)rDataNames.size(), "wrong data count" ); + OSL_ENSURE( nSubTotalCount < (sal_Int32)rDataNames.size(), "wrong data count" ); String aSourceName( rDataNames[nSubTotalCount] ); // vector contains source names String aGivenName( rGivenNames[nSubTotalCount] ); @@ -1766,14 +1766,14 @@ void lcl_FilterInclude( std::vector< sal_Bool >& rResult, std::vector< sal_Int32 void lcl_StripSubTotals( std::vector< sal_Bool >& rResult, const std::vector< sal_Int32 >& rSubtotal ) { sal_Int32 nSize = rResult.size(); - DBG_ASSERT( (sal_Int32)rSubtotal.size() == nSize, "sizes don't match" ); + OSL_ENSURE( (sal_Int32)rSubtotal.size() == nSize, "sizes don't match" ); for (sal_Int32 nPos=0; nPos<nSize; nPos++) if ( rResult[nPos] && rSubtotal[nPos] ) { // if a subtotal is included, clear the result flag for the columns/rows that the subtotal includes sal_Int32 nStart = nPos - rSubtotal[nPos]; - DBG_ASSERT( nStart >= 0, "invalid subtotal count" ); + OSL_ENSURE( nStart >= 0, "invalid subtotal count" ); for (sal_Int32 nPrev = nStart; nPrev < nPos; nPrev++) rResult[nPrev] = false; @@ -1800,7 +1800,7 @@ String lcl_GetDataFieldName( const String& rSourceName, sheet::GeneralFunction e case sheet::GeneralFunction_AUTO: default: { - DBG_ERRORFILE("wrong function"); + OSL_FAIL("wrong function"); } } if ( !nStrId ) @@ -1857,7 +1857,7 @@ sal_Bool ScDPOutput::GetPivotData( ScDPGetPivotDataField& rTarget, { // no data layout field -> single data field -> must match the selected field in rTarget - DBG_ASSERT( aDataNames.size() == 1, "several data fields but no data layout field" ); + OSL_ENSURE( aDataNames.size() == 1, "several data fields but no data layout field" ); if ( !lcl_IsNamedDataField( rTarget, aDataNames[0], aGivenNames[0] ) ) return false; } diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 85316828d15f..e938ebcf3b92 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -39,7 +39,6 @@ #include "global.hxx" #include <sal/types.h> -#include <tools/debug.hxx> #include <com/sun/star/sheet/GeneralFunction.hpp> #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp> @@ -162,7 +161,7 @@ void ScDPSaveMember::RemoveLayoutName() void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMember, sal_Int32 nPosition ) { uno::Reference<beans::XPropertySet> xMembProp( xMember, uno::UNO_QUERY ); - DBG_ASSERT( xMembProp.is(), "no properties at member" ); + OSL_ENSURE( xMembProp.is(), "no properties at member" ); if ( xMembProp.is() ) { // exceptions are caught at ScDPSaveData::WriteToSource @@ -550,7 +549,7 @@ void ScDPSaveDimension::SetMemberPosition( const ::rtl::OUString& rName, sal_Int void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xDim ) { uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY ); - DBG_ASSERT( xDimProp.is(), "no properties at dimension" ); + OSL_ENSURE( xDimProp.is(), "no properties at dimension" ); if ( xDimProp.is() ) { // exceptions are caught at ScDPSaveData::WriteToSource @@ -632,7 +631,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD { uno::Reference<uno::XInterface> xLevel = ScUnoHelpFunctions::AnyToInterface( xLevels->getByIndex(nLev) ); uno::Reference<beans::XPropertySet> xLevProp( xLevel, uno::UNO_QUERY ); - DBG_ASSERT( xLevProp.is(), "no properties at level" ); + OSL_ENSURE( xLevProp.is(), "no properties at level" ); if ( xLevProp.is() ) { uno::Any aAny; @@ -1042,7 +1041,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie // source options must be first! uno::Reference<beans::XPropertySet> xSourceProp( xSource, uno::UNO_QUERY ); - DBG_ASSERT( xSourceProp.is(), "no properties at source" ); + OSL_ENSURE( xSourceProp.is(), "no properties at source" ); if ( xSourceProp.is() ) { // source options are not available for external sources @@ -1073,7 +1072,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie // reset all orientations //! "forgetSettings" or similar at source ????? //! reset all duplicated dimensions, or reuse them below !!! - OSL_TRACE( "ScDPSaveData::WriteToSource" ); + OSL_FAIL( "ScDPSaveData::WriteToSource" ); lcl_ResetOrient( xSource ); @@ -1123,7 +1122,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie aBuf.append(sal_Unicode('*')); //! modify name at creation of SaveDimension uno::Reference<util::XCloneable> xCloneable( xIntDim, uno::UNO_QUERY ); - DBG_ASSERT( xCloneable.is(), "cannot clone dimension" ); + OSL_ENSURE( xCloneable.is(), "cannot clone dimension" ); if (xCloneable.is()) { uno::Reference<util::XCloneable> xNew = xCloneable->createClone(); @@ -1139,7 +1138,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie iter->WriteToSource( xIntDim ); } } - DBG_ASSERT(bFound, "WriteToSource: Dimension not found"); + OSL_ENSURE(bFound, "WriteToSource: Dimension not found"); } if ( xSourceProp.is() ) @@ -1271,7 +1270,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS { deletedDims.push_back( aName ); iter = aDimList.erase(iter); - OSL_TRACE( "\n Remove dim: \t" ); + OSL_FAIL( "\n Remove dim: \t" ); OSL_TRACE( "%s", aName.getStr() ); } @@ -1328,16 +1327,16 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< switch( pReferenceValue->ReferenceType) { case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE: //both - OSL_TRACE( "\n sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE \n" ); + OSL_FAIL( "\n sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE \n" ); break; case sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE: //both - OSL_TRACE( "\n sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE \n" ); + OSL_FAIL( "\n sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE \n" ); break; case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE: //both - OSL_TRACE( "\n sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE \n" ); + OSL_FAIL( "\n sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE \n" ); break; case sheet::DataPilotFieldReferenceType::RUNNING_TOTAL: - OSL_TRACE( "\n sheet::DataPilotFieldReferenceType::RUNNING_TOTAL \n" ); //enable name + OSL_FAIL( "\n sheet::DataPilotFieldReferenceType::RUNNING_TOTAL \n" ); //enable name break; } #endif @@ -1379,7 +1378,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference< { //check sortinfo if ( pSortInfo->Mode == DataPilotFieldSortMode::DATA ) { - OSL_TRACE( "\n DataPilotFieldSortMode::DATA \n" ); + OSL_FAIL( "\n DataPilotFieldSortMode::DATA \n" ); const ::rtl::OUString& sFieldDimName = pSortInfo->Field; std::list<rtl::OUString>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName ); if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 ) diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index cfad761377bc..b65bb472dd21 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -33,7 +33,6 @@ // INCLUDE -------------------------------------------------------------- -#include <tools/debug.hxx> #include <svl/zforlist.hxx> #include "dpshttab.hxx" diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index cca9ead058fb..b8a5cf395c4a 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -35,7 +35,6 @@ #include <stdio.h> #include <rtl/math.hxx> -#include <tools/debug.hxx> #include <tools/date.hxx> #include <unotools/transliterationwrapper.hxx> #include <unotools/collatorwrapper.hxx> diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 35782e05bab7..b39c898b7e93 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -567,8 +567,8 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const sal_uLong ScDPCache::GetDimNumType( SCCOL nDim) const { - DBG_ASSERT( IsValid(), " IsValid() == false " ); - DBG_ASSERT( nDim < mnColumnCount && nDim >=0, " dimention out of bound " ); + OSL_ENSURE( IsValid(), " IsValid() == false " ); + OSL_ENSURE( nDim < mnColumnCount && nDim >=0, " dimention out of bound " ); if ( maTableDataValues[nDim].size()==0 ) return NUMBERFORMAT_UNDEFINED; else @@ -736,7 +736,7 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, bool *pSpeci bOk = (nCompare >= 0); break; case SC_NOT_EQUAL: - DBG_ASSERT( false , "SC_NOT_EQUAL"); + OSL_FAIL("SC_NOT_EQUAL"); break; case SC_TOPVAL: case SC_BOTVAL: @@ -799,8 +799,8 @@ bool ScDPCache::IsEmptyMember( SCROW nRow, sal_uInt16 nColumn ) const bool ScDPCache::AddData(long nDim, ScDPItemData* pData) { - DBG_ASSERT( IsValid(), " IsValid() == false " ); - DBG_ASSERT( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" ); + OSL_ENSURE( IsValid(), " IsValid() == false " ); + OSL_ENSURE( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" ); // Wrap this instance with scoped pointer to ensure proper deletion. auto_ptr<ScDPItemData> p(pData); @@ -812,7 +812,7 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pData) // This item doesn't exist in the dimension array yet. maTableDataValues[nDim].push_back(p); maGlobalOrder[nDim].insert( maGlobalOrder[nDim].begin()+nIndex, maTableDataValues[nDim].size()-1 ); - DBG_ASSERT( (size_t) maGlobalOrder[nDim][nIndex] == maTableDataValues[nDim].size()-1 ,"ScDPTableDataCache::AddData "); + OSL_ENSURE( (size_t) maGlobalOrder[nDim][nIndex] == maTableDataValues[nDim].size()-1 ,"ScDPTableDataCache::AddData "); maSourceData[nDim].push_back( maTableDataValues[nDim].size()-1 ); } else @@ -832,8 +832,8 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pData) String ScDPCache::GetDimensionName( sal_uInt16 nColumn ) const { - DBG_ASSERT(nColumn < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); - DBG_ASSERT(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); + OSL_ENSURE(nColumn < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName"); + OSL_ENSURE(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName"); if ( static_cast<size_t>(nColumn+1) < maLabelNames.size() ) { @@ -845,7 +845,7 @@ String ScDPCache::GetDimensionName( sal_uInt16 nColumn ) const void ScDPCache::AddLabel(ScDPItemData *pData) { - DBG_ASSERT( IsValid(), " IsValid() == false " ); + OSL_ENSURE( IsValid(), " IsValid() == false " ); if ( maLabelNames.size() == 0 ) maLabelNames.push_back( new ScDPItemData(ScGlobal::GetRscString(STR_PIVOT_DATA)) ); @@ -876,8 +876,8 @@ void ScDPCache::AddLabel(ScDPItemData *pData) SCROW ScDPCache::GetItemDataId(sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const { - DBG_ASSERT( IsValid(), " IsValid() == false " ); - DBG_ASSERT( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " ); + OSL_ENSURE( IsValid(), " IsValid() == false " ); + OSL_ENSURE( /* nDim >= 0 && */ nDim < mnColumnCount, "ScDPTableDataCache::GetItemDataId " ); if ( bRepeatIfEmpty ) { @@ -909,15 +909,15 @@ SCROW ScDPCache::GetRowCount() const const ScDPCache::DataListType& ScDPCache::GetDimMemberValues(SCCOL nDim) const { - DBG_ASSERT( nDim>=0 && nDim < mnColumnCount ," nDim < mnColumnCount "); + OSL_ENSURE( nDim>=0 && nDim < mnColumnCount ," nDim < mnColumnCount "); return maTableDataValues[nDim]; } SCROW ScDPCache::GetSortedItemDataId(SCCOL nDim, SCROW nOrder) const { - DBG_ASSERT ( IsValid(), "IsValid"); - DBG_ASSERT( nDim>=0 && nDim < mnColumnCount, "nDim < mnColumnCount"); - DBG_ASSERT( nOrder >= 0 && (size_t) nOrder < maGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" ); + OSL_ENSURE ( IsValid(), "IsValid"); + OSL_ENSURE( nDim>=0 && nDim < mnColumnCount, "nDim < mnColumnCount"); + OSL_ENSURE( nOrder >= 0 && (size_t) nOrder < maGlobalOrder[nDim].size(), "nOrder < mpGlobalOrder[nDim].size()" ); return maGlobalOrder[nDim][nOrder]; } @@ -970,7 +970,7 @@ bool ScDPCache::IsDateDimension( long nDim ) const SCROW ScDPCache::GetDimMemberCount( SCCOL nDim ) const { - DBG_ASSERT( nDim>=0 && nDim < mnColumnCount ," ScDPTableDataCache::GetDimMemberCount : out of bound "); + OSL_ENSURE( nDim>=0 && nDim < mnColumnCount ," ScDPTableDataCache::GetDimMemberCount : out of bound "); return maTableDataValues[nDim].size(); } @@ -1032,8 +1032,8 @@ SCROW ScDPCache::GetAdditionalItemID( const ScDPItemData& rData ) const SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const { - DBG_ASSERT( IsValid(), " IsValid() == false " ); - DBG_ASSERT( nDim >=0 && nDim < mnColumnCount, "ScDPTableDataCache::GetOrder : out of bound" ); + OSL_ENSURE( IsValid(), " IsValid() == false " ); + OSL_ENSURE( nDim >=0 && nDim < mnColumnCount, "ScDPTableDataCache::GetOrder : out of bound" ); if ( maIndexOrder[nDim].size() != maGlobalOrder[nDim].size() ) { //not inited @@ -1046,7 +1046,7 @@ SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const } } - DBG_ASSERT( nIndex>=0 && (size_t)nIndex < maIndexOrder[nDim].size() , "ScDPTableDataCache::GetOrder"); + OSL_ENSURE( nIndex>=0 && (size_t)nIndex < maIndexOrder[nDim].size() , "ScDPTableDataCache::GetOrder"); return maIndexOrder[nDim][nIndex]; } diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 708b8f9519a4..f6e3dc343718 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -33,7 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> #include <osl/diagnose.h> #include <rtl/math.hxx> @@ -271,7 +270,7 @@ ScDPInitState::~ScDPInitState() void ScDPInitState::AddMember( long nSourceIndex, SCROW nMember ) { - DBG_ASSERT( nCount < SC_DAPI_MAXFIELDS, "too many InitState members" ); + OSL_ENSURE( nCount < SC_DAPI_MAXFIELDS, "too many InitState members" ); if ( nCount < SC_DAPI_MAXFIELDS ) { pIndex[nCount] = nSourceIndex; @@ -282,7 +281,7 @@ void ScDPInitState::AddMember( long nSourceIndex, SCROW nMember ) void ScDPInitState::RemoveMember() { - DBG_ASSERT( nCount > 0, "RemoveColIndex without index" ); + OSL_ENSURE( nCount > 0, "RemoveColIndex without index" ); if ( nCount > 0 ) --nCount; } @@ -357,7 +356,7 @@ ScDPRunningTotalState::~ScDPRunningTotalState() void ScDPRunningTotalState::AddColIndex( long nVisible, long nSorted ) { - DBG_ASSERT( nColIndexPos < SC_DAPI_MAXFIELDS, "too many column indexes" ); + OSL_ENSURE( nColIndexPos < SC_DAPI_MAXFIELDS, "too many column indexes" ); if ( nColIndexPos < SC_DAPI_MAXFIELDS ) { pColVisible[nColIndexPos] = nVisible; @@ -370,7 +369,7 @@ void ScDPRunningTotalState::AddColIndex( long nVisible, long nSorted ) void ScDPRunningTotalState::AddRowIndex( long nVisible, long nSorted ) { - DBG_ASSERT( nRowIndexPos < SC_DAPI_MAXFIELDS, "too many row indexes" ); + OSL_ENSURE( nRowIndexPos < SC_DAPI_MAXFIELDS, "too many row indexes" ); if ( nRowIndexPos < SC_DAPI_MAXFIELDS ) { pRowVisible[nRowIndexPos] = nVisible; @@ -383,7 +382,7 @@ void ScDPRunningTotalState::AddRowIndex( long nVisible, long nSorted ) void ScDPRunningTotalState::RemoveColIndex() { - DBG_ASSERT( nColIndexPos > 0, "RemoveColIndex without index" ); + OSL_ENSURE( nColIndexPos > 0, "RemoveColIndex without index" ); if ( nColIndexPos > 0 ) { --nColIndexPos; @@ -394,7 +393,7 @@ void ScDPRunningTotalState::RemoveColIndex() void ScDPRunningTotalState::RemoveRowIndex() { - DBG_ASSERT( nRowIndexPos > 0, "RemoveRowIndex without index" ); + OSL_ENSURE( nRowIndexPos > 0, "RemoveRowIndex without index" ); if ( nRowIndexPos > 0 ) { --nRowIndexPos; @@ -611,42 +610,42 @@ sal_Bool ScDPAggData::IsCalculated() const double ScDPAggData::GetResult() const { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); return fVal; // use calculated value } sal_Bool ScDPAggData::HasError() const { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); return ( nCount == SC_DPAGG_RESULT_ERROR ); } sal_Bool ScDPAggData::HasData() const { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); return ( nCount != SC_DPAGG_RESULT_EMPTY ); // values or error } void ScDPAggData::SetResult( double fNew ) { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); fVal = fNew; // don't reset error flag } void ScDPAggData::SetError() { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); nCount = SC_DPAGG_RESULT_ERROR; } void ScDPAggData::SetEmpty( sal_Bool bSet ) { - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); if ( bSet ) nCount = SC_DPAGG_RESULT_EMPTY; @@ -657,7 +656,7 @@ void ScDPAggData::SetEmpty( sal_Bool bSet ) double ScDPAggData::GetAuxiliary() const { // after Calculate, fAux is used as auxiliary value for running totals and reference values - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); return fAux; } @@ -665,7 +664,7 @@ double ScDPAggData::GetAuxiliary() const void ScDPAggData::SetAuxiliary( double fNew ) { // after Calculate, fAux is used as auxiliary value for running totals and reference values - DBG_ASSERT( IsCalculated(), "ScDPAggData not calculated" ); + OSL_ENSURE( IsCalculated(), "ScDPAggData not calculated" ); fAux = fNew; } @@ -699,7 +698,7 @@ ScDPRowTotals::~ScDPRowTotals() ScDPAggData* lcl_GetChildTotal( ScDPAggData* pFirst, long nMeasure ) { - DBG_ASSERT( nMeasure >= 0, "GetColTotal: no measure" ); + OSL_ENSURE( nMeasure >= 0, "GetColTotal: no measure" ); ScDPAggData* pAgg = pFirst; long nSkip = nMeasure; @@ -848,19 +847,19 @@ long ScDPResultData::GetRowStartMeasure() const ScSubTotalFunc ScDPResultData::GetMeasureFunction(long nMeasure) const { - DBG_ASSERT( pMeasFuncs && nMeasure < nMeasCount, "bumm" ); + OSL_ENSURE( pMeasFuncs && nMeasure < nMeasCount, "bumm" ); return pMeasFuncs[nMeasure]; } const sheet::DataPilotFieldReference& ScDPResultData::GetMeasureRefVal(long nMeasure) const { - DBG_ASSERT( pMeasRefs && nMeasure < nMeasCount, "bumm" ); + OSL_ENSURE( pMeasRefs && nMeasure < nMeasCount, "bumm" ); return pMeasRefs[nMeasure]; } sal_uInt16 ScDPResultData::GetMeasureRefOrient(long nMeasure) const { - DBG_ASSERT( pMeasRefOrient && nMeasure < nMeasCount, "bumm" ); + OSL_ENSURE( pMeasRefOrient && nMeasure < nMeasCount, "bumm" ); return pMeasRefOrient[nMeasure]; } @@ -881,7 +880,7 @@ String ScDPResultData::GetMeasureString(long nMeasure, sal_Bool bForce, ScSubTot } else { - DBG_ASSERT( pMeasNames && nMeasure < nMeasCount, "bumm" ); + OSL_ENSURE( pMeasNames && nMeasure < nMeasCount, "bumm" ); ScDPDimension* pDataDim = pSource->GetDataDimension(nMeasure); if (pDataDim) { @@ -1371,7 +1370,7 @@ void ScDPResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pS long nSize = GetSize(nMeasure); sheet::MemberResult* pArray = pSequences->getArray(); - DBG_ASSERT( rPos+nSize <= pSequences->getLength(), "bumm" ); + OSL_ENSURE( rPos+nSize <= pSequences->getLength(), "bumm" ); sal_Bool bIsNumeric = false; String aName; @@ -1615,7 +1614,7 @@ void ScDPResultMember::FillDataResults( const ScDPResultMember* pRefMember, else if ( pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL ) nMemberMeasure = SC_DPMEASURE_ALL; - DBG_ASSERT( rRow < rSequence.getLength(), "bumm" ); + OSL_ENSURE( rRow < rSequence.getLength(), "bumm" ); uno::Sequence<sheet::DataResult>& rSubSeq = rSequence.getArray()[rRow]; long nSeqCol = 0; pDataRoot->FillDataRow( pRefMember, rSubSeq, nSeqCol, nMemberMeasure, bHasChild, aSubState ); @@ -1974,7 +1973,7 @@ double ScDPDataMember::GetAggregate( long nMeasure, const ScDPSubTotalState& rSu ScDPAggData* ScDPDataMember::GetAggData( long nMeasure, const ScDPSubTotalState& rSubState ) { - DBG_ASSERT( nMeasure >= 0, "GetAggData: no measure" ); + OSL_ENSURE( nMeasure >= 0, "GetAggData: no measure" ); ScDPAggData* pAgg = &aAggregate; long nSkip = nMeasure; @@ -1992,7 +1991,7 @@ ScDPAggData* ScDPDataMember::GetAggData( long nMeasure, const ScDPSubTotalState& const ScDPAggData* ScDPDataMember::GetConstAggData( long nMeasure, const ScDPSubTotalState& rSubState ) const { - DBG_ASSERT( nMeasure >= 0, "GetConstAggData: no measure" ); + OSL_ENSURE( nMeasure >= 0, "GetConstAggData: no measure" ); const ScDPAggData* pAgg = &aAggregate; long nSkip = nMeasure; @@ -2017,7 +2016,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, long& rCol, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { - DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); + OSL_ENSURE( pRefMember == pResultMember || !pResultMember, "bla" ); if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension::FillDataRow ??? { @@ -2098,7 +2097,7 @@ void ScDPDataMember::FillDataRow( const ScDPResultMember* pRefMember, if ( nMeasure == SC_DPMEASURE_ALL ) nMemberMeasure = nSubCount; - DBG_ASSERT( rCol < rSequence.getLength(), "bumm" ); + OSL_ENSURE( rCol < rSequence.getLength(), "bumm" ); sheet::DataResult& rRes = rSequence.getArray()[rCol]; if ( HasData( nMemberMeasure, aLocalSubState ) ) @@ -2135,7 +2134,7 @@ void ScDPDataMember::UpdateDataRow( const ScDPResultMember* pRefMember, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) { - DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); + OSL_ENSURE( pRefMember == pResultMember || !pResultMember, "bla" ); // Calculate must be called even if not visible (for use as reference value) const ScDPDataDimension* pDataChild = GetChildDimension(); @@ -2206,7 +2205,7 @@ void ScDPDataMember::UpdateDataRow( const ScDPResultMember* pRefMember, void ScDPDataMember::SortMembers( ScDPResultMember* pRefMember ) { - DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); + OSL_ENSURE( pRefMember == pResultMember || !pResultMember, "bla" ); if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension ??? { @@ -2219,7 +2218,7 @@ void ScDPDataMember::SortMembers( ScDPResultMember* pRefMember ) void ScDPDataMember::DoAutoShow( ScDPResultMember* pRefMember ) { - DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); + OSL_ENSURE( pRefMember == pResultMember || !pResultMember, "bla" ); if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension ??? { @@ -2244,7 +2243,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, const ScDPSubTotalState& rSubState, ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals, const ScDPResultMember& rRowParent ) { - DBG_ASSERT( pRefMember == pResultMember || !pResultMember, "bla" ); + OSL_ENSURE( pRefMember == pResultMember || !pResultMember, "bla" ); if ( pRefMember->IsVisible() ) //! here or in ScDPDataDimension::UpdateRunningTotals ??? { @@ -2490,7 +2489,7 @@ void ScDPDataMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, { const ScDPAggData* pOtherAggData = pSelectMember-> GetConstAggData( nMemberMeasure, aLocalSubState ); - DBG_ASSERT( pOtherAggData, "no agg data" ); + OSL_ENSURE( pOtherAggData, "no agg data" ); if ( pOtherAggData ) { // Reference member may be visited before or after this one, @@ -2839,9 +2838,7 @@ void ScDPResultDimension::LateInitFrom( LateInitParams& rParams/* const vector<S { if ( rParams.IsEnd( nPos ) ) return; -#ifdef DBG_UTIL - DBG_ASSERT( nPos <= pItemData.size(), ByteString::CreateFromInt32( pItemData.size()).GetBuffer() ); -#endif + OSL_ENSURE( nPos <= pItemData.size(), ByteString::CreateFromInt32( pItemData.size()).GetBuffer() ); ScDPDimension* pThisDim = rParams.GetDim( nPos ); ScDPLevel* pThisLevel = rParams.GetLevel( nPos ); SCROW rThisData = pItemData[nPos]; @@ -2960,7 +2957,7 @@ long ScDPResultDimension::GetSize(long nMeasure) const long nMemberCount = maMemberArray.size(); if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); // repeat first member... nTotal = nMemberCount * maMemberArray[0]->GetSize(0); // all measures have equal size @@ -3053,7 +3050,7 @@ void ScDPResultDimension::FillDataResults( const ScDPResultMember* pRefMember, const ScDPResultMember* pMember; if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); pMember = maMemberArray[0]; nMemberMeasure = nSorted; @@ -3076,7 +3073,7 @@ void ScDPResultDimension::UpdateDataResults( const ScDPResultMember* pRefMember, const ScDPResultMember* pMember; if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); pMember = maMemberArray[0]; nMemberMeasure = i; @@ -3097,7 +3094,7 @@ void ScDPResultDimension::SortMembers( ScDPResultMember* pRefMember ) { // sort members - DBG_ASSERT( aMemberOrder.empty(), "sort twice?" ); + OSL_ENSURE( aMemberOrder.empty(), "sort twice?" ); aMemberOrder.resize( nCount ); for (long nPos=0; nPos<nCount; nPos++) aMemberOrder[nPos] = nPos; @@ -3206,7 +3203,7 @@ void ScDPResultDimension::UpdateRunningTotals( const ScDPResultMember* pRefMembe if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); pMember = maMemberArray[0]; nMemberMeasure = nSorted; @@ -3231,7 +3228,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo { // get named, previous/next, or first member of this dimension (first existing if pRelativePos and pName are NULL) - DBG_ASSERT( pRelativePos == NULL || pName == NULL, "can't use position and name" ); + OSL_ENSURE( pRelativePos == NULL || pName == NULL, "can't use position and name" ); ScDPDataMember* pColMember = NULL; @@ -3244,7 +3241,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo nDirection = pRelativePos->nDirection; nMemberIndex = pRelativePos->nBasePos + nDirection; // bounds are handled below - DBG_ASSERT( nDirection == 1 || nDirection == -1, "Direction must be 1 or -1" ); + OSL_ENSURE( nDirection == 1 || nDirection == -1, "Direction must be 1 or -1" ); } else if ( pName ) { @@ -3318,7 +3315,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePo ScDPDataMember* ScDPResultDimension::GetColReferenceMember( const ScDPRelativePos* pRelativePos, const String* pName, long nRefDimPos, const ScDPRunningTotalState& rRunning ) { - DBG_ASSERT( pRelativePos == NULL || pName == NULL, "can't use position and name" ); + OSL_ENSURE( pRelativePos == NULL || pName == NULL, "can't use position and name" ); const long* pColIndexes = rRunning.GetColIndexes(); const long* pRowIndexes = rRunning.GetRowIndexes(); @@ -3569,8 +3566,8 @@ void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, long nCol, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { - DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); - DBG_ASSERT( pRefDim == pResultDimension, "wrong dim" ); + OSL_ENSURE( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); + OSL_ENSURE( pRefDim == pResultDimension, "wrong dim" ); const ScMemberSortOrder& rMemberOrder = pRefDim->GetMemberOrder(); @@ -3584,7 +3581,7 @@ void ScDPDataDimension::FillDataRow( const ScDPResultDimension* pRefDim, long nMemberPos = nSorted; if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); nMemberPos = 0; nMemberMeasure = nSorted; @@ -3604,8 +3601,8 @@ void ScDPDataDimension::UpdateDataRow( const ScDPResultDimension* pRefDim, long nMeasure, sal_Bool bIsSubTotalRow, const ScDPSubTotalState& rSubState ) const { - DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); - DBG_ASSERT( pRefDim == pResultDimension, "wrong dim" ); + OSL_ENSURE( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); + OSL_ENSURE( pRefDim == pResultDimension, "wrong dim" ); long nMemberMeasure = nMeasure; long nCount = aMembers.Count(); @@ -3614,7 +3611,7 @@ void ScDPDataDimension::UpdateDataRow( const ScDPResultDimension* pRefDim, long nMemberPos = i; if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); nMemberPos = 0; nMemberMeasure = i; @@ -3636,7 +3633,7 @@ void ScDPDataDimension::SortMembers( ScDPResultDimension* pRefDim ) // sort members ScMemberSortOrder& rMemberOrder = pRefDim->GetMemberOrder(); - DBG_ASSERT( rMemberOrder.empty(), "sort twice?" ); + OSL_ENSURE( rMemberOrder.empty(), "sort twice?" ); rMemberOrder.resize( nCount ); for (long nPos=0; nPos<nCount; nPos++) rMemberOrder[nPos] = nPos; @@ -3647,8 +3644,8 @@ void ScDPDataDimension::SortMembers( ScDPResultDimension* pRefDim ) // handle children - DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); - DBG_ASSERT( pRefDim == pResultDimension, "wrong dim" ); + OSL_ENSURE( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); + OSL_ENSURE( pRefDim == pResultDimension, "wrong dim" ); // for data layout, call only once - sorting measure is always taken from settings long nLoopCount = bIsDataLayout ? 1 : nCount; @@ -3669,8 +3666,8 @@ void ScDPDataDimension::DoAutoShow( ScDPResultDimension* pRefDim ) // handle children first, before changing the visible state - DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); - DBG_ASSERT( pRefDim == pResultDimension, "wrong dim" ); + OSL_ENSURE( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); + OSL_ENSURE( pRefDim == pResultDimension, "wrong dim" ); // for data layout, call only once - sorting measure is always taken from settings long nLoopCount = bIsDataLayout ? 1 : nCount; @@ -3758,8 +3755,8 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim, const ScDPSubTotalState& rSubState, ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals, const ScDPResultMember& rRowParent ) const { - DBG_ASSERT( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); - DBG_ASSERT( pRefDim == pResultDimension, "wrong dim" ); + OSL_ENSURE( pRefDim && pRefDim->GetMemberCount() == aMembers.Count(), "dimensions don't match" ); + OSL_ENSURE( pRefDim == pResultDimension, "wrong dim" ); long nMemberMeasure = nMeasure; long nCount = aMembers.Count(); @@ -3771,7 +3768,7 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim, long nMemberPos = nSorted; if (bIsDataLayout) { - DBG_ASSERT(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, + OSL_ENSURE(nMeasure == SC_DPMEASURE_ALL || pResultData->GetMeasureCount() == 1, "DataLayout dimension twice?"); nMemberPos = 0; nMemberMeasure = nSorted; diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 366ca1495dd6..545109a9cfa4 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -40,7 +40,6 @@ #include <boost/unordered_set.hpp> #include <boost/unordered_map.hpp> -#include <tools/debug.hxx> #include <rtl/math.hxx> #include <svl/itemprop.hxx> #include <svl/intitem.hxx> @@ -340,7 +339,7 @@ void ScDPSource::SetDupCount( long nNew ) ScDPDimension* ScDPSource::AddDuplicated(long /* nSource */, const String& rNewName) { - DBG_ASSERT( pDimensions, "AddDuplicated without dimensions?" ); + OSL_ENSURE( pDimensions, "AddDuplicated without dimensions?" ); // re-use @@ -1036,7 +1035,7 @@ void ScDPSource::FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> for (long nDim=0; nDim<nDimCount; nDim++) { ScDPDimension* pDim = pDims->getByIndex(pDimIndex[nDim]); - DBG_ASSERT( pDim->getOrientation() == nOrientation, "orientations are wrong" ); + OSL_ENSURE( pDim->getOrientation() == nOrientation, "orientations are wrong" ); ScDPHierarchies* pHiers = pDim->GetHierarchiesObject(); long nHierarchy = pDim->getUsedHierarchy(); @@ -1452,7 +1451,7 @@ void ScDPDimension::setUsedHierarchy(long /* nNew */) ScDPDimension* ScDPDimension::CreateCloneObject() { - DBG_ASSERT( nSourceDim < 0, "recursive duplicate - not implemented" ); + OSL_ENSURE( nSourceDim < 0, "recursive duplicate - not implemented" ); //! set new name here, or temporary name ??? String aNewName = aName; @@ -2591,7 +2590,7 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const ppMbrs[nIndex] = pNew; } - DBG_ASSERT( ppMbrs[nIndex] ," member is not initialized " ); + OSL_ENSURE( ppMbrs[nIndex] ," member is not initialized " ); return ppMbrs[nIndex]; } @@ -2646,7 +2645,7 @@ sal_Int32 ScDPMember::Compare( const ScDPMember& rOther ) const { if ( rOther.nPosition >= 0 ) { - DBG_ASSERT( nPosition != rOther.nPosition, "same position for two members" ); + OSL_ENSURE( nPosition != rOther.nPosition, "same position for two members" ); return ( nPosition < rOther.nPosition ) ? -1 : 1; } else @@ -2798,7 +2797,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDPMember ) const ScDPCache* ScDPSource::GetCache() { - DBG_ASSERT( GetData() , "empty ScDPTableData pointer"); + OSL_ENSURE( GetData() , "empty ScDPTableData pointer"); return ( GetData()!=NULL) ? GetData()->GetCacheTable().getCache() : NULL ; } diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 8008ea6800b3..9741adcd1515 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -131,7 +131,7 @@ ScUndoObjData::~ScUndoObjData() void ScUndoObjData::Undo() { ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj ); - DBG_ASSERT(pData,"ScUndoObjData: Daten nicht da"); + OSL_ENSURE(pData,"ScUndoObjData: Daten nicht da"); if (pData) { pData->maStart = aOldStt; @@ -142,7 +142,7 @@ void ScUndoObjData::Undo() void ScUndoObjData::Redo() { ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj ); - DBG_ASSERT(pData,"ScUndoObjData: Daten nicht da"); + OSL_ENSURE(pData,"ScUndoObjData: Daten nicht da"); if (pData) { pData->maStart = aNewStt; @@ -369,7 +369,7 @@ SdrModel* ScDrawLayer::AllocModel() const Window* ScDrawLayer::GetCurDocViewWin() { - DBG_ASSERT( pDoc, "ScDrawLayer::GetCurDocViewWin without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::GetCurDocViewWin without document" ); if ( !pDoc ) return NULL; @@ -468,7 +468,7 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC SCsCOL nDx,SCsROW nDy, bool bUpdateNoteCaptionPos ) { SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page nicht gefunden"); + OSL_ENSURE(pPage,"Page nicht gefunden"); if (!pPage) return; @@ -571,13 +571,13 @@ namespace void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos ) { - DBG_ASSERT( pDoc, "ScDrawLayer::RecalcPos - missing document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::RecalcPos - missing document" ); if( !pDoc ) return; if( rData.mbNote ) { - DBG_ASSERT( rData.maStart.IsValid(), "ScDrawLayer::RecalcPos - invalid position for cell note" ); + OSL_ENSURE( rData.maStart.IsValid(), "ScDrawLayer::RecalcPos - invalid position for cell note" ); /* #i109372# On insert/remove rows/columns/cells: Updating the caption position must not be done, if the cell containing the note has not been moved yet in the document. The calling code now passes an @@ -733,7 +733,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati if (rData.maLastRect.IsEmpty()) rData.maLastRect = pObj->GetLogicRect(); - DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" ); + OSL_ENSURE( bValid1, "ScDrawLayer::RecalcPos - invalid start position" ); Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) ); TwipsToMM( aPos.X() ); TwipsToMM( aPos.Y() ); @@ -785,12 +785,12 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const { - DBG_ASSERT( pDoc, "ScDrawLayer::GetPrintArea without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::GetPrintArea without document" ); if ( !pDoc ) return false; SCTAB nTab = rRange.aStart.Tab(); - DBG_ASSERT( rRange.aEnd.Tab() == nTab, "GetPrintArea: Tab unterschiedlich" ); + OSL_ENSURE( rRange.aEnd.Tab() == nTab, "GetPrintArea: Tab unterschiedlich" ); sal_Bool bNegativePage = pDoc->IsNegativePage( nTab ); @@ -833,7 +833,7 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool } const SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page nicht gefunden"); + OSL_ENSURE(pPage,"Page nicht gefunden"); if (pPage) { SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -876,7 +876,7 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool if (bAny) { - DBG_ASSERT( nStartX<=nEndX && nStartY<=nEndY, "Start/End falsch in ScDrawLayer::GetPrintArea" ); + OSL_ENSURE( nStartX<=nEndX && nStartY<=nEndY, "Start/End falsch in ScDrawLayer::GetPrintArea" ); if (bSetHor) { @@ -953,7 +953,7 @@ SdrUndoGroup* ScDrawLayer::GetCalcUndo() void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2, SCsCOL nDx,SCsROW nDy, sal_Bool bInsDel, bool bUpdateNoteCaptionPos ) { - DBG_ASSERT( pDoc, "ScDrawLayer::MoveArea without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::MoveArea without document" ); if ( !pDoc ) return; @@ -1000,7 +1000,7 @@ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCR sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow ) { - DBG_ASSERT( pDoc, "ScDrawLayer::HasObjectsInRows without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::HasObjectsInRows without document" ); if ( !pDoc ) return false; @@ -1027,7 +1027,7 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR MirrorRectRTL( aTestRect ); SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page nicht gefunden"); + OSL_ENSURE(pPage,"Page nicht gefunden"); if (!pPage) return false; @@ -1051,12 +1051,12 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2 ) { - DBG_ASSERT( pDoc, "ScDrawLayer::DeleteObjectsInArea without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::DeleteObjectsInArea without document" ); if ( !pDoc ) return; SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) return; @@ -1100,7 +1100,7 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark ) { - DBG_ASSERT( pDoc, "ScDrawLayer::DeleteObjectsInSelection without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::DeleteObjectsInSelection without document" ); if ( !pDoc ) return; @@ -1201,7 +1201,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& pDestPage = pDestModel->GetPage( static_cast<sal_uInt16>(nTab) ); } - DBG_ASSERT( pDestPage, "no page" ); + OSL_ENSURE( pDestPage, "no page" ); if (pDestPage) { SdrObject* pNewObject = pOldObject->Clone(); @@ -1272,7 +1272,7 @@ sal_Bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRa void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const Rectangle& rSourceRange, const ScAddress& rDestPos, const Rectangle& rDestRange ) { - DBG_ASSERT( pDoc, "ScDrawLayer::CopyFromClip without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::CopyFromClip without document" ); if ( !pDoc ) return; @@ -1297,7 +1297,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const SdrPage* pSrcPage = pClipModel->GetPage(static_cast<sal_uInt16>(nSourceTab)); SdrPage* pDestPage = GetPage(static_cast<sal_uInt16>(nDestTab)); - DBG_ASSERT( pSrcPage && pDestPage, "draw page missing" ); + OSL_ENSURE( pSrcPage && pDestPage, "draw page missing" ); if ( !pSrcPage || !pDestPage ) return; @@ -1516,7 +1516,7 @@ void ScDrawLayer::MirrorRectRTL( Rectangle& rRect ) Rectangle ScDrawLayer::GetCellRect( ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell ) { Rectangle aCellRect; - DBG_ASSERT( ValidColRowTab( rPos.Col(), rPos.Row(), rPos.Tab() ), "ScDrawLayer::GetCellRect - invalid cell address" ); + OSL_ENSURE( ValidColRowTab( rPos.Col(), rPos.Row(), rPos.Tab() ), "ScDrawLayer::GetCellRect - invalid cell address" ); if( ValidColRowTab( rPos.Col(), rPos.Row(), rPos.Tab() ) ) { // find top left position of passed cell address @@ -1586,7 +1586,7 @@ SdrObject* ScDrawLayer::GetNamedObject( const String& rName, sal_uInt16 nId, SCT for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++) { const SdrPage* pPage = GetPage(nTab); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS ); @@ -1639,7 +1639,7 @@ void ScDrawLayer::EnsureGraphicNames() for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++) { SdrPage* pPage = GetPage(nTab); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS ); @@ -1880,7 +1880,7 @@ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) { - DBG_ASSERT(!pGlobalDrawPersist,"SetGlobalDrawPersist mehrfach"); + OSL_ENSURE(!pGlobalDrawPersist,"SetGlobalDrawPersist mehrfach"); pGlobalDrawPersist = pPersist; } @@ -1893,7 +1893,7 @@ void ScDrawLayer::SetChanged( sal_Bool bFlg /* = sal_True */ ) SvStream* ScDrawLayer::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const { - DBG_ASSERT( pDoc, "ScDrawLayer::GetDocumentStream without document" ); + OSL_ENSURE( pDoc, "ScDrawLayer::GetDocumentStream without document" ); if ( !pDoc ) return NULL; diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index b8c62e3a9007..5db10b5a13f7 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -163,7 +163,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX SCTAB nTab, double nScaleX, double nScaleY, sal_Bool bPageMode, sal_Bool bFormulaMode, const ScMarkData* pMarkData ) { - DBG_ASSERT( pTab[nTab], "Tabelle existiert nicht" ); + OSL_ENSURE( pTab[nTab], "Tabelle existiert nicht" ); sal_Bool bLayoutRTL = IsLayoutRTL( nTab ); @@ -287,7 +287,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { //! Conditionals auch bei HASATTR_ROTATE abfragen ???? - DBG_ASSERT( nArrCount>2, "nArrCount zu klein" ); + OSL_ENSURE( nArrCount>2, "nArrCount zu klein" ); // FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-2, nX1, nX2 ); FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-1, nX1, nX2 ); // FindMaxRotCol setzt nRotMaxCol @@ -401,7 +401,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX { while ( pRowInfo[nArrY].nRowNo < nThisRow ) ++nArrY; - DBG_ASSERT( pRowInfo[nArrY].nRowNo == nThisRow, "Zeile nicht gefunden in FillInfo" ); + OSL_ENSURE( pRowInfo[nArrY].nRowNo == nThisRow, "Zeile nicht gefunden in FillInfo" ); RowInfo* pThisRowInfo = &pRowInfo[nArrY]; CellInfo* pInfo = &pThisRowInfo->pCellInfo[nArrX]; diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index b83dae160121..0c46a3504a91 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -336,7 +336,7 @@ void ScFuncDesc::initArgumentInfo() const if ( bIncomplete ) { - DBG_ERRORFILE( "couldn't initialize add-in function" ); + OSL_FAIL( "couldn't initialize add-in function" ); const_cast<ScFuncDesc*>(this)->bIncomplete = false; // even if there was an error, don't try again } } @@ -642,7 +642,7 @@ sal_uInt32 ScFunctionCategory::getNumber() const ScFunctionMgr::ScFunctionMgr() : pFuncList( ScGlobal::GetStarCalcFunctionList() ) { - DBG_ASSERT( pFuncList, "Functionlist not found." ); + OSL_ENSURE( pFuncList, "Functionlist not found." ); sal_uInt32 catCount[MAX_FUNCCAT] = {0}; aCatLists[0] = new ::std::vector<const ScFuncDesc*>(); @@ -652,7 +652,7 @@ ScFunctionMgr::ScFunctionMgr() : // number of functions in each category for(const ScFuncDesc* pDesc = pFuncList->First(); pDesc; pDesc = pFuncList->Next()) { - DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unknown category"); + OSL_ENSURE((pDesc->nCategory) < MAX_FUNCCAT, "Unknown category"); if ((pDesc->nCategory) < MAX_FUNCCAT) ++catCount[pDesc->nCategory]; aCatLists[0]->push_back(pDesc); @@ -714,7 +714,7 @@ const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const const ScFuncDesc* ScFunctionMgr::First( sal_uInt16 nCategory ) const { - DBG_ASSERT( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" ); + OSL_ENSURE( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" ); const ScFuncDesc* pDesc = NULL; if ( nCategory < MAX_FUNCCAT ) { diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 57c517c9b977..27532c232a94 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -352,7 +352,7 @@ void ScGlobal::SetUserList( const ScUserList* pNewList ) const String& ScGlobal::GetRscString( sal_uInt16 nIndex ) { - DBG_ASSERT( nIndex < STR_COUNT, "ScGlobal::GetRscString - invalid string index"); + OSL_ENSURE( nIndex < STR_COUNT, "ScGlobal::GetRscString - invalid string index"); if( !ppRscString[ nIndex ] ) { OpCode eOp = ocNone; @@ -1068,7 +1068,7 @@ sal_uInt16 ScGlobal::GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhic void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ) { - DBG_ASSERT( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, false ) == SFX_ITEM_DEFAULT, + OSL_ENSURE( rSet.GetItemState( ATTR_LANGUAGE_FORMAT, false ) == SFX_ITEM_DEFAULT, "ScGlobal::AddLanguage - language already added"); const SfxPoolItem* pHardItem; @@ -1105,7 +1105,7 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration() ::comphelper::getProcessServiceFactory(), SC_TRANSLITERATION_IGNORECASE ); pTransliteration->loadModuleIfNeeded( eOfficeLanguage ); } - DBG_ASSERT( + OSL_ENSURE( pTransliteration, "ScGlobal::GetpTransliteration() called before ScGlobal::Init()"); return pTransliteration; @@ -1113,7 +1113,7 @@ utl::TransliterationWrapper* ScGlobal::GetpTransliteration() const LocaleDataWrapper* ScGlobal::GetpLocaleData() { - DBG_ASSERT( + OSL_ENSURE( pLocaleData, "ScGlobal::GetpLocaleData() called before ScGlobal::Init()"); return pLocaleData; diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 884bee76efe5..946ca10c3906 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -37,7 +37,6 @@ #include <ucbhelper/content.hxx> #include <unotools/localfilehelper.hxx> -#include <tools/debug.hxx> #include <unotools/pathoptions.hxx> #include <com/sun/star/sdbc/XResultSet.hpp> @@ -115,18 +114,18 @@ void ScGlobal::InitAddIns() } catch ( Exception& ) { - DBG_ERRORFILE( "ResultSetException catched!" ); + OSL_FAIL( "ResultSetException catched!" ); } } } catch ( Exception& ) { - DBG_ERRORFILE( "Exception catched!" ); + OSL_FAIL( "Exception catched!" ); } catch ( ... ) { - DBG_ERRORFILE( "unexpected exception caught!" ); + OSL_FAIL( "unexpected exception caught!" ); } } } @@ -150,10 +149,10 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) } catch ( Exception& ) { - DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during init" ); + OSL_FAIL( "GetOrdinalSuffix: exception caught during init" ); } } - DBG_ASSERT( xOrdinalSuffix.is(), "GetOrdinalSuffix: createInstance failed"); + OSL_ENSURE( xOrdinalSuffix.is(), "GetOrdinalSuffix: createInstance failed"); if (xOrdinalSuffix.is()) { try @@ -167,7 +166,7 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) } catch ( Exception& ) { - DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during getOrdinalSuffix" ); + OSL_FAIL( "GetOrdinalSuffix: exception caught during getOrdinalSuffix" ); } } return String(); diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index 940ef895ea1c..7d966afb0c2d 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "markarr.hxx" #include "global.hxx" #include "address.hxx" @@ -351,7 +349,7 @@ SCROW ScMarkArray::GetMarkEnd( SCROW nRow, sal_Bool bUp ) const SCROW nRet; SCSIZE nIndex; Search(nRow, nIndex); - DBG_ASSERT( pData[nIndex].bMarked, "GetMarkEnd ohne bMarked" ); + OSL_ENSURE( pData[nIndex].bMarked, "GetMarkEnd ohne bMarked" ); if (bUp) { if (nIndex>0) diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index b5627a8d162a..eecf9efac2db 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "markdata.hxx" #include "markarr.hxx" #include "rangelst.hxx" @@ -240,7 +238,7 @@ void ScMarkData::MarkToSimple() if ( bMultiMarked ) { - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); ScRange aNew = aMultiRange; @@ -291,7 +289,7 @@ sal_Bool ScMarkData::IsCellMarked( SCCOL nCol, SCROW nRow, sal_Bool bNoSimple ) { //! hier auf negative Markierung testen ? - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); return pMultiSel[nCol].GetMark( nRow ); } @@ -326,7 +324,7 @@ sal_Bool ScMarkData::IsRowMarked( SCROW nRow ) const if ( bMultiMarked ) { - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) if (!pMultiSel[nCol].GetMark(nRow)) return false; @@ -375,7 +373,7 @@ void ScMarkData::FillRangeListWithMarks( ScRangeList* pList, sal_Bool bClear ) c if ( bMultiMarked ) { - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); SCTAB nTab = aMultiRange.aStart.Tab(); @@ -429,7 +427,7 @@ SCCOLROW ScMarkData::GetMarkColumnRanges( SCCOLROW* pRanges ) if (!bMultiMarked) return 0; - DBG_ASSERT(pMultiSel, "bMultiMarked, but pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, but pMultiSel == 0"); const SCCOLROW nMultiStart = aMultiRange.aStart.Col(); const SCCOLROW nMultiEnd = aMultiRange.aEnd.Col(); @@ -474,7 +472,7 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges ) if (!bMultiMarked) return 0; - DBG_ASSERT(pMultiSel, "bMultiMarked, but pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, but pMultiSel == 0"); // Which rows are marked? @@ -540,7 +538,7 @@ sal_Bool ScMarkData::IsAllMarked( const ScRange& rRange ) const if ( !bMultiMarked ) return false; - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); @@ -559,7 +557,7 @@ SCsROW ScMarkData::GetNextMarked( SCCOL nCol, SCsROW nRow, sal_Bool bUp ) const if ( !bMultiMarked ) return nRow; - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); return pMultiSel[nCol].GetNextMarked( nRow, bUp ); } @@ -569,7 +567,7 @@ sal_Bool ScMarkData::HasMultiMarks( SCCOL nCol ) const if ( !bMultiMarked ) return false; - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); return pMultiSel[nCol].HasMarks(); } @@ -579,7 +577,7 @@ sal_Bool ScMarkData::HasAnyMultiMarks() const if ( !bMultiMarked ) return false; - DBG_ASSERT(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); + OSL_ENSURE(pMultiSel, "bMultiMarked, aber pMultiSel == 0"); for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) if ( pMultiSel[nCol].HasMarks() ) diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index f4dc662f40b7..2b231917cc85 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -33,7 +33,6 @@ -#include <tools/debug.hxx> #include <limits.h> // INCLUDE --------------------------------------------------------------- diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 1c58a1644af7..c3ec9119f6ae 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -376,7 +376,7 @@ void ScPatternAttr::GetFont( eLang = ((const SvxLanguageItem&)rItemSet.Get( nLangId )).GetLanguage(); } - DBG_ASSERT(pFontAttr,"nanu?"); + OSL_ENSURE(pFontAttr,"nanu?"); // auswerten @@ -1005,7 +1005,7 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD if ( pDestDoc != pSrcDoc ) { - DBG_ASSERT( pStyle, "Missing Pattern-Style! :-/" ); + OSL_ENSURE( pStyle, "Missing Pattern-Style! :-/" ); // wenn Vorlage im DestDoc vorhanden, dieses benutzen, sonst Style // mit Parent-Vorlagen kopieren/ggF. erzeugen und dem DestDoc hinzufuegen @@ -1260,7 +1260,7 @@ sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter, const SfxItemSet* pCondSet ) const { - DBG_ASSERT(pFormatter,"GetNumberFormat ohne Formatter"); + OSL_ENSURE(pFormatter,"GetNumberFormat ohne Formatter"); const SfxPoolItem* pFormItem; if ( !pCondSet || pCondSet->GetItemState(ATTR_VALUE_FORMAT,sal_True,&pFormItem) != SFX_ITEM_SET ) diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index 0596070e459a..fb6f71595ca6 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -49,7 +49,7 @@ ScPoolHelper::ScPoolHelper( ScDocument* pSourceDoc ) ,pEnginePool(NULL) ,m_pSourceDoc(pSourceDoc) { - DBG_ASSERT( pSourceDoc, "ScPoolHelper: no document" ); + OSL_ENSURE( pSourceDoc, "ScPoolHelper: no document" ); pDocPool = new ScDocumentPool; pDocPool->FreezeIdRanges(); diff --git a/sc/source/core/data/sheetevents.cxx b/sc/source/core/data/sheetevents.cxx index 652d2cc3eda2..d1650f9fcfdf 100644 --- a/sc/source/core/data/sheetevents.cxx +++ b/sc/source/core/data/sheetevents.cxx @@ -33,15 +33,13 @@ #include "sheetevents.hxx" #include <com/sun/star/script/vba/VBAEventId.hpp> -#include <tools/debug.hxx> - // ----------------------------------------------------------------------- rtl::OUString ScSheetEvents::GetEventName(sal_Int32 nEvent) { if (nEvent<0 || nEvent>=SC_SHEETEVENT_COUNT) { - DBG_ERRORFILE("invalid event number"); + OSL_FAIL("invalid event number"); return rtl::OUString(); } @@ -63,7 +61,7 @@ sal_Int32 ScSheetEvents::GetVbaSheetEventId(sal_Int32 nEvent) using namespace ::com::sun::star::script::vba::VBAEventId; if (nEvent<0 || nEvent>=SC_SHEETEVENT_COUNT) { - DBG_ERRORFILE("invalid event number"); + OSL_FAIL("invalid event number"); return NO_EVENT; } @@ -135,7 +133,7 @@ const rtl::OUString* ScSheetEvents::GetScript(sal_Int32 nEvent) const { if (nEvent<0 || nEvent>=SC_SHEETEVENT_COUNT) { - DBG_ERRORFILE("invalid event number"); + OSL_FAIL("invalid event number"); return NULL; } @@ -148,7 +146,7 @@ void ScSheetEvents::SetScript(sal_Int32 nEvent, const rtl::OUString* pNew) { if (nEvent<0 || nEvent>=SC_SHEETEVENT_COUNT) { - DBG_ERRORFILE("invalid event number"); + OSL_FAIL("invalid event number"); return; } diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index f3b83b562ddd..8010a15fc7e4 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -37,8 +37,6 @@ #include "queryparam.hxx" #include "subtotalparam.hxx" -#include <tools/debug.hxx> - //------------------------------------------------------------------------ diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 0316a5ab18b7..ec83c1f57e6e 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -137,7 +137,7 @@ SfxStyleSheetBase* ScStyleSheetPool::Create( SfxStyleSheetBase* ScStyleSheetPool::Create( const SfxStyleSheetBase& rStyle ) { - DBG_ASSERT( rStyle.ISA(ScStyleSheet), "Invalid StyleSheet-class! :-/" ); + OSL_ENSURE( rStyle.ISA(ScStyleSheet), "Invalid StyleSheet-class! :-/" ); return new ScStyleSheet( (const ScStyleSheet&) rStyle ); } @@ -147,7 +147,7 @@ void ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle ) { if ( pStyle ) { - DBG_ASSERT( IS_SET( SFXSTYLEBIT_USERDEF, pStyle->GetMask() ), + OSL_ENSURE( IS_SET( SFXSTYLEBIT_USERDEF, pStyle->GetMask() ), "SFXSTYLEBIT_USERDEF not set!" ); ((ScDocumentPool&)rPool).StyleDeleted((ScStyleSheet*)pStyle); diff --git a/sc/source/core/data/subtotalparam.cxx b/sc/source/core/data/subtotalparam.cxx index 26f01e8e6da0..aaf55ec3d152 100644 --- a/sc/source/core/data/subtotalparam.cxx +++ b/sc/source/core/data/subtotalparam.cxx @@ -201,13 +201,13 @@ void ScSubTotalParam::SetSubTotals( sal_uInt16 nGroup, const ScSubTotalFunc* ptrFunctions, sal_uInt16 nCount ) { - DBG_ASSERT( (nGroup <= MAXSUBTOTAL), + OSL_ENSURE( (nGroup <= MAXSUBTOTAL), "ScSubTotalParam::SetSubTotals(): nGroup > MAXSUBTOTAL!" ); - DBG_ASSERT( ptrSubTotals, + OSL_ENSURE( ptrSubTotals, "ScSubTotalParam::SetSubTotals(): ptrSubTotals == NULL!" ); - DBG_ASSERT( ptrFunctions, + OSL_ENSURE( ptrFunctions, "ScSubTotalParam::SetSubTotals(): ptrFunctions == NULL!" ); - DBG_ASSERT( (nCount > 0), + OSL_ENSURE( (nCount > 0), "ScSubTotalParam::SetSubTotals(): nCount <= 0!" ); if ( ptrSubTotals && ptrFunctions && (nCount > 0) && (nGroup <= MAXSUBTOTAL) ) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 87b25340b927..a475d696afdb 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -459,7 +459,7 @@ sal_Bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n const Fraction& rZoomX, const Fraction& rZoomY, sal_Bool bForce, ScProgress* pOuterProgress, sal_uLong nProgressStart ) { - DBG_ASSERT( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); + OSL_ENSURE( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); if ( !pDocument->IsAdjustHeightEnabled() ) { @@ -492,7 +492,7 @@ void ScTable::SetOptimalHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n const Fraction& rZoomX, const Fraction& rZoomY, sal_Bool bForce, ScProgress* pOuterProgress, sal_uLong nProgressStart ) { - DBG_ASSERT( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); + OSL_ENSURE( nExtra==0 || bForce, "autom. OptimalHeight mit Extra" ); if ( !pDocument->IsAdjustHeightEnabled() ) return; @@ -1064,7 +1064,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, nCol = sal::static_int_cast<SCsCOL>( nCol + nMovX ); nRow = sal::static_int_cast<SCsROW>( nRow + nMovY ); - DBG_ASSERT( !nMovY || !bUnprotected, + OSL_ENSURE( !nMovY || !bUnprotected, "GetNextPos mit bUnprotected horizontal nicht implementiert" ); if ( nMovY && bMarked ) @@ -1219,7 +1219,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, sal_Bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) { const ScMarkArray* pMarkArray = rMark.GetArray(); - DBG_ASSERT(pMarkArray,"GetNextMarkedCell ohne MarkArray"); + OSL_ENSURE(pMarkArray,"GetNextMarkedCell ohne MarkArray"); if ( !pMarkArray ) return false; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 3a009033392f..8205f3f86647 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -913,7 +913,7 @@ void ScTable::InvalidatePageBreaks() void ScTable::CopyScenarioTo( ScTable* pDestTab ) const { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].CopyScenarioTo( pDestTab->aCol[i] ); @@ -921,7 +921,7 @@ void ScTable::CopyScenarioTo( ScTable* pDestTab ) const void ScTable::CopyScenarioFrom( const ScTable* pSrcTab ) { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); for (SCCOL i=0; i<=MAXCOL; i++) aCol[i].CopyScenarioFrom( pSrcTab->aCol[i] ); @@ -929,7 +929,7 @@ void ScTable::CopyScenarioFrom( const ScTable* pSrcTab ) void ScTable::MarkScenarioIn( ScMarkData& rDestMark, sal_uInt16 nNeededBits ) const { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); if ( ( nScenarioFlags & nNeededBits ) != nNeededBits ) // alle Bits gesetzt? return; @@ -940,7 +940,7 @@ void ScTable::MarkScenarioIn( ScMarkData& rDestMark, sal_uInt16 nNeededBits ) co sal_Bool ScTable::HasScenarioRange( const ScRange& rRange ) const { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); ScRange aTabRange = rRange; aTabRange.aStart.SetTab( nTab ); @@ -969,7 +969,7 @@ void ScTable::InvalidateScenarioRanges() const ScRangeList* ScTable::GetScenarioRanges() const { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); if (!pScenarioRanges) { @@ -983,7 +983,7 @@ const ScRangeList* ScTable::GetScenarioRanges() const sal_Bool ScTable::TestCopyScenarioTo( const ScTable* pDestTab ) const { - DBG_ASSERT( bScenario, "bScenario == FALSE" ); + OSL_ENSURE( bScenario, "bScenario == FALSE" ); if (!pDestTab->IsProtected()) return sal_True; @@ -1386,7 +1386,7 @@ bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, { if (!(ValidCol(nStartCol) && ValidCol(rEndCol))) { - DBG_ERRORFILE("ScTable::ExtendMerge: invalid column number"); + OSL_FAIL("ScTable::ExtendMerge: invalid column number"); return false; } bool bFound = false; @@ -1402,7 +1402,7 @@ sal_Bool ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRo { if (!(ValidCol(nCol1) && ValidCol(nCol2))) { - DBG_ERRORFILE("ScTable::IsBlockEmpty: invalid column number"); + OSL_FAIL("ScTable::IsBlockEmpty: invalid column number"); return false; } sal_Bool bEmpty = sal_True; @@ -1455,7 +1455,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO SCCOL nTouchedCol = nCol; long nWidth = static_cast<long>(mpRowHeights->getValue(nRow) * nFactor); - DBG_ASSERT(nWidth <= 0, "Richtung falsch"); + OSL_ENSURE(nWidth <= 0, "Richtung falsch"); while ( nWidth < 0 && nTouchedCol > 0 ) { --nTouchedCol; @@ -1645,7 +1645,7 @@ sal_Bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, { if ( !ValidColRow( nCol2, nRow2 ) ) { - DBG_ERRORFILE("IsBlockEditable: invalid column or row"); + OSL_FAIL("IsBlockEditable: invalid column or row"); if (pOnlyNotBecauseOfMatrix) *pOnlyNotBecauseOfMatrix = false; return false; @@ -2283,7 +2283,7 @@ void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bManual sal_uInt16 ScTable::GetColWidth( SCCOL nCol ) const { - DBG_ASSERT(VALIDCOL(nCol),"Falsche Spaltennummer"); + OSL_ENSURE(VALIDCOL(nCol),"Falsche Spaltennummer"); if (VALIDCOL(nCol) && pColFlags && pColWidth) { @@ -2299,7 +2299,7 @@ sal_uInt16 ScTable::GetColWidth( SCCOL nCol ) const sal_uInt16 ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte { - DBG_ASSERT(VALIDCOL(nCol),"Falsche Spaltennummer"); + OSL_ENSURE(VALIDCOL(nCol),"Falsche Spaltennummer"); if (VALIDCOL(nCol) && pColWidth) return pColWidth[nCol]; @@ -2357,7 +2357,7 @@ sal_uInt16 ScTable::GetCommonWidth( SCCOL nEndCol ) sal_uInt16 ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero ) const { - DBG_ASSERT(VALIDROW(nRow),"Invalid row number"); + OSL_ENSURE(VALIDROW(nRow),"Invalid row number"); if (VALIDROW(nRow) && mpRowHeights) { @@ -2400,7 +2400,7 @@ sal_uInt16 ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow, sal_uLong ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const { - DBG_ASSERT(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); + OSL_ENSURE(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights) { @@ -2426,7 +2426,7 @@ sal_uLong ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const { - DBG_ASSERT(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); + OSL_ENSURE(VALIDROW(nStartRow) && VALIDROW(nEndRow),"Falsche Zeilennummer"); if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && mpRowHeights) { @@ -2453,7 +2453,7 @@ sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fS sal_uInt16 ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden { - DBG_ASSERT(VALIDROW(nRow),"wrong row number"); + OSL_ENSURE(VALIDROW(nRow),"wrong row number"); if (VALIDROW(nRow) && mpRowHeights) return mpRowHeights->getValue(nRow); @@ -3068,9 +3068,9 @@ sal_uLong ScTable::GetRowOffset( SCROW nRow ) const return GetRowHeight(0); n = GetTotalRowHeight(0, nRow-1); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 if (n == ::std::numeric_limits<unsigned long>::max()) - DBG_ERRORFILE("ScTable::GetRowOffset: row heights overflow"); + OSL_FAIL("ScTable::GetRowOffset: row heights overflow"); #endif } else diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index b87f74863437..d092d6d8711e 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -371,7 +371,7 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress& rProgress ) ::std::swap(p, aTable[nDest-nStart]); p->nOrg = nOrg; ::std::swap(p, aTable[nOrg-nStart]); - DBG_ASSERT( p == ppInfo[nPos], "SortReorder: nOrg MisMatch" ); + OSL_ENSURE( p == ppInfo[nPos], "SortReorder: nOrg MisMatch" ); } rProgress.SetStateOnPercent( nPos ); } @@ -1521,7 +1521,7 @@ void ScTable::TopTenQuery( ScQueryParam& rParam ) } else { - DBG_ERRORFILE( "TopTenQuery: pCell kein ValueData" ); + OSL_FAIL( "TopTenQuery: pCell kein ValueData" ); rEntry.eOp = SC_GREATER_EQUAL; rEntry.nVal = 0; } @@ -1734,7 +1734,7 @@ sal_Bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW SCCOL* pFields = new SCCOL[nCol2-nCol1+1]; String aCellStr; SCCOL nCol = nCol1; - DBG_ASSERT( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); + OSL_ENSURE( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); SCROW nDBRow1 = rQueryParam.nRow1; SCCOL nDBCol2 = rQueryParam.nCol2; @@ -1826,7 +1826,7 @@ sal_Bool ScTable::CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n String aCellStr; SCSIZE nIndex = 0; SCROW nRow = nRow1; - DBG_ASSERT( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); + OSL_ENSURE( rQueryParam.nTab != SCTAB_MAX, "rQueryParam.nTab no value, not bad but no good" ); SCTAB nDBTab = (rQueryParam.nTab == SCTAB_MAX ? nTab : rQueryParam.nTab); SCROW nDBRow1 = rQueryParam.nRow1; SCCOL nDBCol2 = rQueryParam.nCol2; diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index edba012fadd1..c94a8fa9c687 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -194,7 +194,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, double& rInc, sal_uInt16& rMinDigits, ScUserListData*& rListData, sal_uInt16& rListIndex) { - DBG_ASSERT( nCol1==nCol2 || nRow1==nRow2, "FillAnalyse: falscher Bereich" ); + OSL_ENSURE( nCol1==nCol2 || nRow1==nRow2, "FillAnalyse: falscher Bereich" ); rInc = 0.0; rMinDigits = 0; @@ -443,17 +443,17 @@ void ScTable::FillFormula(sal_uLong& /* nFormulaCounter */, sal_Bool /* bFirst * } else { - DBG_ERRORFILE( "FillFormula: MatrixOrigin keine Formelzelle mit MM_FORMULA" ); + OSL_FAIL( "FillFormula: MatrixOrigin keine Formelzelle mit MM_FORMULA" ); } } else { - DBG_ERRORFILE( "FillFormula: MatrixOrigin rechts unten" ); + OSL_FAIL( "FillFormula: MatrixOrigin rechts unten" ); } } else { - DBG_ERRORFILE( "FillFormula: kein MatrixOrigin" ); + OSL_FAIL( "FillFormula: kein MatrixOrigin" ); } } pDocument->SetNoListening( false ); diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 2ec076291c85..9c87f162e262 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -140,7 +140,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, false, &pItem ) == SFX_ITEM_SET ) { - DBG_ASSERT( pItem->ISA(SfxUInt16Item), "falsches Item" ); + OSL_ENSURE( pItem->ISA(SfxUInt16Item), "falsches Item" ); bSkipColBreaks = bSkipRowBreaks = ( ((const SfxUInt16Item*)pItem)->GetValue() > 0 ); } @@ -260,9 +260,9 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) { // subtract size of repeat rows from page size unsigned long nHeights = GetTotalRowHeight(nRepeatStartY, nRepeatEndY); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 if (nHeights == ::std::numeric_limits<unsigned long>::max()) - DBG_ERRORFILE("ScTable::UpdatePageBreaks: row heights overflow"); + OSL_FAIL("ScTable::UpdatePageBreaks: row heights overflow"); #endif nPageSizeY -= nHeights; if (nY <= nRepeatEndY) diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index d37afa30e5d2..7397dd59f66e 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -490,7 +490,7 @@ sal_Bool ScTable::ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark String& rUndoStr, ScDocument* pUndoDoc) { sal_Bool bOldDouble = ScColumn::bDoubleAlloc; // sollte immer sal_False sein? - DBG_ASSERT(!bOldDouble,"bDoubleAlloc ???"); + OSL_ENSURE(!bOldDouble,"bDoubleAlloc ???"); ScColumn::bDoubleAlloc = sal_True; // fuer Undo-Doc sal_Bool bFound = sal_True; diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 3d43b6d052b1..baddbf579545 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -32,7 +32,6 @@ // INCLUDE --------------------------------------------------------------- #include "tabprotection.hxx" -#include "tools/debug.hxx" #include "svl/PasswordHelper.hxx" #include <comphelper/docpasswordhelper.hxx> #include "document.hxx" diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx index 39dca1b2e319..d7d31333c1e0 100644 --- a/sc/source/core/data/userdat.cxx +++ b/sc/source/core/data/userdat.cxx @@ -32,7 +32,6 @@ // ----------------------------------------------------------------------- #include "userdat.hxx" -#include <tools/debug.hxx> #include "drwlayer.hxx" #include "rechead.hxx" diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx index 68cdd5078072..ee2a378182b4 100644 --- a/sc/source/core/inc/core_pch.hxx +++ b/sc/source/core/inc/core_pch.hxx @@ -50,7 +50,6 @@ #include <global.hxx> #include <tools/color.hxx> #include <i18npool/lang.h> -#include <tools/debug.hxx> #include <tools/gen.hxx> #include <svl/svarray.hxx> #include <markarr.hxx> diff --git a/sc/source/core/tool/addincfg.cxx b/sc/source/core/tool/addincfg.cxx index 051b1a088e9c..a2c5fd0b4feb 100644 --- a/sc/source/core/tool/addincfg.cxx +++ b/sc/source/core/tool/addincfg.cxx @@ -30,8 +30,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include <tools/debug.hxx> - #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index dd86967431d2..96c3d30498e5 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -32,7 +32,6 @@ #include <comphelper/processfactory.hxx> -#include <tools/debug.hxx> #include <i18npool/mslangid.hxx> #include <vcl/svapp.hxx> #include <sfx2/objsh.hxx> @@ -159,7 +158,7 @@ const uno::Sequence<sheet::LocalizedName>& ScUnoAddInFuncData::GetCompNames() co void ScUnoAddInFuncData::SetCompNames( const uno::Sequence< sheet::LocalizedName>& rNew ) { - DBG_ASSERT( !bCompInitialized, "SetCompNames after initializing" ); + OSL_ENSURE( !bCompInitialized, "SetCompNames after initializing" ); aCompNames = rNew; @@ -303,7 +302,7 @@ uno::Reference<uno::XComponentContext> getContext(uno::Reference<lang::XMultiSer void ScUnoAddInCollection::Initialize() { - DBG_ASSERT( !bInitialized, "Initialize twice?" ); + OSL_ENSURE( !bInitialized, "Initialize twice?" ); uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory(); uno::Reference<container::XContentEnumerationAccess> xEnAc( xManager, uno::UNO_QUERY ); @@ -1007,7 +1006,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& pVisibleArgs[nDestPos++] = aDesc; } } - DBG_ASSERT( nDestPos==nVisibleCount, "wrong count" ); + OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" ); } ppFuncData[nFuncPos+nOld] = new ScUnoAddInFuncData( @@ -1189,7 +1188,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface pVisibleArgs[nDestPos++] = aDesc; } } - DBG_ASSERT( nDestPos==nVisibleCount, "wrong count" ); + OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" ); } pOldData->SetFunction( xFunc, aObject ); @@ -1385,7 +1384,7 @@ ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const String& rName xMatrix( NULL ) { pFuncData = rColl.GetFuncData( rName, true ); // need fully initialized data - DBG_ASSERT( pFuncData, "Function Data missing" ); + OSL_ENSURE( pFuncData, "Function Data missing" ); if ( pFuncData ) { long nDescCount = pFuncData->GetArgumentCount(); @@ -1497,7 +1496,7 @@ void ScUnoAddInCall::ExecuteCall() // insert aVarArg as last argument //! after inserting caller (to prevent copying twice)? - DBG_ASSERT( aArgs.getLength() == nCount, "wrong argument count" ); + OSL_ENSURE( aArgs.getLength() == nCount, "wrong argument count" ); aArgs.getArray()[nCount-1] <<= aVarArg; } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 13101cc0a921..fba193fbf88c 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1309,7 +1309,7 @@ void ScRange::Justify() void ScRange::ExtendTo( const ScRange& rRange ) { - DBG_ASSERT( rRange.IsValid(), "ScRange::ExtendTo - cannot extend to invalid range" ); + OSL_ENSURE( rRange.IsValid(), "ScRange::ExtendTo - cannot extend to invalid range" ); if( IsValid() ) { aStart.SetCol( ::std::min( aStart.Col(), rRange.aStart.Col() ) ); diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 616002e1c0c2..b159a25980b5 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -411,12 +411,12 @@ ScAppCfg::ScAppCfg() : aValues = aLayoutItem.GetProperties(aNames); aLayoutItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -446,12 +446,12 @@ ScAppCfg::ScAppCfg() : aValues = aInputItem.GetProperties(aNames); aInputItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -475,12 +475,12 @@ ScAppCfg::ScAppCfg() : aValues = aRevisionItem.GetProperties(aNames); aRevisionItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -507,12 +507,12 @@ ScAppCfg::ScAppCfg() : aValues = aContentItem.GetProperties(aNames); aContentItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -530,12 +530,12 @@ ScAppCfg::ScAppCfg() : aValues = aSortListItem.GetProperties(aNames); aSortListItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -553,12 +553,12 @@ ScAppCfg::ScAppCfg() : aValues = aMiscItem.GetProperties(aNames); aMiscItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 9150255cebf3..c288e9f3ee57 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -521,15 +521,15 @@ ScAutoFormatData::~ScAutoFormatData() ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) { - DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); - DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); + OSL_ENSURE( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); + OSL_ENSURE( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } const ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) const { - DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); - DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); + OSL_ENSURE( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); + OSL_ENSURE( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } @@ -1037,7 +1037,7 @@ sal_Bool ScAutoFormat::Load() rStream >> nCnt >> nChrSet; if( rStream.Tell() != sal_uLong(nPos + nCnt) ) { - DBG_ERRORFILE( "Der Header enthaelt mehr/neuere Daten" ); + OSL_FAIL( "Der Header enthaelt mehr/neuere Daten" ); rStream.Seek( nPos + nCnt ); } rStream.SetStreamCharSet( GetSOLoadTextEncoding( nChrSet, nFileVers ) ); diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 5b75acdf7174..282f0f9933c2 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -64,7 +64,7 @@ sal_uInt16 lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool for (sal_uInt16 nPageNo=0; nPageNo<nPageCount; nPageNo++) { SdrPage* pPage = pModel->GetPage(nPageNo); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index bf2a5d1015dd..aefbe5854091 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -63,7 +63,7 @@ std::vector< WeakReference< frame::XModel > > lcl_getAllLivingCharts( ScDocument if (pDoc->HasTable(nTab)) { SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); SdrObject* pObject = aIter.Next(); diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 7baa02ad5dc7..e7c778d6f561 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -518,7 +518,7 @@ ScChartPositionMap::ScChartPositionMap( SCCOL nChartCols, SCROW nChartRows, nColCount( nChartCols ), nRowCount( nChartRows ) { - DBG_ASSERT( nColCount && nRowCount, "ScChartPositionMap without dimension" ); + OSL_ENSURE( nColCount && nRowCount, "ScChartPositionMap without dimension" ); ScAddress* pPos; SCCOL nCol; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index e8f96f6fbfef..5a12539bea3b 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -30,7 +30,6 @@ #include "precompiled_sc.hxx" -#include <tools/debug.hxx> #include <tools/shl.hxx> // SHL_CALC #include <tools/stack.hxx> #include <tools/rtti.hxx> @@ -581,7 +580,7 @@ void ScChangeAction::RejectRestoreContents( ScChangeTrack* pTrack, } SetState( SC_CAS_REJECTED ); // vor UpdateReference fuer Move pTrack->UpdateReference( this, sal_True ); // LinkDeleted freigeben - DBG_ASSERT( !pLinkDeleted, "ScChangeAction::RejectRestoreContents: pLinkDeleted != NULL" ); + OSL_ENSURE( !pLinkDeleted, "ScChangeAction::RejectRestoreContents: pLinkDeleted != NULL" ); // Liste der Contents abarbeiten und loeschen ScDocument* pDoc = pTrack->GetDocument(); ScChangeActionCellListEntry* pE = pListContents; @@ -605,7 +604,7 @@ void ScChangeAction::SetDeletedInThis( sal_uLong nActionNumber, if ( nActionNumber ) { ScChangeAction* pAct = pTrack->GetActionOrGenerated( nActionNumber ); - DBG_ASSERT( pAct, "ScChangeAction::SetDeletedInThis: missing Action" ); + OSL_ENSURE( pAct, "ScChangeAction::SetDeletedInThis: missing Action" ); if ( pAct ) pAct->SetDeletedIn( this ); } @@ -618,7 +617,7 @@ void ScChangeAction::AddDependent( sal_uLong nActionNumber, if ( nActionNumber ) { ScChangeAction* pAct = pTrack->GetActionOrGenerated( nActionNumber ); - DBG_ASSERT( pAct, "ScChangeAction::AddDependent: missing Action" ); + OSL_ENSURE( pAct, "ScChangeAction::AddDependent: missing Action" ); if ( pAct ) { ScChangeActionLinkEntry* pLink = AddDependent( pAct ); @@ -1378,7 +1377,7 @@ void ScChangeActionContent::SetOldNewCells( ScBaseCell* pOldCellP, void ScChangeActionContent::SetNewCell( ScBaseCell* pCell, ScDocument* pDoc, const String& rFormatted ) { - DBG_ASSERT( !pNewCell, "ScChangeActionContent::SetNewCell: overwriting existing cell" ); + OSL_ENSURE( !pNewCell, "ScChangeActionContent::SetNewCell: overwriting existing cell" ); pNewCell = pCell; ScChangeActionContent::SetCell( aNewValue, pNewCell, 0, pDoc ); @@ -1824,7 +1823,7 @@ void ScChangeActionContent::PutValueToDoc( ScBaseCell* pCell, SCCOL nC; SCROW nR; ((const ScFormulaCell*)pCell)->GetMatColsRows( nC, nR ); - DBG_ASSERT( nC>0 && nR>0, "ScChangeActionContent::PutValueToDoc: MatColsRows?" ); + OSL_ENSURE( nC>0 && nR>0, "ScChangeActionContent::PutValueToDoc: MatColsRows?" ); ScRange aRange( aPos ); if ( nC > 1 ) aRange.aEnd.IncCol( nC-1 ); @@ -2909,7 +2908,7 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct ) } else { - DBG_ERRORFILE( "ScChangeTrack::Dependencies: MatOrg not found" ); + OSL_FAIL( "ScChangeTrack::Dependencies: MatOrg not found" ); } } } @@ -3131,7 +3130,7 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe ScChangeAction* pCut = aPasteCutTable.Remove( nCut ); if ( pCut ) { - DBG_ASSERT( !aTable.Get( nCut ), "ScChangeTrack::Undo: nCut dup" ); + OSL_ENSURE( !aTable.Get( nCut ), "ScChangeTrack::Undo: nCut dup" ); Append( pCut, nCut ); } else @@ -4080,7 +4079,7 @@ sal_Bool ScChangeTrack::SelectContent( ScChangeAction* pAct, sal_Bool bOldest ) } else { - DBG_ERRORFILE( "ScChangeTrack::SelectContent: content dependent no content" ); + OSL_FAIL( "ScChangeTrack::SelectContent: content dependent no content" ); } } pL = pL->GetNext(); @@ -4178,7 +4177,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl { if ( pAct->HasDependent() && !bRecursion ) { - DBG_ASSERT( pTable, "ScChangeTrack::Reject: Insert ohne Table" ); + OSL_ENSURE( pTable, "ScChangeTrack::Reject: Insert ohne Table" ); for ( ScChangeAction* p = pTable->Last(); p && bOk; p = pTable->Prev() ) { // keine Contents restoren, die eh geloescht werden wuerden @@ -4199,7 +4198,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl } else if ( pAct->IsDeleteType() ) { - DBG_ASSERT( !pTable, "ScChangeTrack::Reject: Delete mit Table" ); + OSL_ENSURE( !pTable, "ScChangeTrack::Reject: Delete mit Table" ); ScBigRange aDelRange; sal_uLong nRejectAction = pAct->GetActionNumber(); sal_Bool bTabDel, bTabDelOk; @@ -4294,7 +4293,7 @@ sal_Bool ScChangeTrack::Reject( ScChangeAction* pAct, ScChangeActionTable* pTabl { if ( pAct->HasDependent() && !bRecursion ) { - DBG_ASSERT( pTable, "ScChangeTrack::Reject: Move ohne Table" ); + OSL_ENSURE( pTable, "ScChangeTrack::Reject: Move ohne Table" ); for ( ScChangeAction* p = pTable->Last(); p && bOk; p = pTable->Prev() ) { bOk = Reject( p, NULL, sal_True ); //! rekursiv @@ -4392,7 +4391,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const pGenerated = aGeneratedStack.top(); aGeneratedStack.pop(); const ScChangeActionContent* pContent = dynamic_cast< const ScChangeActionContent* >( pGenerated ); - DBG_ASSERT( pContent, "ScChangeTrack::Clone: pContent is null!" ); + OSL_ENSURE( pContent, "ScChangeTrack::Clone: pContent is null!" ); const ScBaseCell* pNewCell = pContent->GetNewCell(); if ( pNewCell ) { @@ -4432,7 +4431,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const case SC_CAT_DELETE_TABS: { const ScChangeActionDel* pDelete = dynamic_cast< const ScChangeActionDel* >( pAction ); - DBG_ASSERT( pDelete, "ScChangeTrack::Clone: pDelete is null!" ); + OSL_ENSURE( pDelete, "ScChangeTrack::Clone: pDelete is null!" ); SCsCOLROW nD = 0; ScChangeActionType eType = pAction->GetType(); @@ -4461,7 +4460,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const case SC_CAT_MOVE: { const ScChangeActionMove* pMove = dynamic_cast< const ScChangeActionMove* >( pAction ); - DBG_ASSERT( pMove, "ScChangeTrack::Clone: pMove is null!" ); + OSL_ENSURE( pMove, "ScChangeTrack::Clone: pMove is null!" ); pClonedAction = new ScChangeActionMove( pAction->GetActionNumber(), @@ -4478,7 +4477,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const case SC_CAT_CONTENT: { const ScChangeActionContent* pContent = dynamic_cast< const ScChangeActionContent* >( pAction ); - DBG_ASSERT( pContent, "ScChangeTrack::Clone: pContent is null!" ); + OSL_ENSURE( pContent, "ScChangeTrack::Clone: pContent is null!" ); const ScBaseCell* pOldCell = pContent->GetOldCell(); ScBaseCell* pClonedOldCell = pOldCell ? pOldCell->CloneWithoutNote( *pDocument ) : 0; String aOldValue; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index c90ef51762b8..2cacd81940d1 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -251,7 +251,7 @@ void ScCompiler::InitCharClassEnglish() void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar ) { - DBG_ASSERT( eGrammar != FormulaGrammar::GRAM_UNSPECIFIED, "ScCompiler::SetGrammar: don't pass FormulaGrammar::GRAM_UNSPECIFIED"); + OSL_ENSURE( eGrammar != FormulaGrammar::GRAM_UNSPECIFIED, "ScCompiler::SetGrammar: don't pass FormulaGrammar::GRAM_UNSPECIFIED"); if (eGrammar == GetGrammar()) return; // nothing to be done @@ -265,7 +265,7 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar ) FormulaGrammar::Grammar eMyGrammar = eGrammar; const sal_Int32 nFormulaLanguage = FormulaGrammar::extractFormulaLanguage( eMyGrammar); OpCodeMapPtr xMap = GetOpCodeMap( nFormulaLanguage); - DBG_ASSERT( xMap, "ScCompiler::SetGrammar: unknown formula language"); + OSL_ENSURE( xMap, "ScCompiler::SetGrammar: unknown formula language"); if (!xMap) { xMap = GetOpCodeMap( ::com::sun::star::sheet::FormulaLanguage::NATIVE); @@ -1826,7 +1826,7 @@ void ScCompiler::SetRefConvention( const ScCompiler::Convention *pConvP ) { pConv = pConvP; meGrammar = FormulaGrammar::mergeToGrammar( meGrammar, pConv->meConv); - DBG_ASSERT( FormulaGrammar::isSupported( meGrammar), + OSL_ENSURE( FormulaGrammar::isSupported( meGrammar), "ScCompiler::SetRefConvention: unsupported grammar resulting"); } @@ -2224,7 +2224,7 @@ Label_MaskStateMachine: bool bAddToSymbol = true; if ((nMask & SC_COMPILER_C_ODF_RBRACKET) && !(nRefInName & kOpen)) { - DBG_ASSERT( nRefInName & (kPast | kDefName), + OSL_ENSURE( nRefInName & (kPast | kDefName), "ScCompiler::NextSymbol: reference: " "closing bracket ']' without prior sheet name separator '.' violates ODF spec"); // eaten, not added to pSym @@ -2282,7 +2282,7 @@ Label_MaskStateMachine: } else if (!(nRefInName & kOpen)) { - DBG_ERRORFILE("ScCompiler::NextSymbol: reference: " + OSL_FAIL("ScCompiler::NextSymbol: reference: " "a ''' without the name being enclosed in '...' violates ODF spec"); } else if (nRefInName & kQuote) @@ -2319,7 +2319,7 @@ Label_MaskStateMachine: } else if (':' == c && !(nRefInName & kOpen)) { - DBG_ERRORFILE("ScCompiler::NextSymbol: reference: " + OSL_FAIL("ScCompiler::NextSymbol: reference: " "range operator ':' without prior sheet name separator '.' violates ODF spec"); nRefInName = 0; ++mnPredetectedReference; @@ -3019,7 +3019,7 @@ sal_Bool ScCompiler::IsColRowName( const String& rName ) case CELLTYPE_VALUE: case CELLTYPE_NOTE: case CELLTYPE_SYMBOLS: -#if DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 case CELLTYPE_DESTROYED: #endif ; // nothing, prevent compiler warning @@ -3148,7 +3148,7 @@ sal_Bool ScCompiler::IsColRowName( const String& rName ) case CELLTYPE_VALUE: case CELLTYPE_NOTE: case CELLTYPE_SYMBOLS: -#if DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 case CELLTYPE_DESTROYED: #endif ; // nothing, prevent compiler warning @@ -3643,7 +3643,7 @@ void ScCompiler::CreateStringFromXMLTokenArray( String& rFormula, String& rFormu { bool bExternal = GetGrammar() == FormulaGrammar::GRAM_EXTERNAL; sal_uInt16 nExpectedCount = bExternal ? 2 : 1; - DBG_ASSERT( pArr->GetLen() == nExpectedCount, "ScCompiler::CreateStringFromXMLTokenArray - wrong number of tokens" ); + OSL_ENSURE( pArr->GetLen() == nExpectedCount, "ScCompiler::CreateStringFromXMLTokenArray - wrong number of tokens" ); if( pArr->GetLen() == nExpectedCount ) { FormulaToken** ppTokens = pArr->GetArray(); @@ -3865,7 +3865,7 @@ ScTokenArray* ScCompiler::CompileString( const String& rFormula ) ScTokenArray* ScCompiler::CompileString( const String& rFormula, const String& rFormulaNmsp ) { - DBG_ASSERT( (GetGrammar() == FormulaGrammar::GRAM_EXTERNAL) || (rFormulaNmsp.Len() == 0), + OSL_ENSURE( (GetGrammar() == FormulaGrammar::GRAM_EXTERNAL) || (rFormulaNmsp.Len() == 0), "ScCompiler::CompileString - unexpected formula namespace for internal grammar" ); if( GetGrammar() == FormulaGrammar::GRAM_EXTERNAL ) try { @@ -4985,7 +4985,7 @@ void ScCompiler::CreateStringFromExternal(rtl::OUStringBuffer& rBuffer, FormulaT default: // warning, not error, otherwise we may end up with a never // ending message box loop if this was the cursor cell to be redrawn. - DBG_WARNING("ScCompiler::CreateStringFromToken: unknown type of ocExternalRef"); + OSL_FAIL("ScCompiler::CreateStringFromToken: unknown type of ocExternalRef"); } } diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index e92963b0c645..0555fcac179d 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "consoli.hxx" #include "document.hxx" #include "olinetab.hxx" @@ -510,12 +508,12 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, PutInOrder(nRow1,nRow2); if ( nCol2 >= sal::static_int_cast<SCCOL>(nCol1 + nColCount) && !bColByName ) { - DBG_ASSERT(0,"Bereich zu gross"); + OSL_FAIL("Bereich zu gross"); nCol2 = sal::static_int_cast<SCCOL>( nCol1 + nColCount - 1 ); } if ( nRow2 >= sal::static_int_cast<SCROW>(nRow1 + nRowCount) && !bRowByName ) { - DBG_ASSERT(0,"Bereich zu gross"); + OSL_FAIL("Bereich zu gross"); nRow2 = sal::static_int_cast<SCROW>( nRow1 + nRowCount - 1 ); } @@ -565,7 +563,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, nPos = static_cast<SCCOL>(i); bFound = sal_True; } - DBG_ASSERT(bFound, "Spalte nicht gefunden"); + OSL_ENSURE(bFound, "Spalte nicht gefunden"); } pDestCols[nCol-nStartCol] = nPos; } @@ -586,7 +584,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab, nPos = static_cast<SCROW>(i); bFound = sal_True; } - DBG_ASSERT(bFound, "Zeile nicht gefunden"); + OSL_ENSURE(bFound, "Zeile nicht gefunden"); } pDestRows[nRow-nStartRow] = nPos; } diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index a1ca196bdd61..e4baa4f2598b 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - -#include <tools/debug.hxx> #include <unotools/transliterationwrapper.hxx> #include "dbdata.hxx" @@ -366,7 +364,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam) { - DBG_ASSERT( rQueryParam.GetEntryCount() <= MAXQUERY || + OSL_ENSURE( rQueryParam.GetEntryCount() <= MAXQUERY || !rQueryParam.GetEntry(MAXQUERY).bDoQuery, "zuviele Eintraege bei ScDBData::SetQueryParam" ); diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx index 57000eb99844..f4f2d3930bf2 100644 --- a/sc/source/core/tool/detdata.cxx +++ b/sc/source/core/tool/detdata.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "detdata.hxx" #include "refupdat.hxx" #include "rechead.hxx" diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 801a0535c4e4..a0a7f6d8fe78 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -330,7 +330,7 @@ sal_Bool ScDetectiveFunc::HasError( const ScRange& rRange, ScAddress& rErrPos ) Point ScDetectiveFunc::GetDrawPos( SCCOL nCol, SCROW nRow, DrawPosMode eMode ) const { - DBG_ASSERT( ValidColRow( nCol, nRow ), "ScDetectiveFunc::GetDrawPos - invalid cell address" ); + OSL_ENSURE( ValidColRow( nCol, nRow ), "ScDetectiveFunc::GetDrawPos - invalid cell address" ); SanitizeCol( nCol ); SanitizeRow( nRow ); @@ -430,7 +430,7 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart, ScDrawLayer* pModel = pDoc->GetDrawLayer(); SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); sal_Bool bFound = false; SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -693,7 +693,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt ScDrawLayer* pModel = pDoc->GetDrawLayer(); SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); pPage->RecalcObjOrdNums(); @@ -757,7 +757,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR ScDrawLayer* pModel = pDoc->GetDrawLayer(); SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); pPage->RecalcObjOrdNums(); @@ -923,7 +923,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, sal_uInt16 ScDetectiveFunc::FindPredLevel( SCCOL nCol, SCROW nRow, sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ) { - DBG_ASSERT( nLevel<1000, "Level" ); + OSL_ENSURE( nLevel<1000, "Level" ); ScBaseCell* pCell; pDoc->GetCell( nCol, nRow, nTab, pCell ); @@ -1131,7 +1131,7 @@ sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCo sal_uInt16 ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ) { - DBG_ASSERT( nLevel<1000, "Level" ); + OSL_ENSURE( nLevel<1000, "Level" ); sal_uInt16 nResult = nLevel; sal_Bool bDelete = ( nDeleteLevel && nLevel == nDeleteLevel-1 ); @@ -1287,7 +1287,7 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat ) return false; SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); pPage->RecalcObjOrdNums(); @@ -1471,7 +1471,7 @@ void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc ) { rDoc.InitializeNoteCaptions( nObjTab ); SdrPage* pPage = pModel->GetPage( static_cast< sal_uInt16 >( nObjTab ) ); - DBG_ASSERT( pPage, "Page ?" ); + OSL_ENSURE( pPage, "Page ?" ); if( pPage ) { SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -1481,7 +1481,7 @@ void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc ) { ScPostIt* pNote = rDoc.GetNote( pData->maStart ); // caption should exist, we iterate over drawing objects... - DBG_ASSERT( pNote && (pNote->GetCaption() == pObject), "ScDetectiveFunc::UpdateAllComments - invalid cell note" ); + OSL_ENSURE( pNote && (pNote->GetCaption() == pObject), "ScDetectiveFunc::UpdateAllComments - invalid cell note" ); if( pNote ) { ScCommentData aData( rDoc, pModel ); @@ -1512,7 +1512,7 @@ void ScDetectiveFunc::UpdateAllArrowColors() for( SCTAB nObjTab = 0, nTabCount = pDoc->GetTableCount(); nObjTab < nTabCount; ++nObjTab ) { SdrPage* pPage = pModel->GetPage( static_cast< sal_uInt16 >( nObjTab ) ); - DBG_ASSERT( pPage, "Page ?" ); + OSL_ENSURE( pPage, "Page ?" ); if( pPage ) { SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -1588,7 +1588,7 @@ sal_Bool ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRang if (!pModel) return false; SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); if (!pPage) return false; // test if the object is a direct page member diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index 113af9a69db6..79347bfa42f3 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -239,7 +239,7 @@ String ScTpCalcItem::GetValueText() const int ScTpCalcItem::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); + OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); const ScTpCalcItem& rPItem = (const ScTpCalcItem&)rItem; @@ -390,7 +390,7 @@ ScDocCfg::ScDocCfg() : double fDoubleVal = 0; for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -517,12 +517,12 @@ ScDocCfg::ScDocCfg() : aValues = aLayoutItem.GetProperties(aNames); aLayoutItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index fe31cd9a0d79..0d0a55885ef0 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -579,7 +579,7 @@ void ScTabEditEngine::Init( const ScPatternAttr& rPattern ) String lcl_GetCharStr( sal_Int32 nNo ) { - DBG_ASSERT( nNo, "0 ist eine ungueltige Nummer !!" ); + OSL_ENSURE( nNo, "0 ist eine ungueltige Nummer !!" ); String aStr; const sal_Int32 coDiff = 'Z' - 'A' +1; diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx index c43a2b9c844f..b3001ec7101a 100644 --- a/sc/source/core/tool/filtopt.cxx +++ b/sc/source/core/tool/filtopt.cxx @@ -33,8 +33,6 @@ //------------------------------------------------------------------ -#include <tools/debug.hxx> - #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -80,12 +78,12 @@ ScFilterOptions::ScFilterOptions() : Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx index 8d300c5ebfff..036f0fa91489 100644 --- a/sc/source/core/tool/inputopt.cxx +++ b/sc/source/core/tool/inputopt.cxx @@ -33,8 +33,6 @@ //------------------------------------------------------------------ -#include <tools/debug.hxx> - #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -162,12 +160,12 @@ ScInputCfg::ScInputCfg() : Sequence<Any> aValues = GetProperties(aNames); EnableNotification(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { sal_Int32 nIntVal = 0; diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index c4a8cdd346cd..656eff60b8fe 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -358,7 +358,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) aCode.Pop(); // pop what Jump() pushed else { - DBG_ERRORFILE( "ScInterpreter::JumpMatrix: pop goes the weasel" ); + OSL_FAIL( "ScInterpreter::JumpMatrix: pop goes the weasel" ); } if ( !pResMat ) @@ -717,7 +717,7 @@ double ScInterpreter::CompareFunc( const ScCompare& rComp, ScCompareOptions* pOp // is/must be identical to *rEntry.pStr, which is essential for // regex to work through GetSearchTextPtr(). ScQueryEntry& rEntry = pOptions->aQueryEntry; - DBG_ASSERT( *rComp.pVal[1] == *rEntry.pStr, "ScInterpreter::CompareFunc: broken options"); + OSL_ENSURE( *rComp.pVal[1] == *rEntry.pStr, "ScInterpreter::CompareFunc: broken options"); if (pOptions->bRegEx) { xub_StrLen nStart = 0; @@ -4229,7 +4229,7 @@ static void lcl_GetLastMatch( SCSIZE& rIndex, const VectorMatrixAccessor& rMat, } else { - DBG_ERRORFILE("lcl_GetLastMatch: unhandled matrix type"); + OSL_FAIL("lcl_GetLastMatch: unhandled matrix type"); } } @@ -5413,7 +5413,7 @@ void ScInterpreter::ScLookup() PushCellResultToken( true, aResAdr, NULL, NULL); break; default: - DBG_ERRORFILE( "ScInterpreter::ScLookup: unhandled eResArrayType, single value data"); + OSL_FAIL( "ScInterpreter::ScLookup: unhandled eResArrayType, single value data"); } } else @@ -5430,7 +5430,7 @@ void ScInterpreter::ScLookup() PushCellResultToken( true, aDataAdr, NULL, NULL); break; default: - DBG_ERRORFILE( "ScInterpreter::ScLookup: unhandled eDataArrayType, single value data"); + OSL_FAIL( "ScInterpreter::ScLookup: unhandled eDataArrayType, single value data"); } } return; @@ -5713,7 +5713,7 @@ void ScInterpreter::ScLookup() } break; default: - DBG_ERRORFILE( "ScInterpreter::ScLookup: unhandled eResArrayType, range search"); + OSL_FAIL( "ScInterpreter::ScLookup: unhandled eResArrayType, range search"); } } else @@ -7725,7 +7725,7 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos, bool bFound = false; const ScQueryEntry& rEntry = rParam.GetEntry(0); bool bColumnsMatch = (rParam.nCol1 == rEntry.nField); - DBG_ASSERT( bColumnsMatch, "ScInterpreter::LookupQueryWithCache: columns don't match"); + OSL_ENSURE( bColumnsMatch, "ScInterpreter::LookupQueryWithCache: columns don't match"); if (!bColumnsMatch) bFound = lcl_LookupQuery( o_rResultPos, pDok, rParam, rEntry); else diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index aa06d915cb14..7cd7f17203c9 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2795,7 +2795,7 @@ void lclAppendDigit( ByteString& rText, sal_Int32 nDigit ) case 7: rText.UTF8_APPEND( UTF8_TH_7 ); break; case 8: rText.UTF8_APPEND( UTF8_TH_8 ); break; case 9: rText.UTF8_APPEND( UTF8_TH_9 ); break; - default: DBG_ERRORFILE( "lclAppendDigit - illegal digit" ); + default: OSL_FAIL( "lclAppendDigit - illegal digit" ); } } @@ -2805,7 +2805,7 @@ void lclAppendDigit( ByteString& rText, sal_Int32 nDigit ) */ void lclAppendPow10( ByteString& rText, sal_Int32 nDigit, sal_Int32 nPow10 ) { - DBG_ASSERT( (1 <= nDigit) && (nDigit <= 9), "lclAppendPow10 - illegal digit" ); + OSL_ENSURE( (1 <= nDigit) && (nDigit <= 9), "lclAppendPow10 - illegal digit" ); lclAppendDigit( rText, nDigit ); switch( nPow10 ) { @@ -2813,14 +2813,14 @@ void lclAppendPow10( ByteString& rText, sal_Int32 nDigit, sal_Int32 nPow10 ) case 3: rText.UTF8_APPEND( UTF8_TH_1E3 ); break; case 4: rText.UTF8_APPEND( UTF8_TH_1E4 ); break; case 5: rText.UTF8_APPEND( UTF8_TH_1E5 ); break; - default: DBG_ERRORFILE( "lclAppendPow10 - illegal power" ); + default: OSL_FAIL( "lclAppendPow10 - illegal power" ); } } /** Appends a block of 6 digits (value from 1 to 999,999) to the passed string. */ void lclAppendBlock( ByteString& rText, sal_Int32 nValue ) { - DBG_ASSERT( (1 <= nValue) && (nValue <= 999999), "lclAppendBlock - illegal value" ); + OSL_ENSURE( (1 <= nValue) && (nValue <= 999999), "lclAppendBlock - illegal value" ); if( nValue >= 100000 ) { lclAppendPow10( rText, nValue / 100000, 5 ); diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 3eec9942195f..c631b15adea5 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -85,7 +85,7 @@ double lcl_IterateInverse( const ScDistFunc& rFunction, double fAx, double fBx, const double fYEps = 1.0E-307; const double fXEps = ::std::numeric_limits<double>::epsilon(); - DBG_ASSERT(fAx<fBx, "IterateInverse: wrong interval"); + OSL_ENSURE(fAx<fBx, "IterateInverse: wrong interval"); // find enclosing interval @@ -1740,7 +1740,7 @@ void ScInterpreter::ScHypGeomDist() fCDenomVarLower = N - n - 2.0*(M - x) + 1.0; } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 double fCNumLower = N - n - fCNumVarUpper; #endif double fCDenomUpper = N - n - M + x + 1.0 - fCDenomVarLower; @@ -1762,12 +1762,12 @@ void ScInterpreter::ScHypGeomDist() else { // overlap - DBG_ASSERT( fCNumLower < n + 1.0, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( fCNumLower < n + 1.0, "ScHypGeomDist: wrong assertion" ); lcl_PutFactorialElements( cnNumer, N - 2.0*n, fCNumVarUpper, N - n ); lcl_PutFactorialElements( cnDenom, 0.0, n - 1.0, N ); } - DBG_ASSERT( fCDenomUpper <= N - M, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( fCDenomUpper <= N - M, "ScHypGeomDist: wrong assertion" ); if ( fCDenomUpper < n - x + 1.0 ) // no overlap @@ -1797,7 +1797,7 @@ void ScInterpreter::ScHypGeomDist() lcl_PutFactorialElements( cnDenom, 0.0, n - 1.0, N ); } - DBG_ASSERT( fCDenomUpper <= n, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( fCDenomUpper <= n, "ScHypGeomDist: wrong assertion" ); if ( fCDenomUpper < n - x + 1.0 ) // no overlap @@ -1810,7 +1810,7 @@ void ScInterpreter::ScHypGeomDist() } } - DBG_ASSERT( fCDenomUpper <= M, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( fCDenomUpper <= M, "ScHypGeomDist: wrong assertion" ); } else { @@ -1846,8 +1846,8 @@ void ScInterpreter::ScHypGeomDist() { // Case 4 - DBG_ASSERT( M >= n - x, "ScHypGeomDist: wrong assertion" ); - DBG_ASSERT( M - x <= N - M + 1.0, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( M >= n - x, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( M - x <= N - M + 1.0, "ScHypGeomDist: wrong assertion" ); if ( N - n < N - M + 1.0 ) { @@ -1858,8 +1858,7 @@ void ScInterpreter::ScHypGeomDist() else { // Overlap - DBG_ASSERT( fCNumLower <= N - M + 1.0, "ScHypGeomDist: wrong assertion" ); - + OSL_ENSURE( fCNumLower <= N - M + 1.0, "ScHypGeomDist: wrong assertion" ); lcl_PutFactorialElements( cnNumer, M - n, fCNumVarUpper, N - n ); lcl_PutFactorialElements( cnDenom, 0.0, n - 1.0, N ); } @@ -1876,7 +1875,7 @@ void ScInterpreter::ScHypGeomDist() } else { - DBG_ASSERT( M <= fCDenomUpper, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( M <= fCDenomUpper, "ScHypGeomDist: wrong assertion" ); lcl_PutFactorialElements( cnDenom, fCDenomVarLower, N - n - 2.0*M + x, N - n - M + x + 1.0 ); @@ -1885,7 +1884,7 @@ void ScInterpreter::ScHypGeomDist() } } - DBG_ASSERT( fCDenomUpper <= n, "ScHypGeomDist: wrong assertion" ); + OSL_ENSURE( fCDenomUpper <= n, "ScHypGeomDist: wrong assertion" ); fDNumVarLower = 0.0; } @@ -3114,14 +3113,14 @@ double ScInterpreter::GetPercentile( vector<double> & rArray, double fPercentile { size_t nIndex = (size_t)::rtl::math::approxFloor( fPercentile * (nSize-1)); double fDiff = fPercentile * (nSize-1) - ::rtl::math::approxFloor( fPercentile * (nSize-1)); - DBG_ASSERT(nIndex < nSize, "GetPercentile: wrong index(1)"); + OSL_ENSURE(nIndex < nSize, "GetPercentile: wrong index(1)"); vector<double>::iterator iter = rArray.begin() + nIndex; ::std::nth_element( rArray.begin(), iter, rArray.end()); if (fDiff == 0.0) return *iter; else { - DBG_ASSERT(nIndex < nSize-1, "GetPercentile: wrong index(2)"); + OSL_ENSURE(nIndex < nSize-1, "GetPercentile: wrong index(2)"); double fVal = *iter; iter = rArray.begin() + nIndex+1; ::std::nth_element( rArray.begin(), iter, rArray.end()); @@ -3332,7 +3331,7 @@ void ScInterpreter::ScTrimMean() if (nIndex % 2 != 0) nIndex--; nIndex /= 2; - DBG_ASSERT(nIndex < nSize, "ScTrimMean: falscher Index"); + OSL_ENSURE(nIndex < nSize, "ScTrimMean: falscher Index"); double fSum = 0.0; for (SCSIZE i = nIndex; i < nSize-nIndex; i++) fSum += aSortArray[i]; diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c7fb264db943..5a6c62a42c03 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -497,7 +497,7 @@ double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, const ScBaseCel fValue = 0.0; // empty or broadcaster cell break; case CELLTYPE_SYMBOLS: -#if DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 case CELLTYPE_DESTROYED: #endif SetError(errCellNoValue); @@ -1636,14 +1636,14 @@ bool ScInterpreter::ConvertMatrixParameters() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ConvertMatrixParameters" ); sal_uInt16 nParams = pCur->GetParamCount(); - DBG_ASSERT( nParams <= sp, "ConvertMatrixParameters: stack/param count mismatch"); + OSL_ENSURE( nParams <= sp, "ConvertMatrixParameters: stack/param count mismatch"); SCSIZE nJumpCols = 0, nJumpRows = 0; for ( sal_uInt16 i=1; i <= nParams && i <= sp; ++i ) { FormulaToken* p = pStack[ sp - i ]; if ( p->GetOpCode() != ocPush && p->GetOpCode() != ocMissing) { - DBG_ERRORFILE( "ConvertMatrixParameters: not a push"); + OSL_FAIL( "ConvertMatrixParameters: not a push"); } else { @@ -1752,7 +1752,7 @@ bool ScInterpreter::ConvertMatrixParameters() } break; default: - DBG_ERRORFILE( "ConvertMatrixParameters: unknown parameter type"); + OSL_FAIL( "ConvertMatrixParameters: unknown parameter type"); } } } @@ -3122,7 +3122,7 @@ void ScInterpreter::ScMacro() SbModule* pModule = pMethod->GetModule(); bool bUseVBAObjects = pModule->IsVBACompat(); SbxObject* pObject = pModule->GetParent(); - DBG_ASSERT(pObject->IsA(TYPE(StarBASIC)), "Kein Basic gefunden!"); + OSL_ENSURE(pObject->IsA(TYPE(StarBASIC)), "Kein Basic gefunden!"); String aMacroStr = pObject->GetName(); aMacroStr += '.'; aMacroStr += pModule->GetName(); @@ -3658,7 +3658,7 @@ ScInterpreter::~ScInterpreter() void ScInterpreter::GlobalExit() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GlobalExit" ); - DBG_ASSERT(!bGlobalStackInUse, "wer benutzt noch den TokenStack?"); + OSL_ENSURE(!bGlobalStackInUse, "wer benutzt noch den TokenStack?"); DELETEZ(pGlobalStack); } diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index 109495ddb6d2..abd6f184357f 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -29,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include <tools/debug.hxx> #include <rtl/logfile.hxx> #include "interpre.hxx" diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index e29967285058..81622552f7ee 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -37,7 +37,6 @@ #include "addincol.hxx" #include "funcdesc.hxx" #include <unotools/charclass.hxx> -#include <tools/debug.hxx> #include <osl/diagnose.h> #include <sal/macros.h> #include <string.h> @@ -222,7 +221,7 @@ void ScParameterClassification::Init() const RawData* pRaw = &pRawData[i]; if ( pRaw->eOp > SC_OPCODE_LAST_OPCODE_ID ) { - DBG_ASSERT( pRaw->eOp == ocNone, "RawData OpCode error"); + OSL_ENSURE( pRaw->eOp == ocNone, "RawData OpCode error"); } else { diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx index 35b91f1734de..1f8c43e17f28 100644 --- a/sc/source/core/tool/printopt.cxx +++ b/sc/source/core/tool/printopt.cxx @@ -113,7 +113,7 @@ String ScTpPrintItem::GetValueText() const int ScTpPrintItem::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); + OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); const ScTpPrintItem& rPItem = (const ScTpPrintItem&)rItem; return ( theOptions == rPItem.theOptions ); @@ -153,12 +153,12 @@ ScPrintCfg::ScPrintCfg() : Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx index 7813539dc06b..ffbeb86c3161 100644 --- a/sc/source/core/tool/prnsave.cxx +++ b/sc/source/core/tool/prnsave.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "prnsave.hxx" #include "global.hxx" #include "address.hxx" @@ -108,13 +106,13 @@ ScPrintRangeSaver::~ScPrintRangeSaver() ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB nTab) { - DBG_ASSERT(nTab<nTabCount,"ScPrintRangeSaver Tab zu gross"); + OSL_ENSURE(nTab<nTabCount,"ScPrintRangeSaver Tab zu gross"); return pData[nTab]; } const ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB nTab) const { - DBG_ASSERT(nTab<nTabCount,"ScPrintRangeSaver Tab zu gross"); + OSL_ENSURE(nTab<nTabCount,"ScPrintRangeSaver Tab zu gross"); return pData[nTab]; } diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index bc5d485a0cbf..790520f3c776 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -34,7 +34,6 @@ #define SC_RANGELST_CXX //fuer ICC -#include <tools/debug.hxx> #include <stdlib.h> // qsort #include <unotools/collatorwrapper.hxx> @@ -900,7 +899,7 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( size_t& nListCount, ScDocument* pDoc ) const { nListCount = maPairs.size(); - DBG_ASSERT( nListCount * sizeof(ScRangePairNameSort) <= (size_t)~0x1F, + OSL_ENSURE( nListCount * sizeof(ScRangePairNameSort) <= (size_t)~0x1F, "ScRangePairList::CreateNameSortedArray nListCount * sizeof(ScRangePairNameSort) > (size_t)~0x1F" ); ScRangePairNameSort* pSortArray = (ScRangePairNameSort*) new sal_uInt8 [ nListCount * sizeof(ScRangePairNameSort) ]; diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index df5f43617ae1..1a204cc574a1 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -32,7 +32,6 @@ //------------------------------------------------------------------------ -#include <tools/debug.hxx> #include <string.h> #include <memory> #include <unotools/collatorwrapper.hxx> @@ -190,7 +189,7 @@ void ScRangeData::GuessPosition() // setzt eine Position, mit der alle relative Referenzen bei CalcAbsIfRel // ohne Fehler verabsolutiert werden koennen - DBG_ASSERT(aPos == ScAddress(), "die Position geht jetzt verloren"); + OSL_ENSURE(aPos == ScAddress(), "die Position geht jetzt verloren"); SCsCOL nMinCol = 0; SCsROW nMinRow = 0; diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index 87c2a8f64556..3a6148f4ee0e 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -33,7 +33,6 @@ #include <svl/zforlist.hxx> #include <rtl/math.hxx> -#include <tools/debug.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -403,7 +402,7 @@ ScMatrixRef ScSequenceToMatrix::CreateMixedMatrix( const com::sun::star::uno::An xMatrix->GetDimensions( nCols, nRows); if (nCols != static_cast<SCSIZE>(nMaxColCount) || nRows != static_cast<SCSIZE>(nRowCount)) { - DBG_ERRORFILE( "ScSequenceToMatrix::CreateMixedMatrix: matrix exceeded max size, returning NULL matrix"); + OSL_FAIL( "ScSequenceToMatrix::CreateMixedMatrix: matrix exceeded max size, returning NULL matrix"); return NULL; } for (nRow=0; nRow<nRowCount; nRow++) diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index ae270a955c7f..b73ec5b81c96 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "rangeutl.hxx" #include "document.hxx" #include "global.hxx" @@ -116,7 +114,7 @@ sal_Bool ScRangeUtil::IsAbsTabArea( const String& rAreaStr, sal_Bool /* bAcceptCellRef */, ScAddress::Details const & rDetails ) const { - DBG_ASSERT( pDoc, "Kein Dokument uebergeben!" ); + OSL_ENSURE( pDoc, "Kein Dokument uebergeben!" ); if ( !pDoc ) return false; @@ -552,7 +550,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString( sal_Unicode cQuote ) { sal_Bool bRet = sal_True; - DBG_ASSERT( rRangeListStr.getLength(), "ScXMLConverter::GetRangeListFromString - empty string!" ); + OSL_ENSURE( rRangeListStr.getLength(), "ScXMLConverter::GetRangeListFromString - empty string!" ); sal_Int32 nOffset = 0; while( nOffset >= 0 ) { @@ -650,7 +648,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString( sal_Unicode cQuote ) { sal_Bool bRet = sal_True; - DBG_ASSERT( rRangeListStr.getLength(), "ScXMLConverter::GetRangeListFromString - empty string!" ); + OSL_ENSURE( rRangeListStr.getLength(), "ScXMLConverter::GetRangeListFromString - empty string!" ); table::CellRangeAddress aRange; sal_Int32 nOffset = 0; while( nOffset >= 0 ) @@ -833,8 +831,8 @@ static void lcl_appendCellRangeAddress( { if (rExtInfo1.mbExternal) { - DBG_ASSERT(rExtInfo2.mbExternal, "2nd address is not external!?"); - DBG_ASSERT(rExtInfo1.mnFileId == rExtInfo2.mnFileId, "File IDs do not match between 1st and 2nd addresses."); + OSL_ENSURE(rExtInfo2.mbExternal, "2nd address is not external!?"); + OSL_ENSURE(rExtInfo1.mnFileId == rExtInfo2.mnFileId, "File IDs do not match between 1st and 2nd addresses."); ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); const String* pFilePath = pRefMgr->getExternalFileName(rExtInfo1.mnFileId, true); diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index 47dee0c8b956..33f904bf9b68 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -33,8 +33,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "rechead.hxx" #include "scerrors.hxx" @@ -81,7 +79,7 @@ ScMultipleReadHeader::~ScMultipleReadHeader() { if ( pMemStream && pMemStream->Tell() != pMemStream->GetEndOfData() ) { - DBG_ERRORFILE( "Sizes nicht vollstaendig gelesen" ); + OSL_FAIL( "Sizes nicht vollstaendig gelesen" ); if ( rStream.GetError() == SVSTREAM_OK ) rStream.SetError( SCWARN_IMPORT_INFOLOST ); } @@ -94,7 +92,7 @@ ScMultipleReadHeader::~ScMultipleReadHeader() void ScMultipleReadHeader::EndEntry() { sal_uLong nPos = rStream.Tell(); - DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" ); + OSL_ENSURE( nPos <= nEntryEnd, "zuviel gelesen" ); if ( nPos != nEntryEnd ) { if ( rStream.GetError() == SVSTREAM_OK ) @@ -112,7 +110,7 @@ void ScMultipleReadHeader::StartEntry() (*pMemStream) >> nEntrySize; nEntryEnd = nPos + nEntrySize; - DBG_ASSERT( nEntryEnd <= nTotalEnd, "zuviele Eintraege gelesen" ); + OSL_ENSURE( nEntryEnd <= nTotalEnd, "zuviele Eintraege gelesen" ); } sal_uLong ScMultipleReadHeader::BytesLeft() const diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index e084b5e76d75..5b5ee4ce2969 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -31,8 +31,6 @@ // INCLUDE --------------------------------------------------------------- -#include <tools/debug.hxx> - #include "refupdat.hxx" #include "document.hxx" #include "compiler.hxx" @@ -376,7 +374,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo else if (eUpdateRefMode == URM_REORDER) { // bisher nur fuer nDz (MoveTab) - DBG_ASSERT ( !nDx && !nDy, "URM_REORDER fuer x und y noch nicht implementiert" ); + OSL_ENSURE ( !nDx && !nDy, "URM_REORDER fuer x und y noch nicht implementiert" ); if ( nDz && (theCol1 >= nCol1) && (theCol2 <= nCol2) && (theRow1 >= nRow1) && (theRow2 <= nRow2) ) @@ -870,7 +868,7 @@ void ScRefUpdate::DoTranspose( SCsCOL& rCol, SCsROW& rRow, SCsTAB& rTab, while (nNewTab>=nCount) nNewTab = sal::static_int_cast<SCsTAB>( nNewTab - nCount ); rTab = nNewTab; } - DBG_ASSERT( rCol>=rSource.aStart.Col() && rRow>=rSource.aStart.Row(), + OSL_ENSURE( rCol>=rSource.aStart.Col() && rRow>=rSource.aStart.Row(), "UpdateTranspose: Pos. falsch" ); SCsCOL nRelX = rCol - (SCsCOL)rSource.aStart.Col(); diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 904461bb9ff6..484eb6014c95 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include <tools/debug.hxx> - #include "scmatrix.hxx" #include "global.hxx" #include "address.hxx" @@ -350,7 +348,7 @@ void ScMatrixImpl::PutDouble(double fVal, SCSIZE nC, SCSIZE nR) maMat.set_numeric(nR, nC, fVal); else { - DBG_ERRORFILE("ScMatrixImpl::PutDouble: dimension error"); + OSL_FAIL("ScMatrixImpl::PutDouble: dimension error"); } } @@ -367,7 +365,7 @@ void ScMatrixImpl::PutString(const String& rStr, SCSIZE nC, SCSIZE nR) maMat.set_string(nR, nC, new String(rStr)); else { - DBG_ERRORFILE("ScMatrixImpl::PutString: dimension error"); + OSL_FAIL("ScMatrixImpl::PutString: dimension error"); } } @@ -387,7 +385,7 @@ void ScMatrixImpl::PutEmpty(SCSIZE nC, SCSIZE nR) } else { - DBG_ERRORFILE("ScMatrixImpl::PutEmpty: dimension error"); + OSL_FAIL("ScMatrixImpl::PutEmpty: dimension error"); } } @@ -400,7 +398,7 @@ void ScMatrixImpl::PutEmptyPath(SCSIZE nC, SCSIZE nR) } else { - DBG_ERRORFILE("ScMatrixImpl::PutEmptyPath: dimension error"); + OSL_FAIL("ScMatrixImpl::PutEmptyPath: dimension error"); } } @@ -415,7 +413,7 @@ void ScMatrixImpl::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) maMat.set_boolean(nR, nC, bVal); else { - DBG_ERRORFILE("ScMatrixImpl::PutBoolean: dimension error"); + OSL_FAIL("ScMatrixImpl::PutBoolean: dimension error"); } } @@ -428,7 +426,7 @@ sal_uInt16 ScMatrixImpl::GetError( SCSIZE nC, SCSIZE nR) const } else { - DBG_ERRORFILE("ScMatrixImpl::GetError: dimension error"); + OSL_FAIL("ScMatrixImpl::GetError: dimension error"); return errNoValue; } } @@ -448,7 +446,7 @@ double ScMatrixImpl::GetDouble(SCSIZE nC, SCSIZE nR) const } else { - DBG_ERRORFILE("ScMatrixImpl::GetDouble: dimension error"); + OSL_FAIL("ScMatrixImpl::GetDouble: dimension error"); return CreateDoubleError( errNoValue); } } @@ -469,12 +467,12 @@ const String& ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const else { SetErrorAtInterpreter( GetError(nC, nR)); - DBG_ERRORFILE("ScMatrixImpl::GetString: access error, no string"); + OSL_FAIL("ScMatrixImpl::GetString: access error, no string"); } } else { - DBG_ERRORFILE("ScMatrixImpl::GetString: dimension error"); + OSL_FAIL("ScMatrixImpl::GetString: dimension error"); } return ScGlobal::GetEmptyString(); } @@ -490,7 +488,7 @@ String ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE { if (!ValidColRowOrReplicated( nC, nR )) { - DBG_ERRORFILE("ScMatrixImpl::GetString: dimension error"); + OSL_FAIL("ScMatrixImpl::GetString: dimension error"); return String(); } @@ -553,7 +551,7 @@ ScMatrixValue ScMatrixImpl::Get(SCSIZE nC, SCSIZE nR) const } else { - DBG_ERRORFILE("ScMatrixImpl::Get: dimension error"); + OSL_FAIL("ScMatrixImpl::Get: dimension error"); } return aVal; } @@ -647,7 +645,7 @@ void ScMatrixImpl::MatCopy(ScMatrixImpl& mRes) const if (s1.first > s2.first || s1.second > s2.second) { // destination matrix is not large enough. - DBG_ERRORFILE("ScMatrixImpl::MatCopy: dimension error"); + OSL_FAIL("ScMatrixImpl::MatCopy: dimension error"); return; } @@ -670,7 +668,7 @@ void ScMatrixImpl::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE nC2, } else { - DBG_ERRORFILE("ScMatrixImpl::FillDouble: dimension error"); + OSL_FAIL("ScMatrixImpl::FillDouble: dimension error"); } } diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 95f44a3f19d0..df7cdd6e00e3 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -38,7 +38,6 @@ #include <string.h> #include <tools/mempool.hxx> -#include <tools/debug.hxx> #include <osl/diagnose.h> #include "token.hxx" @@ -655,83 +654,83 @@ FormulaTokenRef ScToken::ExtendRangeReference( FormulaToken & rTok1, FormulaToke const ScSingleRefData& ScToken::GetSingleRef() const { - DBG_ERRORFILE( "ScToken::GetSingleRef: virtual dummy called" ); + OSL_FAIL( "ScToken::GetSingleRef: virtual dummy called" ); static ScSingleRefData aDummySingleRef = lcl_ScToken_InitSingleRef(); return aDummySingleRef; } ScSingleRefData& ScToken::GetSingleRef() { - DBG_ERRORFILE( "ScToken::GetSingleRef: virtual dummy called" ); + OSL_FAIL( "ScToken::GetSingleRef: virtual dummy called" ); static ScSingleRefData aDummySingleRef = lcl_ScToken_InitSingleRef(); return aDummySingleRef; } const ScComplexRefData& ScToken::GetDoubleRef() const { - DBG_ERRORFILE( "ScToken::GetDoubleRef: virtual dummy called" ); + OSL_FAIL( "ScToken::GetDoubleRef: virtual dummy called" ); static ScComplexRefData aDummyDoubleRef = lcl_ScToken_InitDoubleRef(); return aDummyDoubleRef; } ScComplexRefData& ScToken::GetDoubleRef() { - DBG_ERRORFILE( "ScToken::GetDoubleRef: virtual dummy called" ); + OSL_FAIL( "ScToken::GetDoubleRef: virtual dummy called" ); static ScComplexRefData aDummyDoubleRef = lcl_ScToken_InitDoubleRef(); return aDummyDoubleRef; } const ScSingleRefData& ScToken::GetSingleRef2() const { - DBG_ERRORFILE( "ScToken::GetSingleRef2: virtual dummy called" ); + OSL_FAIL( "ScToken::GetSingleRef2: virtual dummy called" ); static ScSingleRefData aDummySingleRef = lcl_ScToken_InitSingleRef(); return aDummySingleRef; } ScSingleRefData& ScToken::GetSingleRef2() { - DBG_ERRORFILE( "ScToken::GetSingleRef2: virtual dummy called" ); + OSL_FAIL( "ScToken::GetSingleRef2: virtual dummy called" ); static ScSingleRefData aDummySingleRef = lcl_ScToken_InitSingleRef(); return aDummySingleRef; } void ScToken::CalcAbsIfRel( const ScAddress& /* rPos */ ) { - DBG_ERRORFILE( "ScToken::CalcAbsIfRel: virtual dummy called" ); + OSL_FAIL( "ScToken::CalcAbsIfRel: virtual dummy called" ); } void ScToken::CalcRelFromAbs( const ScAddress& /* rPos */ ) { - DBG_ERRORFILE( "ScToken::CalcRelFromAbs: virtual dummy called" ); + OSL_FAIL( "ScToken::CalcRelFromAbs: virtual dummy called" ); } const ScMatrix* ScToken::GetMatrix() const { - DBG_ERRORFILE( "ScToken::GetMatrix: virtual dummy called" ); + OSL_FAIL( "ScToken::GetMatrix: virtual dummy called" ); return NULL; } ScMatrix* ScToken::GetMatrix() { - DBG_ERRORFILE( "ScToken::GetMatrix: virtual dummy called" ); + OSL_FAIL( "ScToken::GetMatrix: virtual dummy called" ); return NULL; } ScJumpMatrix* ScToken::GetJumpMatrix() const { - DBG_ERRORFILE( "ScToken::GetJumpMatrix: virtual dummy called" ); + OSL_FAIL( "ScToken::GetJumpMatrix: virtual dummy called" ); return NULL; } const ScRefList* ScToken::GetRefList() const { - DBG_ERRORFILE( "ScToken::GetRefList: virtual dummy called" ); + OSL_FAIL( "ScToken::GetRefList: virtual dummy called" ); return NULL; } ScRefList* ScToken::GetRefList() { - DBG_ERRORFILE( "ScToken::GetRefList: virtual dummy called" ); + OSL_FAIL( "ScToken::GetRefList: virtual dummy called" ); return NULL; } // ========================================================================== @@ -1086,7 +1085,7 @@ void ScMatrixFormulaCellToken::Assign( const formula::FormulaToken& r ) ScMatrixCellResultToken::Assign( *p); else { - DBG_ASSERT( r.GetType() != svMatrix, "ScMatrixFormulaCellToken::operator=: assigning ScMatrixToken to ScMatrixFormulaCellToken is not proper, use ScMatrixCellResultToken instead"); + OSL_ENSURE( r.GetType() != svMatrix, "ScMatrixFormulaCellToken::operator=: assigning ScMatrixToken to ScMatrixFormulaCellToken is not proper, use ScMatrixCellResultToken instead"); if (r.GetType() == svMatrix) { xUpperLeft = NULL; @@ -1115,7 +1114,7 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f ) // fall thru default: { - DBG_ERRORFILE("ScMatrixFormulaCellToken::SetUpperLeftDouble: not modifying unhandled token type"); + OSL_FAIL("ScMatrixFormulaCellToken::SetUpperLeftDouble: not modifying unhandled token type"); } } } @@ -1669,7 +1668,7 @@ sal_Bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend, return false; break; default: - DBG_ERRORFILE( "unknown Direction" ); + OSL_FAIL( "unknown Direction" ); return false; } if ( pRPN && nRPN ) diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index fdf8c8581d26..b8b3d5456df5 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -277,7 +277,7 @@ String ScTpViewItem::GetValueText() const int ScTpViewItem::operator==( const SfxPoolItem& rItem ) const { - DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); + OSL_ENSURE( SfxPoolItem::operator==( rItem ), "unequal Which or Type" ); const ScTpViewItem& rPItem = (const ScTpViewItem&)rItem; @@ -428,12 +428,12 @@ ScViewCfg::ScViewCfg() : Sequence<Any> aValues = aLayoutItem.GetProperties(aNames); aLayoutItem.EnableNotification(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -483,12 +483,12 @@ ScViewCfg::ScViewCfg() : aValues = aDisplayItem.GetProperties(aNames); aDisplayItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) @@ -549,12 +549,12 @@ ScViewCfg::ScViewCfg() : aValues = aGridItem.GetProperties(aNames); aGridItem.EnableNotification(aNames); pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - DBG_ASSERT(pValues[nProp].hasValue(), "property value missing"); + OSL_ENSURE(pValues[nProp].hasValue(), "property value missing"); if(pValues[nProp].hasValue()) { switch(nProp) diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index 9fd1b6f9ed36..6d8266beb4fd 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -32,7 +32,6 @@ #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <vcl/svapp.hxx> -#include <tools/debug.hxx> #include "zforauto.hxx" #include "global.hxx" diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index bb491aa371b9..77ab17192b9d 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2419,7 +2419,7 @@ void ScChart2DataSequence::BuildDataCache() } } break; -#if DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 case CELLTYPE_DESTROYED: #endif case CELLTYPE_EDIT: |