diff options
author | Jacek Wolszczak <shutdownrunner@gmail.com> | 2011-05-21 16:01:56 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-27 06:03:38 +0200 |
commit | 2fdfcbfad3a6d4e85a2ffa1206d1dd06dc9699a5 (patch) | |
tree | 5994165df230e5db4a955f548c1903d4b6216490 | |
parent | 8b569e74d6b671c13a57c5ad72ed360d194b2dda (diff) |
Replace DBG_* with OSL_* in sc/source/filter
100 files changed, 715 insertions, 715 deletions
diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx index 9ebf05f31080..6e530505074d 100644 --- a/sc/source/filter/dif/difexp.cxx +++ b/sc/source/filter/dif/difexp.cxx @@ -65,8 +65,8 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rStream, ScDocument* p FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc, const ScRange&rRange, const CharSet eCharSet, sal_uInt32 nDifOption ) { - DBG_ASSERT( rRange.aStart <= rRange.aEnd, "*ScExportDif(): Range unsortiert!" ); - DBG_ASSERTWARNING( rRange.aStart.Tab() == rRange.aEnd.Tab(), + OSL_ENSURE( rRange.aStart <= rRange.aEnd, "*ScExportDif(): Range unsortiert!" ); + OSL_ENSURE( rRange.aStart.Tab() == rRange.aEnd.Tab(), "ScExportDif(): nur eine Tabelle bidde!" ); const CharSet eStreamCharSet = rOut.GetStreamCharSet(); @@ -124,7 +124,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc aPrgrsBar.SetState( 0 ); // TABLE - DBG_ASSERT( pDoc->HasTable( nTab ), "*ScExportDif(): Tabelle nicht vorhanden!" ); + OSL_ENSURE( pDoc->HasTable( nTab ), "*ScExportDif(): Tabelle nicht vorhanden!" ); aOS = pKeyTABLE; aOS.AppendAscii( "\n0,1\n\"" ); diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 18d0c532fff9..d3b47210d0ea 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -129,7 +129,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, case T_UNKNOWN: break; default: - DBG_ERRORFILE( "ScImportDif - missing enum" ); + OSL_FAIL( "ScImportDif - missing enum" ); } } @@ -249,7 +249,7 @@ DifParser::DifParser( SvStream& rNewIn, const sal_uInt32 nOption, ScDocument& rD eCharSet = e; if ( rIn.GetStreamCharSet() != eCharSet ) { - DBG_ERRORFILE( "CharSet passed overrides and modifies StreamCharSet" ); + OSL_FAIL( "CharSet passed overrides and modifies StreamCharSet" ); rIn.SetStreamCharSet( eCharSet ); } rIn.StartReadingUnicodeText( eCharSet ); @@ -378,7 +378,7 @@ TOPIC DifParser::GetNextTopic( void ) } break; case S_Data: - DBG_ASSERT( aLine.Len() >= 2, + OSL_ENSURE( aLine.Len() >= 2, "+GetNextTopic(): <String> ist zu kurz!" ); if( aLine.Len() > 2 ) aData = aLine.Copy( 1, aLine.Len() - 2 ); @@ -387,7 +387,7 @@ TOPIC DifParser::GetNextTopic( void ) eS = S_END; break; case S_END: - DBG_ERRORFILE( "DifParser::GetNextTopic - unexpected state" ); + OSL_FAIL( "DifParser::GetNextTopic - unexpected state" ); break; case S_UNKNOWN: // 2 Zeilen ueberlesen @@ -398,7 +398,7 @@ TOPIC DifParser::GetNextTopic( void ) eS = S_END; break; default: - DBG_ERRORFILE( "DifParser::GetNextTopic - missing enum" ); + OSL_FAIL( "DifParser::GetNextTopic - missing enum" ); } } @@ -435,7 +435,7 @@ DATASET DifParser::GetNumberDataset( const sal_Unicode* pPossibleNumericData ) } else { // ...und zur Strafe mit'm Numberformatter... - DBG_ASSERT( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" ); + OSL_ENSURE( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" ); String aTestVal( pPossibleNumericData ); sal_uInt32 nFormat = 0; double fTmpVal; @@ -472,7 +472,7 @@ bool DifParser::LookAhead() const sal_Unicode* pAktBuffer; bool bValidStructure = false; - DBG_ASSERT( aLookAheadLine.Len() == 0, "*DifParser::LookAhead(): LookAhead called twice in a row" ); + OSL_ENSURE( aLookAheadLine.Len() == 0, "*DifParser::LookAhead(): LookAhead called twice in a row" ); rIn.ReadUniOrByteStringLine( aLookAheadLine ); pAktBuffer = aLookAheadLine.GetBuffer(); @@ -795,10 +795,10 @@ sal_Bool DifParser::ScanFloatVal( const sal_Unicode* pStart ) } break; case S_END: - DBG_ERRORFILE( "DifParser::ScanFloatVal - unexpected state" ); + OSL_FAIL( "DifParser::ScanFloatVal - unexpected state" ); break; default: - DBG_ERRORFILE( "DifParser::ScanFloatVal - missing enum" ); + OSL_FAIL( "DifParser::ScanFloatVal - missing enum" ); } pStart++; } @@ -829,11 +829,11 @@ DifColumn::DifColumn () void DifColumn::SetLogical( SCROW nRow ) { - DBG_ASSERT( ValidRow(nRow), "*DifColumn::SetLogical(): Row zu gross!" ); + OSL_ENSURE( ValidRow(nRow), "*DifColumn::SetLogical(): Row zu gross!" ); if( pAkt ) { - DBG_ASSERT( nRow > 0, "*DifColumn::SetLogical(): weitere koennen nicht 0 sein!" ); + OSL_ENSURE( nRow > 0, "*DifColumn::SetLogical(): weitere koennen nicht 0 sein!" ); nRow--; @@ -854,15 +854,15 @@ void DifColumn::SetLogical( SCROW nRow ) void DifColumn::SetNumFormat( SCROW nRow, const sal_uInt32 nNumFormat ) { - DBG_ASSERT( ValidRow(nRow), "*DifColumn::SetNumFormat(): Row zu gross!" ); + OSL_ENSURE( ValidRow(nRow), "*DifColumn::SetNumFormat(): Row zu gross!" ); if( nNumFormat > 0 ) { if(pAkt) { - DBG_ASSERT( nRow > 0, + OSL_ENSURE( nRow > 0, "*DifColumn::SetNumFormat(): weitere koennen nicht 0 sein!" ); - DBG_ASSERT( nRow > pAkt->nEnd, + OSL_ENSURE( nRow > pAkt->nEnd, "*DifColumn::SetNumFormat(): Noch 'mal von vorne?" ); if( pAkt->nNumFormat == nNumFormat && pAkt->nEnd == nRow - 1 ) @@ -902,7 +902,7 @@ void DifColumn::Apply( ScDocument& rDoc, const SCCOL nCol, const SCTAB nTab ) for (boost::ptr_vector<ENTRY>::const_iterator it = aEntries.begin(); it != aEntries.end(); ++it) { - DBG_ASSERT( it->nNumFormat > 0, + OSL_ENSURE( it->nNumFormat > 0, "+DifColumn::Apply(): Numberformat darf hier nicht 0 sein!" ); rItemSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, it->nNumFormat ) ); @@ -934,8 +934,8 @@ DifAttrCache::~DifAttrCache() void DifAttrCache::SetLogical( const SCCOL nCol, const SCROW nRow ) { - DBG_ASSERT( ValidCol(nCol), "-DifAttrCache::SetLogical(): Col zu gross!" ); - DBG_ASSERT( bPlain, "*DifAttrCache::SetLogical(): muss Plain sein!" ); + OSL_ENSURE( ValidCol(nCol), "-DifAttrCache::SetLogical(): Col zu gross!" ); + OSL_ENSURE( bPlain, "*DifAttrCache::SetLogical(): muss Plain sein!" ); if( !ppCols[ nCol ] ) ppCols[ nCol ] = new DifColumn; @@ -945,8 +945,8 @@ void DifAttrCache::SetLogical( const SCCOL nCol, const SCROW nRow ) void DifAttrCache::SetNumFormat( const SCCOL nCol, const SCROW nRow, const sal_uInt32 nNumFormat ) { - DBG_ASSERT( ValidCol(nCol), "-DifAttrCache::SetNumFormat(): Col zu gross!" ); - DBG_ASSERT( !bPlain, "*DifAttrCache::SetNumFormat(): sollte nicht Plain sein!" ); + OSL_ENSURE( ValidCol(nCol), "-DifAttrCache::SetNumFormat(): Col zu gross!" ); + OSL_ENSURE( !bPlain, "*DifAttrCache::SetNumFormat(): sollte nicht Plain sein!" ); if( !ppCols[ nCol ] ) ppCols[ nCol ] = new DifColumn; diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index 17270c14fc00..1d7606079597 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -93,7 +93,7 @@ void XclImpColRowSettings::SetDefWidth( sal_uInt16 nDefWidth, bool bStdWidthRec void XclImpColRowSettings::SetWidthRange( SCCOL nScCol1, SCCOL nScCol2, sal_uInt16 nWidth ) { - DBG_ASSERT( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetColWidthRange - invalid column range" ); + OSL_ENSURE( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetColWidthRange - invalid column range" ); nScCol2 = ::std::min( nScCol2, MAXCOL ); if (nScCol2 == 256) // In BIFF8, the column range is 0-255, and the use of 256 probably @@ -115,7 +115,7 @@ void XclImpColRowSettings::HideCol( SCCOL nScCol ) void XclImpColRowSettings::HideColRange( SCCOL nScCol1, SCCOL nScCol2 ) { - DBG_ASSERT( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::HideColRange - invalid column range" ); + OSL_ENSURE( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::HideColRange - invalid column range" ); nScCol2 = ::std::min( nScCol2, MAXCOL ); nScCol1 = ::std::min( nScCol1, nScCol2 ); for( ScfUInt8Vec::iterator aIt = maColFlags.begin() + nScCol1, aEnd = maColFlags.begin() + nScCol2 + 1; aIt != aEnd; ++aIt ) @@ -195,7 +195,7 @@ void XclImpColRowSettings::SetDefaultXF( SCCOL nScCol1, SCCOL nScCol2, sal_uInt1 { /* assign the default column formatting here to ensure that explicit cell formatting is not overwritten. */ - DBG_ASSERT( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetDefaultXF - invalid column index" ); + OSL_ENSURE( (nScCol1 <= nScCol2) && ValidCol( nScCol2 ), "XclImpColRowSettings::SetDefaultXF - invalid column index" ); nScCol2 = ::std::min( nScCol2, MAXCOL ); nScCol1 = ::std::min( nScCol1, nScCol2 ); XclImpXFRangeBuffer& rXFRangeBuffer = GetXFRangeBuffer(); diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 27577ba5f34f..204861ddd441 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -174,7 +174,7 @@ ExcTable::~ExcTable() void ExcTable::Add( XclExpRecordBase* pRec ) { - DBG_ASSERT( pRec, "-ExcTable::Add(): pRec ist NULL!" ); + OSL_ENSURE( pRec, "-ExcTable::Add(): pRec ist NULL!" ); aRecList.AppendNewRecord( pRec ); } @@ -421,8 +421,8 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx ) XclBiff eBiff = GetBiff(); ScDocument& rDoc = GetDoc(); - DBG_ASSERT( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" ); - DBG_ASSERT( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" ); + OSL_ENSURE( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" ); + OSL_ENSURE( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" ); // create a new OBJ list for this sheet (may be used by notes, autofilter, data validation) if( eBiff == EXC_BIFF8 ) diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 4bd3654caa64..63be2457246e 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -58,20 +58,20 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPFORMAT eFormat ) { // check the passed Calc document - DBG_ASSERT( pDocument, "::ScImportExcel - no document" ); + OSL_ENSURE( pDocument, "::ScImportExcel - no document" ); if( !pDocument ) return eERR_INTERN; // should not happen /* Import all BIFF versions regardless on eFormat, needed for import of external cells (file type detection returns Excel4.0). */ if( (eFormat != EIF_AUTO) && (eFormat != EIF_BIFF_LE4) && (eFormat != EIF_BIFF5) && (eFormat != EIF_BIFF8) ) { - DBG_ERRORFILE( "::ScImportExcel - wrong file format specification" ); + OSL_FAIL( "::ScImportExcel - wrong file format specification" ); return eERR_FORMAT; } // check the input stream from medium SvStream* pMedStrm = rMedium.GetInStream(); - DBG_ASSERT( pMedStrm, "::ScImportExcel - medium without input stream" ); + OSL_ENSURE( pMedStrm, "::ScImportExcel - medium without input stream" ); if( !pMedStrm ) return eERR_OPEN; // should not happen #if OSL_DEBUG_LEVEL > 0 @@ -278,12 +278,12 @@ FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocumen return eERR_NI; // check the passed Calc document - DBG_ASSERT( pDocument, "::ScImportExcel - no document" ); + OSL_ENSURE( pDocument, "::ScImportExcel - no document" ); if( !pDocument ) return eERR_INTERN; // should not happen // check the output stream from medium SvStream* pMedStrm = rMedium.GetOutStream(); - DBG_ASSERT( pMedStrm, "::ScExportExcel5 - medium without output stream" ); + OSL_ENSURE( pMedStrm, "::ScExportExcel5 - medium without output stream" ); if( !pMedStrm ) return eERR_OPEN; // should not happen FltError eRet = eERR_UNKN_BIFF; diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 949cb0fb0615..bac5552d6430 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -1322,7 +1322,7 @@ ConvErr ExcelToSc::ConvertExternName( const ScTokenArray*& /*rpArray*/, XclImpSt sal_Bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Size nLen ) { - DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF5 ); + OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF5 ); if( GetBiff() != EXC_BIFF5 ) return false; @@ -1823,13 +1823,13 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) pMatrix->GetDimensions( nC, nR); if( nC != nCols || nR != nRows ) { - DBG_ERRORFILE( "ExcelToSc::ReadExtensionArray - matrix size mismatch" ); + OSL_FAIL( "ExcelToSc::ReadExtensionArray - matrix size mismatch" ); pMatrix = NULL; } } else { - DBG_ERRORFILE( "ExcelToSc::ReadExtensionArray - missing matrix" ); + OSL_FAIL( "ExcelToSc::ReadExtensionArray - missing matrix" ); } for( nR = 0 ; nR < nRows; nR++ ) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 8bdd4bc69b5f..801cdc594f10 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -267,7 +267,7 @@ void ImportExcel8::Boundsheet( void ) SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); if( nScTab > 0 ) { - DBG_ASSERT( !pD->HasTable( nScTab ), "ImportExcel8::Boundsheet - sheet exists already" ); + OSL_ENSURE( !pD->HasTable( nScTab ), "ImportExcel8::Boundsheet - sheet exists already" ); pD->MakeTable( nScTab ); } diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 5ffa7f035ab7..98c677c7a819 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -431,7 +431,7 @@ ExcBundlesheet::ExcBundlesheet( RootData& rRootData, SCTAB _nTab ) : ExcBundlesheetBase( rRootData, _nTab ) { String sTabName = rRootData.pER->GetTabInfo().GetScTabName( _nTab ); - DBG_ASSERT( sTabName.Len() < 256, "ExcBundlesheet::ExcBundlesheet - table name too long" ); + OSL_ENSURE( sTabName.Len() < 256, "ExcBundlesheet::ExcBundlesheet - table name too long" ); aName = ByteString( sTabName, rRootData.pER->GetTextEncoding() ); } @@ -610,7 +610,7 @@ void ExcFilterCondition::Save( XclExpStream& rStrm ) rStrm << fVal; break; case EXC_AFTYPE_STRING: - DBG_ASSERT( pText, "ExcFilterCondition::Save() -- pText is NULL!" ); + OSL_ENSURE( pText, "ExcFilterCondition::Save() -- pText is NULL!" ); rStrm << (sal_uInt32)0 << (sal_uInt8) pText->Len() << (sal_uInt16)0 << (sal_uInt8)0; break; case EXC_AFTYPE_BOOLERR: @@ -662,7 +662,7 @@ void ExcFilterCondition::SaveText( XclExpStream& rStrm ) { if( nType == EXC_AFTYPE_STRING ) { - DBG_ASSERT( pText, "ExcFilterCondition::SaveText() -- pText is NULL!" ); + OSL_ENSURE( pText, "ExcFilterCondition::SaveText() -- pText is NULL!" ); pText->WriteFlagField( rStrm ); pText->WriteBuffer( rStrm ); } diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index 4cfedccea8f5..b63e5e674e0c 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -133,7 +133,7 @@ void XclImpOutlineBuffer::MakeScOutline() if (nPos >= mnEndPos) { // Don't go beyond the max allowed position. - DBG_ASSERT(aOutlineStack.empty(), "XclImpOutlineBuffer::MakeScOutline: outline stack not empty but expected to be."); + OSL_ENSURE(aOutlineStack.empty(), "XclImpOutlineBuffer::MakeScOutline: outline stack not empty but expected to be."); break; } sal_uInt8 nLevel = itr->second; @@ -145,7 +145,7 @@ void XclImpOutlineBuffer::MakeScOutline() } else { - DBG_ASSERT(nLevel < nCurLevel, "XclImpOutlineBuffer::MakeScOutline: unexpected level!"); + OSL_ENSURE(nLevel < nCurLevel, "XclImpOutlineBuffer::MakeScOutline: unexpected level!"); for (sal_uInt8 i = 0; i < nCurLevel - nLevel; ++i) { if (aOutlineStack.empty()) diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index f52c0d7feec2..553ab2e28794 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -79,10 +79,10 @@ ExportBiff5::~ExportBiff5() FltError ExportBiff5::Write() { SfxObjectShell* pDocShell = GetDocShell(); - DBG_ASSERT( pDocShell, "ExportBiff5::Write - no document shell" ); + OSL_ENSURE( pDocShell, "ExportBiff5::Write - no document shell" ); SotStorageRef xRootStrg = GetRootStorage(); - DBG_ASSERT( xRootStrg.Is(), "ExportBiff5::Write - no root storage" ); + OSL_ENSURE( xRootStrg.Is(), "ExportBiff5::Write - no root storage" ); bool bWriteBasicCode = false; bool bWriteBasicStrg = false; diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx index 26db50f0166f..1efb03b7ca6b 100644 --- a/sc/source/filter/excel/fontbuff.cxx +++ b/sc/source/filter/excel/fontbuff.cxx @@ -96,7 +96,7 @@ void LotusFontBuffer::Fill( const sal_uInt8 nIndex, SfxItemSet& rItemSet ) void LotusFontBuffer::SetName( const sal_uInt16 nIndex, const String& rName ) { - DBG_ASSERT( nIndex < nSize, "*LotusFontBuffer::SetName(): Array zu klein!" ); + OSL_ENSURE( nIndex < nSize, "*LotusFontBuffer::SetName(): Array zu klein!" ); if( nIndex < nSize ) { register ENTRY* pEntry = pData + nIndex; @@ -110,7 +110,7 @@ void LotusFontBuffer::SetName( const sal_uInt16 nIndex, const String& rName ) void LotusFontBuffer::SetHeight( const sal_uInt16 nIndex, const sal_uInt16 nHeight ) { - DBG_ASSERT( nIndex < nSize, "*LotusFontBuffer::SetHeight(): Array zu klein!" ); + OSL_ENSURE( nIndex < nSize, "*LotusFontBuffer::SetHeight(): Array zu klein!" ); if( nIndex < nSize ) pData[ nIndex ].Height( *( new SvxFontHeightItem( ( sal_uLong ) nHeight * 20, 100, ATTR_FONT_HEIGHT ) ) ); } @@ -118,7 +118,7 @@ void LotusFontBuffer::SetHeight( const sal_uInt16 nIndex, const sal_uInt16 nHeig void LotusFontBuffer::SetType( const sal_uInt16 nIndex, const sal_uInt16 nType ) { - DBG_ASSERT( nIndex < nSize, "*LotusFontBuffer::SetType(): Array zu klein!" ); + OSL_ENSURE( nIndex < nSize, "*LotusFontBuffer::SetType(): Array zu klein!" ); if( nIndex < nSize ) { register ENTRY* pEntry = pData + nIndex; diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx index 81706ce5cb7d..8033d035f710 100644 --- a/sc/source/filter/excel/frmbase.cxx +++ b/sc/source/filter/excel/frmbase.cxx @@ -55,7 +55,7 @@ void _ScRangeListTabs::Append( ScSingleRefData a, SCTAB nTab, const bool b ) } else { - DBG_ASSERT( ValidTab(a.nTab), "-_ScRangeListTabs::Append(): Luegen haben kurze Abstuerze!" ); + OSL_ENSURE( ValidTab(a.nTab), "-_ScRangeListTabs::Append(): Luegen haben kurze Abstuerze!" ); } if( nTab == SCTAB_MAX) @@ -122,9 +122,9 @@ void _ScRangeListTabs::Append( ScComplexRefData a, SCTAB nTab, bool b ) } else { - DBG_ASSERT( ValidTab(a.Ref1.nTab), + OSL_ENSURE( ValidTab(a.Ref1.nTab), "-_ScRangeListTabs::Append(): Luegen haben kurze Abstuerze!" ); - DBG_ASSERT( a.Ref1.nTab == a.Ref2.nTab, + OSL_ENSURE( a.Ref1.nTab == a.Ref2.nTab, "+_ScRangeListTabs::Append(): 3D-Ranges werden in SC nicht unterstuetzt!" ); } @@ -157,7 +157,7 @@ void _ScRangeListTabs::Append( ScComplexRefData a, SCTAB nTab, bool b ) const ScRange* _ScRangeListTabs::First( SCTAB n ) { - DBG_ASSERT( ValidTab(n), "-_ScRangeListTabs::First(): Und tschuessssssss!" ); + OSL_ENSURE( ValidTab(n), "-_ScRangeListTabs::First(): Und tschuessssssss!" ); TabRangeType::iterator itr = maTabRanges.find(n); if (itr == maTabRanges.end()) @@ -184,7 +184,7 @@ ConverterBase::ConverterBase( sal_uInt16 nNewBuffer ) : eStatus( ConvOK ), nBufferSize( nNewBuffer ) { - DBG_ASSERT( nNewBuffer > 0, "ConverterBase::ConverterBase - nNewBuffer == 0!" ); + OSL_ENSURE( nNewBuffer > 0, "ConverterBase::ConverterBase - nNewBuffer == 0!" ); pBuffer = new sal_Char[ nNewBuffer ]; } diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 9ad703da3b0e..d98376f6af41 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -472,7 +472,7 @@ void ImportExcel::Columndefault( void ) aIn >> nColMic >> nColMac; - DBG_ASSERT( aIn.GetRecLeft() == (sal_Size)(nColMac - nColMic) * 3 + 2, + OSL_ENSURE( aIn.GetRecLeft() == (sal_Size)(nColMac - nColMic) * 3 + 2, "ImportExcel::Columndefault - wrong record size" ); nColMac--; @@ -518,7 +518,7 @@ void ImportExcel::Array25( void ) static_cast<SCROW>(nFirstRow), GetCurrScTab() ) ); pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); - DBG_ASSERT( pErgebnis, "*ImportExcel::Array25(): ScTokenArray ist NULL!" ); + OSL_ENSURE( pErgebnis, "*ImportExcel::Array25(): ScTokenArray ist NULL!" ); ScMarkData aMarkData; aMarkData.SelectOneTable( GetCurrScTab() ); @@ -707,7 +707,7 @@ void ImportExcel::Boundsheet( void ) SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); if( nScTab > 0 ) { - DBG_ASSERT( !pD->HasTable( nScTab ), "ImportExcel::Boundsheet - sheet exists already" ); + OSL_ENSURE( !pD->HasTable( nScTab ), "ImportExcel::Boundsheet - sheet exists already" ); pD->MakeTable( nScTab ); } @@ -817,7 +817,7 @@ void ImportExcel::Shrfmla( void ) pFormConv->Convert( pErgebnis, maStrm, nLenExpr, true, FT_SharedFormula ); - DBG_ASSERT( pErgebnis, "+ImportExcel::Shrfmla(): ScTokenArray ist NULL!" ); + OSL_ENSURE( pErgebnis, "+ImportExcel::Shrfmla(): ScTokenArray ist NULL!" ); pExcRoot->pShrfmlaBuff->Store( ScRange( static_cast<SCCOL>(nFirstCol), static_cast<SCROW>(nFirstRow), GetCurrScTab(), @@ -958,7 +958,7 @@ void ImportExcel::Bof3( void ) maStrm.Ignore( 2 ); maStrm >> nSubType; - DBG_ASSERT( nSubType != 0x0100, "*ImportExcel::Bof3(): Biff3 als Workbook?!" ); + OSL_ENSURE( nSubType != 0x0100, "*ImportExcel::Bof3(): Biff3 als Workbook?!" ); if( nSubType == 0x0100 ) // Book pExcRoot->eDateiTyp = Biff3W; else if( nSubType == 0x0020 ) // Chart @@ -988,7 +988,7 @@ void ImportExcel::Array34( void ) static_cast<SCROW>(nFirstRow), GetCurrScTab() ) ); pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); - DBG_ASSERT( pErgebnis, "+ImportExcel::Array34(): ScTokenArray ist NULL!" ); + OSL_ENSURE( pErgebnis, "+ImportExcel::Array34(): ScTokenArray ist NULL!" ); ScMarkData aMarkData; aMarkData.SelectOneTable( GetCurrScTab() ); diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index fe388a218e95..802eaf8d9066 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -79,7 +79,7 @@ NameBuffer::~NameBuffer() //void NameBuffer::operator <<( const SpString &rNewString ) void NameBuffer::operator <<( const String &rNewString ) { - DBG_ASSERT( Count() + nBase < 0xFFFF, + OSL_ENSURE( Count() + nBase < 0xFFFF, "*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" ); List::Insert( new StringHashEntry( rNewString ), LIST_APPEND ); @@ -122,7 +122,7 @@ void ShrfmlaBuffer::Store( const ScRange& rRange, const ScTokenArray& rToken ) { String aName( CreateName( rRange.aStart ) ); - DBG_ASSERT( mnCurrIdx <= 0xFFFF, "*ShrfmlaBuffer::Store(): Gleich wird mir schlecht...!" ); + OSL_ENSURE( mnCurrIdx <= 0xFFFF, "*ShrfmlaBuffer::Store(): Gleich wird mir schlecht...!" ); ScRangeData* pData = new ScRangeData( pExcRoot->pIR->GetDocPtr(), aName, rToken, rRange.aStart, RT_SHARED ); const ScAddress& rMaxPos = pExcRoot->pIR->GetMaxPos(); @@ -191,7 +191,7 @@ sal_Int16 ExtSheetBuffer::Add( const String& rFPAN, const String& rTN, const sal sal_Bool ExtSheetBuffer::GetScTabIndex( sal_uInt16 nExcIndex, sal_uInt16& rScIndex ) { - DBG_ASSERT( nExcIndex, + OSL_ENSURE( nExcIndex, "*ExtSheetBuffer::GetScTabIndex(): Sheet-Index == 0!" ); nExcIndex--; @@ -248,7 +248,7 @@ sal_Bool ExtSheetBuffer::GetScTabIndex( sal_uInt16 nExcIndex, sal_uInt16& rScInd sal_Bool ExtSheetBuffer::IsLink( const sal_uInt16 nExcIndex ) const { - DBG_ASSERT( nExcIndex > 0, "*ExtSheetBuffer::IsLink(): Index muss >0 sein!" ); + OSL_ENSURE( nExcIndex > 0, "*ExtSheetBuffer::IsLink(): Index muss >0 sein!" ); Cont* pRet = ( Cont * ) List::GetObject( nExcIndex - 1 ); if( pRet ) @@ -260,7 +260,7 @@ sal_Bool ExtSheetBuffer::IsLink( const sal_uInt16 nExcIndex ) const sal_Bool ExtSheetBuffer::GetLink( const sal_uInt16 nExcIndex, String& rAppl, String& rDoc ) const { - DBG_ASSERT( nExcIndex > 0, "*ExtSheetBuffer::GetLink(): Index muss >0 sein!" ); + OSL_ENSURE( nExcIndex > 0, "*ExtSheetBuffer::GetLink(): Index muss >0 sein!" ); Cont* pRet = ( Cont * ) List::GetObject( nExcIndex - 1 ); if( pRet ) @@ -331,7 +331,7 @@ void ExtNameBuff::AddName( const String& rName, sal_Int16 nRefIdx ) const ExtName* ExtNameBuff::GetNameByIndex( sal_Int16 nRefIdx, sal_uInt16 nNameIdx ) const { - DBG_ASSERT( nNameIdx > 0, "ExtNameBuff::GetNameByIndex() - invalid name index" ); + OSL_ENSURE( nNameIdx > 0, "ExtNameBuff::GetNameByIndex() - invalid name index" ); ExtNameMap::const_iterator aIt = maExtNames.find( nRefIdx ); return ((aIt != maExtNames.end()) && (0 < nNameIdx) && (nNameIdx <= aIt->second.size())) ? &aIt->second[ nNameIdx - 1 ] : 0; } diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index 96e68a9df01f..e5284f3211f2 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -93,7 +93,7 @@ FltError ImportExcel::Read( void ) sal_uInt16 nOpcode; sal_uInt16 nBofLevel = 0; - DBG_ASSERT( &aIn != NULL, "-ImportExcel::Read(): Kein Stream - wie dass?!" ); + OSL_ENSURE( &aIn != NULL, "-ImportExcel::Read(): Kein Stream - wie dass?!" ); ::std::auto_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar( aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) ); @@ -723,7 +723,7 @@ FltError ImportExcel::Read( void ) ePrev = eAkt; eAkt = Z_Biffn0; } - DBG_ASSERT( pExcRoot->eDateiTyp != Biff5W, + OSL_ENSURE( pExcRoot->eDateiTyp != Biff5W, "+ImportExcel::Read(): Doppel-Whopper-Workbook!" ); break; @@ -885,11 +885,11 @@ FltError ImportExcel8::Read( void ) switch( nRecId ) { case EXC_ID_USERSVIEWBEGIN: - DBG_ASSERT( !bInUserView, "ImportExcel8::Read - nested user view settings" ); + OSL_ENSURE( !bInUserView, "ImportExcel8::Read - nested user view settings" ); bInUserView = true; break; case EXC_ID_USERSVIEWEND: - DBG_ASSERT( bInUserView, "ImportExcel8::Read - not in user view settings" ); + OSL_ENSURE( bInUserView, "ImportExcel8::Read - not in user view settings" ); bInUserView = false; break; } @@ -902,7 +902,7 @@ FltError ImportExcel8::Read( void ) { if( nRecId == EXC_ID5_BOF ) { - DBG_ASSERT( GetBiff() == EXC_BIFF8, "ImportExcel8::Read - wrong BIFF version" ); + OSL_ENSURE( GetBiff() == EXC_BIFF8, "ImportExcel8::Read - wrong BIFF version" ); Bof5(); if( pExcRoot->eDateiTyp == Biff8W ) { @@ -1053,7 +1053,7 @@ FltError ImportExcel8::Read( void ) GetTracer().TraceChartOnlySheet(); break; case Biff8W: // workbook - DBG_ERRORFILE( "ImportExcel8::Read - double workbook globals" ); + OSL_FAIL( "ImportExcel8::Read - double workbook globals" ); // run through case Biff8V: // VB module default: diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx index 36c46e04b15e..7678c119c7b5 100644 --- a/sc/source/filter/excel/tokstack.cxx +++ b/sc/source/filter/excel/tokstack.cxx @@ -312,7 +312,7 @@ void TokenPool::GrowMatrix( void ) void TokenPool::GetElement( const sal_uInt16 nId ) { - DBG_ASSERT( nId < nElementAkt, "*TokenPool::GetElement(): Id zu gross!?" ); + OSL_ENSURE( nId < nElementAkt, "*TokenPool::GetElement(): Id zu gross!?" ); if( pType[ nId ] == T_Id ) GetElementRek( nId ); @@ -427,12 +427,12 @@ void TokenPool::GetElementRek( const sal_uInt16 nId ) { #ifdef DBG_UTIL nRek++; - DBG_ASSERT( nRek <= nP_Id, "*TokenPool::GetElement(): Rekursion loopt!?" ); + OSL_ENSURE( nRek <= nP_Id, "*TokenPool::GetElement(): Rekursion loopt!?" ); #endif - DBG_ASSERT( nId < nElementAkt, "*TokenPool::GetElementRek(): Id zu gross!?" ); + OSL_ENSURE( nId < nElementAkt, "*TokenPool::GetElementRek(): Id zu gross!?" ); - DBG_ASSERT( pType[ nId ] == T_Id, "-TokenPool::GetElementRek(): nId nicht Id-Folge!" ); + OSL_ENSURE( pType[ nId ] == T_Id, "-TokenPool::GetElementRek(): nId nicht Id-Folge!" ); sal_uInt16 nAnz = pSize[ nId ]; @@ -613,7 +613,7 @@ const TokenId TokenPool::Store( const String& rString ) //...ansonsten nur kopieren *ppP_Str[ nP_StrAkt ] = rString; - DBG_ASSERT( sizeof( xub_StrLen ) <= 2, "*TokenPool::Store(): StrLen doesn't match!" ); + OSL_ENSURE( sizeof( xub_StrLen ) <= 2, "*TokenPool::Store(): StrLen doesn't match!" ); pSize[ nElementAkt ] = ( sal_uInt16 ) ppP_Str[ nP_StrAkt ]->Len(); diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 5a37893da6cc..ad15c5b17906 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -282,7 +282,7 @@ void XclExpChRootData::InitializeFutureRecBlock( XclExpStream& rStrm ) // write all unwritten CHFRBLOCKBEGIN records for( XclChFrBlockVector::const_iterator aIt = maUnwrittenFrBlocks.begin(), aEnd = maUnwrittenFrBlocks.end(); aIt != aEnd; ++aIt ) { - DBG_ASSERT( aIt->mnType != EXC_CHFRBLOCK_TYPE_UNKNOWN, "XclExpChRootData::InitializeFutureRecBlock - unknown future record block type" ); + OSL_ENSURE( aIt->mnType != EXC_CHFRBLOCK_TYPE_UNKNOWN, "XclExpChRootData::InitializeFutureRecBlock - unknown future record block type" ); lclWriteChFrBlockRecord( rStrm, *aIt, true ); } // move all record infos to vector of written blocks @@ -293,7 +293,7 @@ void XclExpChRootData::InitializeFutureRecBlock( XclExpStream& rStrm ) void XclExpChRootData::FinalizeFutureRecBlock( XclExpStream& rStrm ) { - DBG_ASSERT( !maUnwrittenFrBlocks.empty() || !maWrittenFrBlocks.empty(), "XclExpChRootData::FinalizeFutureRecBlock - no future record level found" ); + OSL_ENSURE( !maUnwrittenFrBlocks.empty() || !maWrittenFrBlocks.empty(), "XclExpChRootData::FinalizeFutureRecBlock - no future record level found" ); if( !maUnwrittenFrBlocks.empty() ) { // no future record has been written, just forget the topmost level @@ -362,7 +362,7 @@ bool XclExpChRoot::IsSystemColor( const Color& rColor, sal_uInt16 nSysColorIdx ) void XclExpChRoot::SetSystemColor( Color& rColor, sal_uInt32& rnColorId, sal_uInt16 nSysColorIdx ) const { - DBG_ASSERT( GetPalette().IsSystemColor( nSysColorIdx ), "XclExpChRoot::SetSystemColor - invalid color index" ); + OSL_ENSURE( GetPalette().IsSystemColor( nSysColorIdx ), "XclExpChRoot::SetSystemColor - invalid color index" ); rColor = GetPalette().GetDefColor( nSysColorIdx ); rnColorId = XclExpPalette::GetColorIdFromIndex( nSysColorIdx ); } @@ -532,7 +532,7 @@ void XclExpChLineFormat::SetDefault( XclChFrameType eDefFrameType ) maData.mnPattern = EXC_CHLINEFORMAT_NONE; break; default: - DBG_ERRORFILE( "XclExpChLineFormat::SetDefault - unknown frame type" ); + OSL_FAIL( "XclExpChLineFormat::SetDefault - unknown frame type" ); } } @@ -652,7 +652,7 @@ void XclExpChAreaFormat::SetDefault( XclChFrameType eDefFrameType ) maData.mnPattern = EXC_PATT_NONE; break; default: - DBG_ERRORFILE( "XclExpChAreaFormat::SetDefault - unknown frame type" ); + OSL_FAIL( "XclExpChAreaFormat::SetDefault - unknown frame type" ); } } @@ -680,7 +680,7 @@ XclExpChEscherFormat::XclExpChEscherFormat( const XclExpChRoot& rRoot ) : mnColor1Id( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_CHWINDOWBACK ) ), mnColor2Id( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_CHWINDOWBACK ) ) { - DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF8 ); } void XclExpChEscherFormat::Convert( const ScfPropertySet& rPropSet, XclChObjectType eObjType ) @@ -741,7 +741,7 @@ sal_uInt32 XclExpChEscherFormat::RegisterColor( sal_uInt16 nPropId ) void XclExpChEscherFormat::WriteBody( XclExpStream& rStrm ) { - DBG_ASSERT( maData.mxEscherSet, "XclExpChEscherFormat::WriteBody - missing property container" ); + OSL_ENSURE( maData.mxEscherSet, "XclExpChEscherFormat::WriteBody - missing property container" ); // write Escher property container via temporary memory stream SvMemoryStream aMemStrm; maData.mxEscherSet->Commit( aMemStrm ); @@ -901,7 +901,7 @@ void lclAddDoubleRefData( if( orArray.GetLen() > 0 ) orArray.AddOpCode( ocUnion ); - DBG_ASSERT( (rToken.GetType() == ::formula::svDoubleRef) || (rToken.GetType() == ::formula::svExternalDoubleRef), + OSL_ENSURE( (rToken.GetType() == ::formula::svDoubleRef) || (rToken.GetType() == ::formula::svExternalDoubleRef), "lclAddDoubleRefData - double reference token expected"); if( rToken.GetType() == ::formula::svExternalDoubleRef ) orArray.AddExternalDoubleReference( rToken.GetIndex(), rToken.GetString(), aComplexRef ); @@ -1054,7 +1054,7 @@ sal_uInt16 XclExpChSourceLink::ConvertStringSequence( const Sequence< Reference< { // get leading font index const XclFormatRunVec& rFormats = mxString->GetFormats(); - DBG_ASSERT( !rFormats.empty() && (rFormats.front().mnChar == 0), + OSL_ENSURE( !rFormats.empty() && (rFormats.front().mnChar == 0), "XclExpChSourceLink::ConvertStringSequenc - missing leading format" ); // remove leading format run, if entire string is equally formatted if( rFormats.size() == 1 ) @@ -1306,7 +1306,7 @@ bool XclExpChText::ConvertDataLabel( const ScfPropertySet& rPropSet, bool bIsPie = rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE; // bubble sizes only allowed in bubble charts bool bIsBubble = rTypeInfo.meTypeId == EXC_CHTYPEID_BUBBLES; - DBG_ASSERT( (GetBiff() == EXC_BIFF8) || !bIsBubble, "XclExpChText::ConvertDataLabel - bubble charts only in BIFF8" ); + OSL_ENSURE( (GetBiff() == EXC_BIFF8) || !bIsBubble, "XclExpChText::ConvertDataLabel - bubble charts only in BIFF8" ); // raw show flags bool bShowValue = !bIsBubble && aPointLabel.ShowNumber; // Chart2 uses 'ShowNumber' for bubble size @@ -1367,7 +1367,7 @@ bool XclExpChText::ConvertDataLabel( const ScfPropertySet& rPropSet, case INSIDE: nLabelPos = EXC_CHTEXT_POS_INSIDE; break; case OUTSIDE: nLabelPos = EXC_CHTEXT_POS_OUTSIDE; break; case NEAR_ORIGIN: nLabelPos = EXC_CHTEXT_POS_AXIS; break; - default: DBG_ERRORFILE( "XclExpChText::ConvertDataLabel - unknown label placement type" ); + default: OSL_FAIL( "XclExpChText::ConvertDataLabel - unknown label placement type" ); } } ::insert_value( maData.mnFlags2, nLabelPos, 0, 4 ); @@ -1588,7 +1588,7 @@ void XclExpCh3dDataFormat::Convert( const ScfPropertySet& rPropSet ) maData.mnTop = EXC_CH3DDATAFORMAT_SHARP; break; default: - DBG_ERRORFILE( "XclExpCh3dDataFormat::Convert - unknown 3D bar format" ); + OSL_FAIL( "XclExpCh3dDataFormat::Convert - unknown 3D bar format" ); } } } @@ -1848,7 +1848,7 @@ ScfPropertySet lclGetPointPropSet( Reference< XDataSeries > xDataSeries, sal_Int } catch( Exception& ) { - DBG_ERRORFILE( "lclGetPointPropSet - no data point property set" ); + OSL_FAIL( "lclGetPointPropSet - no data point property set" ); } return aPropSet; } @@ -2239,7 +2239,7 @@ void XclExpChType::WriteBody( XclExpStream& rStrm ) break; default: - DBG_ERRORFILE( "XclExpChType::WriteBody - unknown chart type" ); + OSL_FAIL( "XclExpChType::WriteBody - unknown chart type" ); } } @@ -2664,7 +2664,7 @@ void XclExpChLabelRange::Convert( const ScaleData& rScaleData, const ScfProperty // ...but get the current base time unit from the property of the old chart API sal_Int32 nApiTimeUnit = 0; bool bValidBaseUnit = aTimeIncrement.TimeResolution >>= nApiTimeUnit; - DBG_ASSERT( bValidBaseUnit, "XclExpChLabelRange::Convert - cannot ghet base time unit" ); + OSL_ENSURE( bValidBaseUnit, "XclExpChLabelRange::Convert - cannot ghet base time unit" ); maDateData.mnBaseUnit = bValidBaseUnit ? lclGetTimeUnit( nApiTimeUnit ) : EXC_CHDATERANGE_DAYS; /* Min/max values depend on base time unit, they specify the number of diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index b25cc7f20b1e..2814cb5435a1 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -135,7 +135,7 @@ XclExpSstImpl::XclExpSstImpl() : sal_uInt32 XclExpSstImpl::Insert( XclExpStringRef xString ) { - DBG_ASSERT( xString.get(), "XclExpSstImpl::Insert - empty pointer not allowed" ); + OSL_ENSURE( xString.get(), "XclExpSstImpl::Insert - empty pointer not allowed" ); if( !xString.get() ) xString.reset( new XclExpString ); @@ -206,7 +206,7 @@ void XclExpSstImpl::Save( XclExpStream& rStrm ) aStr.Append( '\t' ).APPENDINT( nStrings ).Append( '\n' ); } } - DBG_ERRORFILE( aStr.GetBuffer() ); + OSL_FAIL( aStr.GetBuffer() ); #undef APPENDINT } #endif @@ -332,7 +332,7 @@ void XclExpMergedcells::AppendRange( const ScRange& rRange, sal_uInt32 nBaseXFId sal_uInt32 XclExpMergedcells::GetBaseXFId( const ScAddress& rPos ) const { - DBG_ASSERT( maBaseXFIds.size() == maMergedRanges.size(), "XclExpMergedcells::GetBaseXFId - invalid lists" ); + OSL_ENSURE( maBaseXFIds.size() == maMergedRanges.size(), "XclExpMergedcells::GetBaseXFId - invalid lists" ); ScfUInt32Vec::const_iterator aIt = maBaseXFIds.begin(); ScRangeList& rNCRanges = const_cast< ScRangeList& >( maMergedRanges ); for ( size_t i = 0, nRanges = rNCRanges.size(); i < nRanges; ++i, ++aIt ) @@ -715,7 +715,7 @@ XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rF case SC_COND_EQLESS: mnOperator = EXC_CF_CMP_LESS_EQUAL; break; case SC_COND_DIRECT: mnType = EXC_CF_TYPE_FMLA; break; default: mnType = EXC_CF_TYPE_NONE; - DBG_ERRORFILE( "XclExpCF::WriteBody - unknown condition type" ); + OSL_FAIL( "XclExpCF::WriteBody - unknown condition type" ); } // *** formulas *** @@ -880,8 +880,8 @@ void XclExpCondfmt::Save( XclExpStream& rStrm ) void XclExpCondfmt::WriteBody( XclExpStream& rStrm ) { - DBG_ASSERT( !maCFList.IsEmpty(), "XclExpCondfmt::WriteBody - no CF records to write" ); - DBG_ASSERT( !maXclRanges.empty(), "XclExpCondfmt::WriteBody - no cell ranges found" ); + OSL_ENSURE( !maCFList.IsEmpty(), "XclExpCondfmt::WriteBody - no CF records to write" ); + OSL_ENSURE( !maXclRanges.empty(), "XclExpCondfmt::WriteBody - no cell ranges found" ); rStrm << static_cast< sal_uInt16 >( maCFList.GetSize() ) << sal_uInt16( 1 ) @@ -1039,7 +1039,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : case SC_VALID_TIME: mnFlags |= EXC_DV_MODE_TIME; break; case SC_VALID_TEXTLEN: mnFlags |= EXC_DV_MODE_TEXTLEN; break; case SC_VALID_CUSTOM: mnFlags |= EXC_DV_MODE_CUSTOM; break; - default: DBG_ERRORFILE( "XclExpDV::XclExpDV - unknown mode" ); + default: OSL_FAIL( "XclExpDV::XclExpDV - unknown mode" ); } switch( pValData->GetOperation() ) @@ -1053,7 +1053,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : case SC_COND_NOTEQUAL: mnFlags |= EXC_DV_COND_NOTEQUAL; break; case SC_COND_BETWEEN: mnFlags |= EXC_DV_COND_BETWEEN; break; case SC_COND_NOTBETWEEN: mnFlags |= EXC_DV_COND_NOTBETWEEN; break; - default: DBG_ERRORFILE( "XclExpDV::XclExpDV - unknown condition" ); + default: OSL_FAIL( "XclExpDV::XclExpDV - unknown condition" ); } switch( eScErrorStyle ) { @@ -1065,7 +1065,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : mnFlags |= EXC_DV_ERROR_INFO; maErrorTitle.Assign( '\0' ); // contains macro name break; - default: DBG_ERRORFILE( "XclExpDV::XclExpDV - unknown error style" ); + default: OSL_FAIL( "XclExpDV::XclExpDV - unknown error style" ); } ::set_flag( mnFlags, EXC_DV_IGNOREBLANK, pValData->IsIgnoreBlank() ); ::set_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN, pValData->GetListType() == ValidListType::INVISIBLE ); @@ -1142,7 +1142,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : } else { - DBG_ERRORFILE( "XclExpDV::XclExpDV - missing core data" ); + OSL_FAIL( "XclExpDV::XclExpDV - missing core data" ); mnScHandle = ULONG_MAX; } } @@ -1355,7 +1355,7 @@ XclExpWebQuery::~XclExpWebQuery() void XclExpWebQuery::Save( XclExpStream& rStrm ) { - DBG_ASSERT( !mbEntireDoc || !mxQryTables.get(), "XclExpWebQuery::Save - illegal mode" ); + OSL_ENSURE( !mbEntireDoc || !mxQryTables.get(), "XclExpWebQuery::Save - illegal mode" ); sal_uInt16 nFlags; // QSI record diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index e0faf0ea0c93..c8b6cfcd9b52 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1321,7 +1321,7 @@ void XclExpNote::Save( XclExpStream& rStrm ) void XclExpNote::WriteBody( XclExpStream& rStrm ) { // BIFF5/BIFF7 is written separately - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ); sal_uInt16 nFlags = 0; ::set_flag( nFlags, EXC_NOTE_VISIBLE, mbVisible ); @@ -1574,7 +1574,7 @@ boost::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( SdrPa if( pSdrPage ) mxEscherEx->AddSdrPage( *pSdrPage ); // the first dummy object may still be open - DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" ); + OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" ); while( mxEscherEx->GetGroupLevel() ) mxEscherEx->LeaveGroup(); mxObjList->EndSheet(); @@ -1586,7 +1586,7 @@ boost::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const if( rxShapes.is() ) mxEscherEx->AddUnoShapes( rxShapes ); // the first dummy object may still be open - DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" ); + OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" ); while( mxEscherEx->GetGroupLevel() ) mxEscherEx->LeaveGroup(); mxObjList->EndSheet(); diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index dab35e4ba7b8..9220a46314c7 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -192,7 +192,7 @@ XclExpFuncData::XclExpFuncData( const XclExpScToken& rTokData, mxOperands( new XclExpOperandList ), mpParamInfo( rFuncInfo.mpParamInfos ) { - DBG_ASSERT( mrTokData.mpScToken, "XclExpFuncData::XclExpFuncData - missing core token" ); + OSL_ENSURE( mrTokData.mpScToken, "XclExpFuncData::XclExpFuncData - missing core token" ); // set name of an add-in function if( (maExtFuncData.maFuncName.Len() == 0) && dynamic_cast< const FormulaExternalToken* >( mrTokData.mpScToken ) ) maExtFuncData.Set( GetScToken().GetExternal(), true, false ); @@ -308,7 +308,7 @@ XclExpCompData::XclExpCompData( const XclExpCompConfig* pCfg ) : mbVolatile( false ), mbOk( pCfg != 0 ) { - DBG_ASSERT( pCfg, "XclExpFmlaCompImpl::Init - unknown formula type" ); + OSL_ENSURE( pCfg, "XclExpFmlaCompImpl::Init - unknown formula type" ); } } // namespace @@ -532,7 +532,7 @@ XclTokenArrayRef XclExpFmlaCompImpl::CreateFormula( XclFormulaType eType, } else { - DBG_ERRORFILE( "XclExpFmlaCompImpl::CreateFormula - empty token array" ); + OSL_FAIL( "XclExpFmlaCompImpl::CreateFormula - empty token array" ); mxData->mbOk = false; } @@ -540,7 +540,7 @@ XclTokenArrayRef XclExpFmlaCompImpl::CreateFormula( XclFormulaType eType, { // #i44907# auto-generated SUBTOTAL formula cells have trailing ocStop token mxData->mbOk = !aTokData.Is() || (aTokData.GetOpCode() == ocStop); - DBG_ASSERT( mxData->mbOk, "XclExpFmlaCompImpl::CreateFormula - unknown garbage behind formula" ); + OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::CreateFormula - unknown garbage behind formula" ); } } @@ -586,7 +586,7 @@ bool XclExpFmlaCompImpl::Is3DRefOnly( XclFormulaType eType ) const const XclExpCompConfig* XclExpFmlaCompImpl::GetConfigForType( XclFormulaType eType ) const { XclExpCompConfigMap::const_iterator aIt = maCfgMap.find( eType ); - DBG_ASSERT( aIt != maCfgMap.end(), "XclExpFmlaCompImpl::GetConfigForType - unknown formula type" ); + OSL_ENSURE( aIt != maCfgMap.end(), "XclExpFmlaCompImpl::GetConfigForType - unknown formula type" ); return (aIt == maCfgMap.end()) ? 0 : &aIt->second; } @@ -612,12 +612,12 @@ void XclExpFmlaCompImpl::Init( XclFormulaType eType, const ScTokenArray& rScTokA case EXC_FMLATYPE_MATRIX: case EXC_FMLATYPE_CHART: mxData->mbOk = pScBasePos != 0; - DBG_ASSERT( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" ); + OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" ); mxData->mpScBasePos = pScBasePos; break; case EXC_FMLATYPE_SHARED: mxData->mbOk = pScBasePos != 0; - DBG_ASSERT( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" ); + OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::Init - missing cell address" ); // clone the passed token array, convert references relative to current cell position mxData->mxOwnScTokArr.reset( rScTokArr.Clone() ); ScCompiler::MoveRelWrap( *mxData->mxOwnScTokArr, GetDocPtr(), *pScBasePos, MAXCOL, MAXROW ); @@ -642,7 +642,7 @@ void XclExpFmlaCompImpl::RecalcTokenClasses() if( mxData->mbOk ) { mxData->mbOk = mxData->maOpPosStack.size() == 1; - DBG_ASSERT( mxData->mbOk, "XclExpFmlaCompImpl::RecalcTokenClasses - position of root token expected on stack" ); + OSL_ENSURE( mxData->mbOk, "XclExpFmlaCompImpl::RecalcTokenClasses - position of root token expected on stack" ); if( mxData->mbOk ) { /* Cell and array formulas start with VAL conversion and VALTYPE @@ -665,7 +665,7 @@ void XclExpFmlaCompImpl::RecalcTokenClasses() void XclExpFmlaCompImpl::RecalcTokenClass( const XclExpTokenConvInfo& rConvInfo, XclFuncParamConv ePrevConv, XclExpClassConv ePrevClassConv, bool bWasRefClass ) { - DBG_ASSERT( rConvInfo.mnTokPos < GetSize(), "XclExpFmlaCompImpl::RecalcTokenClass - invalid token position" ); + OSL_ENSURE( rConvInfo.mnTokPos < GetSize(), "XclExpFmlaCompImpl::RecalcTokenClass - invalid token position" ); sal_uInt8& rnTokenId = mxData->maTokVec[ rConvInfo.mnTokPos ]; sal_uInt8 nTokClass = GetTokenClass( rnTokenId ); @@ -796,7 +796,7 @@ void XclExpFmlaCompImpl::FinalizeFormula() XclTokenArrayRef XclExpFmlaCompImpl::CreateTokenArray() { // create the Excel token array from working data before resetting mxData - DBG_ASSERT( mxData->mrCfg.mbAllowArrays || mxData->maExtDataVec.empty(), "XclExpFmlaCompImpl::CreateTokenArray - unexpected extended data" ); + OSL_ENSURE( mxData->mrCfg.mbAllowArrays || mxData->maExtDataVec.empty(), "XclExpFmlaCompImpl::CreateTokenArray - unexpected extended data" ); if( !mxData->mrCfg.mbAllowArrays ) mxData->maExtDataVec.clear(); XclTokenArrayRef xTokArr( new XclTokenArray( mxData->maTokVec, mxData->maExtDataVec, mxData->mbVolatile ) ); @@ -1291,7 +1291,7 @@ void XclExpFmlaCompImpl::ProcessMatrix( const XclExpScToken& rTokData ) { SCSIZE nScCols, nScRows; pMatrix->GetDimensions( nScCols, nScRows ); - DBG_ASSERT( (nScCols > 0) && (nScRows > 0), "XclExpFmlaCompImpl::ProcessMatrix - invalid matrix size" ); + OSL_ENSURE( (nScCols > 0) && (nScRows > 0), "XclExpFmlaCompImpl::ProcessMatrix - invalid matrix size" ); sal_uInt16 nCols = ::limit_cast< sal_uInt16 >( nScCols, 0, 256 ); sal_uInt16 nRows = ::limit_cast< sal_uInt16 >( nScRows, 0, 1024 ); @@ -1492,9 +1492,9 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC void XclExpFmlaCompImpl::FinishIfFunction( XclExpFuncData& rFuncData ) { sal_uInt16 nParamCount = rFuncData.GetParamCount(); - DBG_ASSERT( (nParamCount == 2) || (nParamCount == 3), "XclExpFmlaCompImpl::FinishIfFunction - wrong parameter count" ); + OSL_ENSURE( (nParamCount == 2) || (nParamCount == 3), "XclExpFmlaCompImpl::FinishIfFunction - wrong parameter count" ); const ScfUInt16Vec& rAttrPos = rFuncData.GetAttrPosVec(); - DBG_ASSERT( nParamCount == rAttrPos.size(), "XclExpFmlaCompImpl::FinishIfFunction - wrong number of tAttr tokens" ); + OSL_ENSURE( nParamCount == rAttrPos.size(), "XclExpFmlaCompImpl::FinishIfFunction - wrong number of tAttr tokens" ); // update tAttrIf token following the condition parameter Overwrite( rAttrPos[ 0 ] + 2, static_cast< sal_uInt16 >( rAttrPos[ 1 ] - rAttrPos[ 0 ] ) ); // update the tAttrGoto tokens following true and false parameters @@ -1507,7 +1507,7 @@ void XclExpFmlaCompImpl::FinishChooseFunction( XclExpFuncData& rFuncData ) { sal_uInt16 nParamCount = rFuncData.GetParamCount(); ScfUInt16Vec& rAttrPos = rFuncData.GetAttrPosVec(); - DBG_ASSERT( nParamCount == rAttrPos.size(), "XclExpFmlaCompImpl::FinishChooseFunction - wrong number of tAttr tokens" ); + OSL_ENSURE( nParamCount == rAttrPos.size(), "XclExpFmlaCompImpl::FinishChooseFunction - wrong number of tAttr tokens" ); // number of choices is parameter count minus 1 sal_uInt16 nChoices = nParamCount - 1; // tAttrChoose token contains number of choices @@ -1637,7 +1637,7 @@ void XclExpFmlaCompImpl::AppendDefaultParam( XclExpFuncData& rFuncData ) break; default: { - DBG_ASSERT( rFuncData.IsMacroFunc(), "XclExpFmlaCompImpl::AppendDefaultParam - unknown opcode" ); + OSL_ENSURE( rFuncData.IsMacroFunc(), "XclExpFmlaCompImpl::AppendDefaultParam - unknown opcode" ); if( rFuncData.IsMacroFunc() ) AppendMacroCallToken( rFuncData.GetExtFuncData() ); else @@ -1841,7 +1841,7 @@ void XclExpFmlaCompImpl::ConvertRefData( // flags for relative column and row if( bNatLangRef ) { - DBG_ASSERT( meBiff == EXC_BIFF8, "XclExpFmlaCompImpl::ConvertRefData - NLRs only for BIFF8" ); + OSL_ENSURE( meBiff == EXC_BIFF8, "XclExpFmlaCompImpl::ConvertRefData - NLRs only for BIFF8" ); // Calc does not support absolute reference mode in natural language references ::set_flag( rXclPos.mnCol, EXC_TOK_NLR_REL ); } @@ -1884,7 +1884,7 @@ void XclExpFmlaCompImpl::ProcessCellRef( const XclExpScToken& rTokData ) if( bNatLangRef ) { - DBG_ASSERT( aRefData.IsColRel() != aRefData.IsRowRel(), + OSL_ENSURE( aRefData.IsColRel() != aRefData.IsRowRel(), "XclExpFmlaCompImpl::ProcessCellRef - broken natural language reference" ); // create tNlr token for natural language reference sal_uInt8 nSubId = aRefData.IsColRel() ? EXC_TOK_NLR_COLV : EXC_TOK_NLR_ROWV; @@ -2146,7 +2146,7 @@ void XclExpFmlaCompImpl::PushOperandPos( sal_uInt16 nTokPos ) void XclExpFmlaCompImpl::PushOperatorPos( sal_uInt16 nTokPos, const XclExpOperandListRef& rxOperands ) { PushOperandPos( nTokPos ); - DBG_ASSERT( rxOperands.get(), "XclExpFmlaCompImpl::AppendOperatorTokenId - missing operand list" ); + OSL_ENSURE( rxOperands.get(), "XclExpFmlaCompImpl::AppendOperatorTokenId - missing operand list" ); if( mxData->maOpListVec.size() <= nTokPos ) mxData->maOpListVec.resize( nTokPos + 1, XclExpOperandListRef() ); mxData->maOpListVec[ nTokPos ] = rxOperands; @@ -2154,7 +2154,7 @@ void XclExpFmlaCompImpl::PushOperatorPos( sal_uInt16 nTokPos, const XclExpOperan sal_uInt16 XclExpFmlaCompImpl::PopOperandPos() { - DBG_ASSERT( !mxData->mbOk || !mxData->maOpPosStack.empty(), "XclExpFmlaCompImpl::PopOperandPos - token stack broken" ); + OSL_ENSURE( !mxData->mbOk || !mxData->maOpPosStack.empty(), "XclExpFmlaCompImpl::PopOperandPos - token stack broken" ); mxData->mbOk &= !mxData->maOpPosStack.empty(); if( mxData->mbOk ) { @@ -2435,7 +2435,7 @@ void XclExpFmlaCompImpl::AppendJumpToken( XclExpFuncData& rFuncData, sal_uInt8 n void XclExpFmlaCompImpl::InsertZeros( sal_uInt16 nInsertPos, sal_uInt16 nInsertSize ) { // insert zeros into the token array - DBG_ASSERT( nInsertPos < mxData->maTokVec.size(), "XclExpFmlaCompImpl::Insert - invalid position" ); + OSL_ENSURE( nInsertPos < mxData->maTokVec.size(), "XclExpFmlaCompImpl::Insert - invalid position" ); mxData->maTokVec.insert( mxData->maTokVec.begin() + nInsertPos, nInsertSize, 0 ); // update positions of operands waiting for an operator @@ -2455,7 +2455,7 @@ void XclExpFmlaCompImpl::InsertZeros( sal_uInt16 nInsertPos, sal_uInt16 nInsertS void XclExpFmlaCompImpl::Overwrite( sal_uInt16 nWriteToPos, sal_uInt16 nOffset ) { - DBG_ASSERT( static_cast< size_t >( nWriteToPos + 1 ) < mxData->maTokVec.size(), "XclExpFmlaCompImpl::Overwrite - invalid position" ); + OSL_ENSURE( static_cast< size_t >( nWriteToPos + 1 ) < mxData->maTokVec.size(), "XclExpFmlaCompImpl::Overwrite - invalid position" ); ShortToSVBT16( nOffset, &mxData->maTokVec[ nWriteToPos ] ); } diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 77b81686432f..baf07094e429 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -118,10 +118,10 @@ void XclExpProgressBar::IncRowRecordCount() void XclExpProgressBar::ActivateCreateRowsSegment() { - DBG_ASSERT( (0 <= GetCurrScTab()) && (GetCurrScTab() < GetTabInfo().GetScTabCount()), + OSL_ENSURE( (0 <= GetCurrScTab()) && (GetCurrScTab() < GetTabInfo().GetScTabCount()), "XclExpProgressBar::ActivateCreateRowsSegment - invalid sheet" ); sal_Int32 nSeg = maSubSegRowCreate[ GetCurrScTab() ]; - DBG_ASSERT( nSeg != SCF_INV_SEGMENT, "XclExpProgressBar::ActivateCreateRowsSegment - invalid segment" ); + OSL_ENSURE( nSeg != SCF_INV_SEGMENT, "XclExpProgressBar::ActivateCreateRowsSegment - invalid segment" ); if( nSeg != SCF_INV_SEGMENT ) { mpSubProgress = mpSubRowCreate; @@ -492,7 +492,7 @@ XclExpStringRef lclCreateFormattedString( } else { - DBG_ERRORFILE( "lclCreateFormattedString - unknown text field" ); + OSL_FAIL( "lclCreateFormattedString - unknown text field" ); aXclPortionText.Erase(); } } @@ -637,7 +637,7 @@ XclExpStringRef XclExpStringHelper::CreateString( } else { - DBG_ERRORFILE( "XclExpStringHelper::CreateString - textbox without para object" ); + OSL_FAIL( "XclExpStringHelper::CreateString - textbox without para object" ); // create BIFF dependent empty Excel string xString = CreateString( rRoot, EMPTY_STRING, nFlags, nMaxLen ); } @@ -863,7 +863,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico aParaText.AppendAscii( "&Z&F" ); break; default: - DBG_ERRORFILE( "XclExpHFConverter::AppendPortion - unknown file field" ); + OSL_FAIL( "XclExpHFConverter::AppendPortion - unknown file field" ); } } } @@ -1004,7 +1004,7 @@ void lclEncodeDosUrl( XclBiff eBiff, String& rUrl, const String* pTableName = 0 rUrl = pTableName ? EXC_URLSTART_SELFENCODED : EXC_URLSTART_SELF; break; case EXC_BIFF8: - DBG_ASSERT( pTableName, "lclEncodeDosUrl - sheet name required for BIFF8" ); + OSL_ENSURE( pTableName, "lclEncodeDosUrl - sheet name required for BIFF8" ); rUrl = EXC_URLSTART_SELF; break; default: @@ -1052,8 +1052,8 @@ void XclExpCachedMatrix::GetDimensions( SCSIZE & nCols, SCSIZE & nRows ) const { mrMatrix.GetDimensions( nCols, nRows ); - DBG_ASSERT( nCols && nRows, "XclExpCachedMatrix::GetDimensions - empty matrix" ); - DBG_ASSERT( nCols <= 256, "XclExpCachedMatrix::GetDimensions - too many columns" ); + OSL_ENSURE( nCols && nRows, "XclExpCachedMatrix::GetDimensions - empty matrix" ); + OSL_ENSURE( nCols <= 256, "XclExpCachedMatrix::GetDimensions - too many columns" ); } sal_Size XclExpCachedMatrix::GetSize() const diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 43f8342bf815..d8b23750839e 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -773,7 +773,7 @@ bool XclExpTabInfo::IsSelectedTab( SCTAB nScTab ) const bool XclExpTabInfo::IsDisplayedTab( SCTAB nScTab ) const { - DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::IsActiveTab - sheet out of range" ); + OSL_ENSURE( nScTab < mnScCnt, "XclExpTabInfo::IsActiveTab - sheet out of range" ); return GetXclTab( nScTab ) == mnDisplXclTab; } @@ -784,7 +784,7 @@ bool XclExpTabInfo::IsMirroredTab( SCTAB nScTab ) const const String& XclExpTabInfo::GetScTabName( SCTAB nScTab ) const { - DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::IsActiveTab - sheet out of range" ); + OSL_ENSURE( nScTab < mnScCnt, "XclExpTabInfo::IsActiveTab - sheet out of range" ); return (nScTab < mnScCnt) ? maTabInfoVec[ nScTab ].maScName : EMPTY_STRING; } @@ -795,19 +795,19 @@ sal_uInt16 XclExpTabInfo::GetXclTab( SCTAB nScTab ) const SCTAB XclExpTabInfo::GetRealScTab( SCTAB nSortedScTab ) const { - DBG_ASSERT( nSortedScTab < mnScCnt, "XclExpTabInfo::GetRealScTab - sheet out of range" ); + OSL_ENSURE( nSortedScTab < mnScCnt, "XclExpTabInfo::GetRealScTab - sheet out of range" ); return (nSortedScTab < mnScCnt) ? maFromSortedVec[ nSortedScTab ] : SCTAB_INVALID; } bool XclExpTabInfo::GetFlag( SCTAB nScTab, sal_uInt8 nFlags ) const { - DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::GetFlag - sheet out of range" ); + OSL_ENSURE( nScTab < mnScCnt, "XclExpTabInfo::GetFlag - sheet out of range" ); return (nScTab < mnScCnt) && ::get_flag( maTabInfoVec[ nScTab ].mnFlags, nFlags ); } void XclExpTabInfo::SetFlag( SCTAB nScTab, sal_uInt8 nFlags, bool bSet ) { - DBG_ASSERT( nScTab < mnScCnt, "XclExpTabInfo::SetFlag - sheet out of range" ); + OSL_ENSURE( nScTab < mnScCnt, "XclExpTabInfo::SetFlag - sheet out of range" ); if( nScTab < mnScCnt ) ::set_flag( maTabInfoVec[ nScTab ].mnFlags, nFlags, bSet ); } @@ -887,7 +887,7 @@ XclExpExtNameBase::XclExpExtNameBase( mxName( XclExpStringHelper::CreateString( rRoot, rName, EXC_STR_8BITLENGTH ) ), mnFlags( nFlags ) { - DBG_ASSERT( maName.Len() <= 255, "XclExpExtNameBase::XclExpExtNameBase - string too long" ); + OSL_ENSURE( maName.Len() <= 255, "XclExpExtNameBase::XclExpExtNameBase - string too long" ); SetRecSize( 6 + mxName->GetSize() ); } @@ -1355,7 +1355,7 @@ void XclExpExternSheet::Save( XclExpStream& rStrm ) void XclExpExternSheet::Init( const String& rEncUrl ) { - DBG_ASSERT_BIFF( GetBiff() <= EXC_BIFF5 ); + OSL_ENSURE_BIFF( GetBiff() <= EXC_BIFF5 ); maTabName.AssignByte( rEncUrl, GetTextEncoding(), EXC_STR_8BITLENGTH ); SetRecSize( maTabName.GetSize() ); } @@ -1489,7 +1489,7 @@ sal_uInt16 XclExpSupbook::GetTabCount() const sal_uInt16 XclExpSupbook::InsertTabName( const String& rTabName, ScExternalRefCache::TableTypeRef xCacheTable ) { - DBG_ASSERT( meType == EXC_SBTYPE_EXTERN, "XclExpSupbook::InsertTabName - don't insert sheet names here" ); + OSL_ENSURE( meType == EXC_SBTYPE_EXTERN, "XclExpSupbook::InsertTabName - don't insert sheet names here" ); sal_uInt16 nSBTab = ulimit_cast< sal_uInt16 >( maXctList.GetSize() ); XclExpXctRef xXct( new XclExpXct( GetRoot(), rTabName, nSBTab, xCacheTable ) ); AddRecSize( xXct->GetTabName().GetSize() ); @@ -1555,7 +1555,7 @@ void XclExpSupbook::WriteBody( XclExpStream& rStrm ) rStrm << mnXclTabCount << EXC_SUPB_ADDIN; break; default: - DBG_ERRORFILE( "XclExpSupbook::WriteBody - unknown SUPBOOK type" ); + OSL_FAIL( "XclExpSupbook::WriteBody - unknown SUPBOOK type" ); } } @@ -1571,7 +1571,7 @@ XclExpSupbookBuffer::XclExpSupbookBuffer( const XclExpRoot& rRoot ) : sal_uInt16 nCodeCnt = static_cast< sal_uInt16 >( GetExtDocOptions().GetCodeNameCount() ); size_t nCount = nXclCnt + rTabInfo.GetXclExtTabCount(); - DBG_ASSERT( nCount > 0, "XclExpSupbookBuffer::XclExpSupbookBuffer - no sheets to export" ); + OSL_ENSURE( nCount > 0, "XclExpSupbookBuffer::XclExpSupbookBuffer - no sheets to export" ); if( nCount ) { maSBIndexVec.resize( nCount ); @@ -1633,7 +1633,7 @@ void XclExpSupbookBuffer::StoreCellRange( const ScRange& rRange ) { const XclExpSBIndex& rSBIndex = maSBIndexVec[ nXclTab ]; XclExpSupbookRef xSupbook = maSupbookList.GetRecord( rSBIndex.mnSupbook ); - DBG_ASSERT( xSupbook , "XclExpSupbookBuffer::StoreCellRange - missing SUPBOOK record" ); + OSL_ENSURE( xSupbook , "XclExpSupbookBuffer::StoreCellRange - missing SUPBOOK record" ); if( xSupbook ) xSupbook->StoreCellRange( rRange, rSBIndex.mnSBTab ); } @@ -1775,7 +1775,7 @@ bool XclExpSupbookBuffer::InsertAddIn( } else xSupbook = maSupbookList.GetRecord( mnAddInSB ); - DBG_ASSERT( xSupbook, "XclExpSupbookBuffer::InsertAddin - missing add-in supbook" ); + OSL_ENSURE( xSupbook, "XclExpSupbookBuffer::InsertAddin - missing add-in supbook" ); rnSupbook = mnAddInSB; rnExtName = xSupbook->InsertAddIn( rName ); return rnExtName > 0; @@ -1952,7 +1952,7 @@ void XclExpLinkManagerImpl5::FindExtSheet( } (void)pRefLogEntry; // avoid compiler warning - DBG_ASSERT( !pRefLogEntry, "XclExpLinkManagerImpl5::FindExtSheet - fill reflog entry not implemented" ); + OSL_ENSURE( !pRefLogEntry, "XclExpLinkManagerImpl5::FindExtSheet - fill reflog entry not implemented" ); } sal_uInt16 XclExpLinkManagerImpl5::FindExtSheet( sal_Unicode cCode ) @@ -2135,7 +2135,7 @@ void XclExpLinkManagerImpl8::FindExtSheet( sal_uInt16 XclExpLinkManagerImpl8::FindExtSheet( sal_Unicode cCode ) { (void)cCode; // avoid compiler warning - DBG_ASSERT( (cCode == EXC_EXTSH_OWNDOC) || (cCode == EXC_EXTSH_ADDIN), + OSL_ENSURE( (cCode == EXC_EXTSH_OWNDOC) || (cCode == EXC_EXTSH_ADDIN), "XclExpLinkManagerImpl8::FindExtSheet - unknown externsheet code" ); return InsertXti( maSBBuffer.GetXti( EXC_TAB_EXTERNAL, EXC_TAB_EXTERNAL ) ); } diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index a3b32e6bb41f..fcdc6a797b89 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -263,7 +263,7 @@ void XclExpName::SetTokenArray( XclTokenArrayRef xTokArr ) void XclExpName::SetLocalTab( SCTAB nScTab ) { - DBG_ASSERT( GetTabInfo().IsExportTab( nScTab ), "XclExpName::SetLocalTab - invalid sheet index" ); + OSL_ENSURE( GetTabInfo().IsExportTab( nScTab ), "XclExpName::SetLocalTab - invalid sheet index" ); if( GetTabInfo().IsExportTab( nScTab ) ) { mnScTab = nScTab; @@ -322,8 +322,8 @@ bool XclExpName::IsMacroCall( bool bVBasic, bool bFunc ) const void XclExpName::Save( XclExpStream& rStrm ) { - DBG_ASSERT( mxName && (mxName->Len() > 0), "XclExpName::Save - missing name" ); - DBG_ASSERT( !(IsGlobal() && ::get_flag( mnFlags, EXC_NAME_BUILTIN )), "XclExpName::Save - global built-in name" ); + OSL_ENSURE( mxName && (mxName->Len() > 0), "XclExpName::Save - missing name" ); + OSL_ENSURE( !(IsGlobal() && ::get_flag( mnFlags, EXC_NAME_BUILTIN )), "XclExpName::Save - global built-in name" ); SetRecSize( 11 + mxName->GetSize() + (mxTokArr ? mxTokArr->GetSize() : 2) ); XclExpRecord::Save( rStrm ); } @@ -423,7 +423,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo sal_uInt16 XclExpNameManagerImpl::InsertUniqueName( const String& rName, XclTokenArrayRef xTokArr, SCTAB nScTab ) { - DBG_ASSERT( rName.Len(), "XclExpNameManagerImpl::InsertUniqueName - empty name" ); + OSL_ENSURE( rName.Len(), "XclExpNameManagerImpl::InsertUniqueName - empty name" ); XclExpNameRef xName( new XclExpName( GetRoot(), GetUnusedName( rName ) ) ); xName->SetTokenArray( xTokArr ); xName->SetLocalTab( nScTab ); @@ -477,7 +477,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertMacroCall( const String& rMacroName, boo const XclExpName* XclExpNameManagerImpl::GetName( sal_uInt16 nNameIdx ) const { - DBG_ASSERT( maNameList.HasRecord( nNameIdx - 1 ), "XclExpNameManagerImpl::GetName - wrong record index" ); + OSL_ENSURE( maNameList.HasRecord( nNameIdx - 1 ), "XclExpNameManagerImpl::GetName - wrong record index" ); return maNameList.GetRecord( nNameIdx - 1 ).get(); } diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index be8557eac430..3c405d813adf 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -203,7 +203,7 @@ void XclExpPCItem::WriteBody( XclExpStream& rStrm ) else { // nothing to do for SXEMPTY - DBG_ASSERT( IsEmpty(), "XclExpPCItem::WriteBody - no data found" ); + OSL_ENSURE( IsEmpty(), "XclExpPCItem::WriteBody - no data found" ); } } @@ -230,7 +230,7 @@ XclExpPCField::XclExpPCField( { const ScDPNumGroupInfo& rNumInfo = pNumGroupDim->GetInfo(); const ScDPNumGroupInfo& rDateInfo = pNumGroupDim->GetDateInfo(); - DBG_ASSERT( !rNumInfo.Enable || !rDateInfo.Enable, + OSL_ENSURE( !rNumInfo.Enable || !rDateInfo.Enable, "XclExpPCField::XclExpPCField - numeric and date grouping enabled" ); if( rNumInfo.Enable ) @@ -255,7 +255,7 @@ XclExpPCField::XclExpPCField( mnTypeFlags( 0 ) { // add base field info (always using first base field, not predecessor of this field) *** - DBG_ASSERT( rBaseField.GetFieldName() == rGroupDim.GetSourceDimName(), + OSL_ENSURE( rBaseField.GetFieldName() == rGroupDim.GetSourceDimName(), "XclExpPCField::FillFromGroup - wrong base cache field" ); maFieldInfo.maName = rGroupDim.GetGroupDimName(); maFieldInfo.mnGroupBase = rBaseField.GetFieldIndex(); @@ -277,7 +277,7 @@ XclExpPCField::~XclExpPCField() void XclExpPCField::SetGroupChildField( const XclExpPCField& rChildField ) { - DBG_ASSERT( !::get_flag( maFieldInfo.mnFlags, EXC_SXFIELD_HASCHILD ), + OSL_ENSURE( !::get_flag( maFieldInfo.mnFlags, EXC_SXFIELD_HASCHILD ), "XclExpPCField::SetGroupChildIndex - field already has a grouping child field" ); ::set_flag( maFieldInfo.mnFlags, EXC_SXFIELD_HASCHILD ); maFieldInfo.mnGroupChild = rChildField.GetFieldIndex(); @@ -322,7 +322,7 @@ void XclExpPCField::WriteIndex( XclExpStream& rStrm, sal_uInt32 nSrcRow ) const void XclExpPCField::Save( XclExpStream& rStrm ) { - DBG_ASSERT( IsSupportedField(), "XclExpPCField::Save - unknown field type" ); + OSL_ENSURE( IsSupportedField(), "XclExpPCField::Save - unknown field type" ); // SXFIELD XclExpRecord::Save( rStrm ); // SXFDBTYPE @@ -341,15 +341,15 @@ void XclExpPCField::Save( XclExpStream& rStrm ) const XclExpPCField::XclExpPCItemList& XclExpPCField::GetVisItemList() const { - DBG_ASSERT( IsStandardField() == maGroupItemList.IsEmpty(), + OSL_ENSURE( IsStandardField() == maGroupItemList.IsEmpty(), "XclExpPCField::GetVisItemList - unexpected additional items in standard field" ); return IsStandardField() ? maOrigItemList : maGroupItemList; } void XclExpPCField::InitStandardField( const ScRange& rRange ) { - DBG_ASSERT( IsStandardField(), "XclExpPCField::InitStandardField - only for standard fields" ); - DBG_ASSERT( rRange.aStart.Col() == rRange.aEnd.Col(), "XclExpPCField::InitStandardField - cell range with multiple columns" ); + OSL_ENSURE( IsStandardField(), "XclExpPCField::InitStandardField - only for standard fields" ); + OSL_ENSURE( rRange.aStart.Col() == rRange.aEnd.Col(), "XclExpPCField::InitStandardField - cell range with multiple columns" ); ScDocument& rDoc = GetDoc(); SvNumberFormatter& rFormatter = GetFormatter(); @@ -385,7 +385,7 @@ void XclExpPCField::InitStandardField( const ScRange& rRange ) void XclExpPCField::InitStdGroupField( const XclExpPCField& rBaseField, const ScDPSaveGroupDimension& rGroupDim ) { - DBG_ASSERT( IsGroupField(), "XclExpPCField::InitStdGroupField - only for standard grouping fields" ); + OSL_ENSURE( IsGroupField(), "XclExpPCField::InitStdGroupField - only for standard grouping fields" ); maFieldInfo.mnBaseItems = rBaseField.GetItemCount(); maGroupOrder.resize( maFieldInfo.mnBaseItems, EXC_PC_NOITEM ); @@ -428,8 +428,8 @@ void XclExpPCField::InitStdGroupField( const XclExpPCField& rBaseField, const Sc void XclExpPCField::InitNumGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo ) { - DBG_ASSERT( IsStandardField(), "XclExpPCField::InitNumGroupField - only for standard fields" ); - DBG_ASSERT( rNumInfo.Enable, "XclExpPCField::InitNumGroupField - numeric grouping not enabled" ); + OSL_ENSURE( IsStandardField(), "XclExpPCField::InitNumGroupField - only for standard fields" ); + OSL_ENSURE( rNumInfo.Enable, "XclExpPCField::InitNumGroupField - numeric grouping not enabled" ); // new field type, date type, limit settings (min/max/step/auto) if( rNumInfo.DateValues ) @@ -452,8 +452,8 @@ void XclExpPCField::InitNumGroupField( const ScDPObject& rDPObj, const ScDPNumGr void XclExpPCField::InitDateGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nDatePart ) { - DBG_ASSERT( IsStandardField() || IsStdGroupField(), "XclExpPCField::InitDateGroupField - only for standard fields" ); - DBG_ASSERT( rDateInfo.Enable, "XclExpPCField::InitDateGroupField - date grouping not enabled" ); + OSL_ENSURE( IsStandardField() || IsStdGroupField(), "XclExpPCField::InitDateGroupField - only for standard fields" ); + OSL_ENSURE( rDateInfo.Enable, "XclExpPCField::InitDateGroupField - date grouping not enabled" ); // new field type meFieldType = IsStandardField() ? EXC_PCFIELD_DATEGROUP : EXC_PCFIELD_DATECHILD; @@ -468,7 +468,7 @@ void XclExpPCField::InitDateGroupField( const ScDPObject& rDPObj, const ScDPNumG void XclExpPCField::InsertItemArrayIndex( size_t nListPos ) { - DBG_ASSERT( IsStandardField(), "XclExpPCField::InsertItemArrayIndex - only for standard fields" ); + OSL_ENSURE( IsStandardField(), "XclExpPCField::InsertItemArrayIndex - only for standard fields" ); maIndexVec.push_back( static_cast< sal_uInt16 >( nListPos ) ); } @@ -534,7 +534,7 @@ sal_uInt16 XclExpPCField::InsertGroupItem( XclExpPCItem* pNewItem ) void XclExpPCField::InsertNumDateGroupItems( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo, sal_Int32 nDatePart ) { - DBG_ASSERT( rDPObj.GetSheetDesc(), "XclExpPCField::InsertNumDateGroupItems - cannot generate element list" ); + OSL_ENSURE( rDPObj.GetSheetDesc(), "XclExpPCField::InsertNumDateGroupItems - cannot generate element list" ); if( const ScSheetSourceDesc* pSrcDesc = rDPObj.GetSheetDesc() ) { // get the string collection with original source elements @@ -606,7 +606,7 @@ void XclExpPCField::WriteSxnumgroup( XclExpStream& rStrm ) rStrm.EndRecord(); // limits (min/max/step) for numeric grouping - DBG_ASSERT( maNumGroupLimits.GetSize() == 3, + OSL_ENSURE( maNumGroupLimits.GetSize() == 3, "XclExpPCField::WriteSxnumgroup - missing numeric grouping limits" ); maNumGroupLimits.Save( rStrm ); } @@ -614,7 +614,7 @@ void XclExpPCField::WriteSxnumgroup( XclExpStream& rStrm ) void XclExpPCField::WriteSxgroupinfo( XclExpStream& rStrm ) { - DBG_ASSERT( IsStdGroupField() != maGroupOrder.empty(), + OSL_ENSURE( IsStdGroupField() != maGroupOrder.empty(), "XclExpPCField::WriteSxgroupinfo - missing grouping info" ); if( IsStdGroupField() && !maGroupOrder.empty() ) { @@ -729,7 +729,7 @@ bool XclExpPivotCache::HasEqualDataSource( const ScDPObject& rDPObj ) const void XclExpPivotCache::Save( XclExpStream& rStrm ) { - DBG_ASSERT( mbValid, "XclExpPivotCache::Save - invalid pivot cache" ); + OSL_ENSURE( mbValid, "XclExpPivotCache::Save - invalid pivot cache" ); // SXIDSTM XclExpUInt16Record( EXC_ID_SXIDSTM, maPCInfo.mnStrmId ).Save( rStrm ); // SXVS @@ -752,7 +752,7 @@ void XclExpPivotCache::SaveXml( XclExpXmlStream& #endif ) { - DBG_ASSERT( mbValid, "XclExpPivotCache::Save - invalid pivot cache" ); + OSL_ENSURE( mbValid, "XclExpPivotCache::Save - invalid pivot cache" ); #ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream results in a broken .xlsx */ sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); @@ -1040,7 +1040,7 @@ sal_uInt16 XclExpPTField::GetFieldIndex() const sal_uInt16 XclExpPTField::GetLastDataInfoIndex() const { - DBG_ASSERT( !maDataInfoVec.empty(), "XclExpPTField::GetLastDataInfoIndex - no data info found" ); + OSL_ENSURE( !maDataInfoVec.empty(), "XclExpPTField::GetLastDataInfoIndex - no data info found" ); // will return 0xFFFF for empty vector -> ok return static_cast< sal_uInt16 >( maDataInfoVec.size() - 1 ); } @@ -1084,7 +1084,7 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) { // orientation DataPilotFieldOrientation eOrient = static_cast< DataPilotFieldOrientation >( rSaveDim.GetOrientation() ); - DBG_ASSERT( eOrient != DataPilotFieldOrientation_DATA, "XclExpPTField::SetPropertiesFromDim - called for data field" ); + OSL_ENSURE( eOrient != DataPilotFieldOrientation_DATA, "XclExpPTField::SetPropertiesFromDim - called for data field" ); maFieldInfo.AddApiOrient( eOrient ); // show empty items @@ -1212,7 +1212,7 @@ void XclExpPTField::WriteSxpiEntry( XclExpStream& rStrm ) const void XclExpPTField::WriteSxdi( XclExpStream& rStrm, sal_uInt16 nDataInfoIdx ) const { - DBG_ASSERT( nDataInfoIdx < maDataInfoVec.size(), "XclExpPTField::WriteSxdi - data field not found" ); + OSL_ENSURE( nDataInfoIdx < maDataInfoVec.size(), "XclExpPTField::WriteSxdi - data field not found" ); if( nDataInfoIdx < maDataInfoVec.size() ) { rStrm.StartRecord( EXC_ID_SXDI, 12 ); @@ -1576,10 +1576,10 @@ void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSave break; case DataPilotFieldOrientation_PAGE: maPageFields.push_back( nFieldIdx ); - DBG_ASSERT( !bDataLayout, "XclExpPivotTable::SetFieldPropertiesFromDim - wrong orientation for data fields" ); + OSL_ENSURE( !bDataLayout, "XclExpPivotTable::SetFieldPropertiesFromDim - wrong orientation for data fields" ); break; case DataPilotFieldOrientation_DATA: - DBG_ERRORFILE( "XclExpPivotTable::SetFieldPropertiesFromDim - called for data field" ); + OSL_FAIL( "XclExpPivotTable::SetFieldPropertiesFromDim - called for data field" ); break; default:; } diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index f210efd1a4a1..d0ce6579aa55 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -176,7 +176,7 @@ void XclExpRecord::WriteBody( XclExpStream& /*rStrm*/ ) void XclExpRecord::Save( XclExpStream& rStrm ) { - DBG_ASSERT( mnRecId != EXC_ID_UNKNOWN, "XclExpRecord::Save - record ID uninitialized" ); + OSL_ENSURE( mnRecId != EXC_ID_UNKNOWN, "XclExpRecord::Save - record ID uninitialized" ); rStrm.StartRecord( mnRecId, mnRecSize ); WriteBody( rStrm ); rStrm.EndRecord(); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index d72f9c77d61d..47bcd4497a5a 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -81,91 +81,91 @@ XclExpRoot::XclExpRoot( XclExpRootData& rExpRootData ) : XclExpTabInfo& XclExpRoot::GetTabInfo() const { - DBG_ASSERT( mrExpData.mxTabInfo, "XclExpRoot::GetTabInfo - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxTabInfo, "XclExpRoot::GetTabInfo - missing object (wrong BIFF?)" ); return *mrExpData.mxTabInfo; } XclExpAddressConverter& XclExpRoot::GetAddressConverter() const { - DBG_ASSERT( mrExpData.mxAddrConv, "XclExpRoot::GetAddressConverter - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxAddrConv, "XclExpRoot::GetAddressConverter - missing object (wrong BIFF?)" ); return *mrExpData.mxAddrConv; } XclExpFormulaCompiler& XclExpRoot::GetFormulaCompiler() const { - DBG_ASSERT( mrExpData.mxFmlaComp, "XclExpRoot::GetFormulaCompiler - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxFmlaComp, "XclExpRoot::GetFormulaCompiler - missing object (wrong BIFF?)" ); return *mrExpData.mxFmlaComp; } XclExpProgressBar& XclExpRoot::GetProgressBar() const { - DBG_ASSERT( mrExpData.mxProgress, "XclExpRoot::GetProgressBar - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxProgress, "XclExpRoot::GetProgressBar - missing object (wrong BIFF?)" ); return *mrExpData.mxProgress; } XclExpSst& XclExpRoot::GetSst() const { - DBG_ASSERT( mrExpData.mxSst, "XclExpRoot::GetSst - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxSst, "XclExpRoot::GetSst - missing object (wrong BIFF?)" ); return *mrExpData.mxSst; } XclExpPalette& XclExpRoot::GetPalette() const { - DBG_ASSERT( mrExpData.mxPalette, "XclExpRoot::GetPalette - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxPalette, "XclExpRoot::GetPalette - missing object (wrong BIFF?)" ); return *mrExpData.mxPalette; } XclExpFontBuffer& XclExpRoot::GetFontBuffer() const { - DBG_ASSERT( mrExpData.mxFontBfr, "XclExpRoot::GetFontBuffer - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxFontBfr, "XclExpRoot::GetFontBuffer - missing object (wrong BIFF?)" ); return *mrExpData.mxFontBfr; } XclExpNumFmtBuffer& XclExpRoot::GetNumFmtBuffer() const { - DBG_ASSERT( mrExpData.mxNumFmtBfr, "XclExpRoot::GetNumFmtBuffer - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxNumFmtBfr, "XclExpRoot::GetNumFmtBuffer - missing object (wrong BIFF?)" ); return *mrExpData.mxNumFmtBfr; } XclExpXFBuffer& XclExpRoot::GetXFBuffer() const { - DBG_ASSERT( mrExpData.mxXFBfr, "XclExpRoot::GetXFBuffer - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxXFBfr, "XclExpRoot::GetXFBuffer - missing object (wrong BIFF?)" ); return *mrExpData.mxXFBfr; } XclExpLinkManager& XclExpRoot::GetGlobalLinkManager() const { - DBG_ASSERT( mrExpData.mxGlobLinkMgr, "XclExpRoot::GetGlobalLinkManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxGlobLinkMgr, "XclExpRoot::GetGlobalLinkManager - missing object (wrong BIFF?)" ); return *mrExpData.mxGlobLinkMgr; } XclExpLinkManager& XclExpRoot::GetLocalLinkManager() const { - DBG_ASSERT( GetLocalLinkMgrRef(), "XclExpRoot::GetLocalLinkManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( GetLocalLinkMgrRef(), "XclExpRoot::GetLocalLinkManager - missing object (wrong BIFF?)" ); return *GetLocalLinkMgrRef(); } XclExpNameManager& XclExpRoot::GetNameManager() const { - DBG_ASSERT( mrExpData.mxNameMgr, "XclExpRoot::GetNameManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxNameMgr, "XclExpRoot::GetNameManager - missing object (wrong BIFF?)" ); return *mrExpData.mxNameMgr; } XclExpObjectManager& XclExpRoot::GetObjectManager() const { - DBG_ASSERT( mrExpData.mxObjMgr, "XclExpRoot::GetObjectManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxObjMgr, "XclExpRoot::GetObjectManager - missing object (wrong BIFF?)" ); return *mrExpData.mxObjMgr; } XclExpFilterManager& XclExpRoot::GetFilterManager() const { - DBG_ASSERT( mrExpData.mxFilterMgr, "XclExpRoot::GetFilterManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxFilterMgr, "XclExpRoot::GetFilterManager - missing object (wrong BIFF?)" ); return *mrExpData.mxFilterMgr; } XclExpPivotTableManager& XclExpRoot::GetPivotTableManager() const { - DBG_ASSERT( mrExpData.mxPTableMgr, "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" ); + OSL_ENSURE( mrExpData.mxPTableMgr, "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" ); return *mrExpData.mxPTableMgr; } @@ -236,7 +236,7 @@ XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const case EXC_ID_EXTERNSHEET: xRec = GetLocalLinkMgrRef(); break; case EXC_ID_NAME: xRec = mrExpData.mxNameMgr; break; } - DBG_ASSERT( xRec, "XclExpRoot::CreateRecord - unknown record ID or missing object" ); + OSL_ENSURE( xRec, "XclExpRoot::CreateRecord - unknown record ID or missing object" ); return xRec; } diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index d6d729ce1de2..331ae1303b94 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -121,7 +121,7 @@ XclExpStream::~XclExpStream() void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ) { - DBG_ASSERT( !mbInRec, "XclExpStream::StartRecord - another record still open" ); + OSL_ENSURE( !mbInRec, "XclExpStream::StartRecord - another record still open" ); DisableEncryption(); mnMaxContSize = mnCurrMaxSize = mnMaxRecSize; mnPredictSize = nRecSize; @@ -133,7 +133,7 @@ void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ) void XclExpStream::EndRecord() { - DBG_ASSERT( mbInRec, "XclExpStream::EndRecord - no record open" ); + OSL_ENSURE( mbInRec, "XclExpStream::EndRecord - no record open" ); DisableEncryption(); UpdateRecSize(); mrStrm.Seek( STREAM_SEEK_TO_END ); @@ -243,7 +243,7 @@ sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) sal_Size nWriteRet = nWriteLen; if (mbUseEncrypter && HasValidEncrypter()) { - DBG_ASSERT(nWriteLen > 0, "XclExpStream::Write: write length is 0!"); + OSL_ENSURE(nWriteLen > 0, "XclExpStream::Write: write length is 0!"); vector<sal_uInt8> aBytes(nWriteLen); memcpy(&aBytes[0], pBuffer, nWriteLen); mxEncrypter->EncryptBytes(mrStrm, aBytes); @@ -253,7 +253,7 @@ sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) { nWriteRet = mrStrm.Write( pBuffer, nWriteLen ); bValid = (nWriteLen == nWriteRet); - DBG_ASSERT( bValid, "XclExpStream::Write - stream write error" ); + OSL_ENSURE( bValid, "XclExpStream::Write - stream write error" ); } pBuffer += nWriteRet; nRet += nWriteRet; @@ -395,7 +395,7 @@ void XclExpStream::DisableEncryption() sal_Size XclExpStream::SetSvStreamPos( sal_Size nPos ) { - DBG_ASSERT( !mbInRec, "XclExpStream::SetSvStreamPos - not allowed inside of a record" ); + OSL_ENSURE( !mbInRec, "XclExpStream::SetSvStreamPos - not allowed inside of a record" ); return mbInRec ? 0 : mrStrm.Seek( nPos ); } @@ -423,12 +423,12 @@ void XclExpStream::UpdateRecSize() void XclExpStream::UpdateSizeVars( sal_Size nSize ) { - DBG_ASSERT( mnCurrSize + nSize <= mnCurrMaxSize, "XclExpStream::UpdateSizeVars - record overwritten" ); + OSL_ENSURE( mnCurrSize + nSize <= mnCurrMaxSize, "XclExpStream::UpdateSizeVars - record overwritten" ); mnCurrSize = mnCurrSize + static_cast< sal_uInt16 >( nSize ); if( mnMaxSliceSize > 0 ) { - DBG_ASSERT( mnSliceSize + nSize <= mnMaxSliceSize, "XclExpStream::UpdateSizeVars - slice overwritten" ); + OSL_ENSURE( mnSliceSize + nSize <= mnMaxSliceSize, "XclExpStream::UpdateSizeVars - slice overwritten" ); mnSliceSize = mnSliceSize + static_cast< sal_uInt16 >( nSize ); if( mnSliceSize >= mnMaxSliceSize ) mnSliceSize = 0; @@ -660,11 +660,11 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy sal_uInt16 nEncBytes = ::std::min(nBlockLeft, nBytesLeft); bool bRet = maCodec.Encode(&aBytes[nPos], nEncBytes, &aBytes[nPos], nEncBytes); - DBG_ASSERT(bRet, "XclExpBiff8Encrypter::EncryptBytes: encryption failed!!"); + OSL_ENSURE(bRet, "XclExpBiff8Encrypter::EncryptBytes: encryption failed!!"); bRet = bRet; // to remove a silly compiler warning. sal_Size nRet = rStrm.Write(&aBytes[nPos], nEncBytes); - DBG_ASSERT(nRet == nEncBytes, "XclExpBiff8Encrypter::EncryptBytes: fail to write to stream!!"); + OSL_ENSURE(nRet == nEncBytes, "XclExpBiff8Encrypter::EncryptBytes: fail to write to stream!!"); nRet = nRet; // to remove a silly compiler warning. nStrmPos = rStrm.Tell(); @@ -824,7 +824,7 @@ OString XclXmlUtils::ToOString( const XclAddress& rAddress ) OString XclXmlUtils::ToOString( const XclExpString& s ) { - DBG_ASSERT( !s.IsRich(), "XclXmlUtils::ToOString(XclExpString): rich text string found!" ); + OSL_ENSURE( !s.IsRich(), "XclXmlUtils::ToOString(XclExpString): rich text string found!" ); return ToOString( s.GetUnicodeBuffer() ); } @@ -883,7 +883,7 @@ OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddre OUString XclXmlUtils::ToOUString( const XclExpString& s ) { - DBG_ASSERT( !s.IsRich(), "XclXmlUtils::ToOString(XclExpString): rich text string found!" ); + OSL_ENSURE( !s.IsRich(), "XclXmlUtils::ToOString(XclExpString): rich text string found!" ); return ToOUString( s.GetUnicodeBuffer() ); } @@ -1000,7 +1000,7 @@ XclExpXmlStream::~XclExpXmlStream() sax_fastparser::FSHelperPtr& XclExpXmlStream::GetCurrentStream() { - DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::GetCurrentStream - no current stream" ); + OSL_ENSURE( !maStreams.empty(), "XclExpXmlStream::GetCurrentStream - no current stream" ); return maStreams.top(); } @@ -1011,7 +1011,7 @@ void XclExpXmlStream::PushStream( sax_fastparser::FSHelperPtr aStream ) void XclExpXmlStream::PopStream() { - DBG_ASSERT( !maStreams.empty(), "XclExpXmlStream::PopStream - stack is empty!" ); + OSL_ENSURE( !maStreams.empty(), "XclExpXmlStream::PopStream - stack is empty!" ); maStreams.pop(); } diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 987b25dba294..a6a502d4fba9 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -194,8 +194,8 @@ void XclExpString::SetFormats( const XclFormatRunVec& rFormats ) XclFormatRunVec::const_iterator aPrev = aCurr; XclFormatRunVec::const_iterator aEnd = maFormats.end(); for( ++aCurr; aCurr != aEnd; ++aCurr, ++aPrev ) - DBG_ASSERT( aPrev->mnChar < aCurr->mnChar, "XclExpString::SetFormats - invalid char order" ); - DBG_ASSERT( aPrev->mnChar <= mnLen, "XclExpString::SetFormats - invalid char index" ); + OSL_ENSURE( aPrev->mnChar < aCurr->mnChar, "XclExpString::SetFormats - invalid char order" ); + OSL_ENSURE( aPrev->mnChar <= mnLen, "XclExpString::SetFormats - invalid char index" ); } #endif LimitFormatCount( mbIsBiff8 ? EXC_STR_MAXLEN : EXC_STR_MAXLEN_8BIT ); @@ -203,7 +203,7 @@ void XclExpString::SetFormats( const XclFormatRunVec& rFormats ) void XclExpString::AppendFormat( sal_uInt16 nChar, sal_uInt16 nFontIdx, bool bDropDuplicate ) { - DBG_ASSERT( maFormats.empty() || (maFormats.back().mnChar < nChar), "XclExpString::AppendFormat - invalid char index" ); + OSL_ENSURE( maFormats.empty() || (maFormats.back().mnChar < nChar), "XclExpString::AppendFormat - invalid char index" ); size_t nMaxSize = static_cast< size_t >( mbIsBiff8 ? EXC_STR_MAXLEN : EXC_STR_MAXLEN_8BIT ); if( maFormats.empty() || ((maFormats.size() < nMaxSize) && (!bDropDuplicate || (maFormats.back().mnFontIdx != nFontIdx))) ) maFormats.push_back( XclFormatRun( nChar, nFontIdx ) ); @@ -288,7 +288,7 @@ sal_Size XclExpString::GetSize() const sal_uInt16 XclExpString::GetChar( sal_uInt16 nCharIdx ) const { - DBG_ASSERT( nCharIdx < Len(), "XclExpString::GetChar - invalid character index" ); + OSL_ENSURE( nCharIdx < Len(), "XclExpString::GetChar - invalid character index" ); return static_cast< sal_uInt16 >( mbIsBiff8 ? maUniBuffer[ nCharIdx ] : maCharBuffer[ nCharIdx ] ); } @@ -321,7 +321,7 @@ void XclExpString::WriteFlagField( XclExpStream& rStrm ) const void XclExpString::WriteHeader( XclExpStream& rStrm ) const { - DBG_ASSERT( !mb8BitLen || (mnLen < 256), "XclExpString::WriteHeader - string too long" ); + OSL_ENSURE( !mb8BitLen || (mnLen < 256), "XclExpString::WriteHeader - string too long" ); PrepareWrite( rStrm, GetHeaderSize() ); // length WriteLenField( rStrm ); @@ -378,9 +378,9 @@ void XclExpString::Write( XclExpStream& rStrm ) const void XclExpString::WriteHeaderToMem( sal_uInt8* pnMem ) const { - DBG_ASSERT( pnMem, "XclExpString::WriteHeaderToMem - no memory to write to" ); - DBG_ASSERT( !mb8BitLen || (mnLen < 256), "XclExpString::WriteHeaderToMem - string too long" ); - DBG_ASSERT( !IsWriteFormats(), "XclExpString::WriteHeaderToMem - formatted strings not supported" ); + OSL_ENSURE( pnMem, "XclExpString::WriteHeaderToMem - no memory to write to" ); + OSL_ENSURE( !mb8BitLen || (mnLen < 256), "XclExpString::WriteHeaderToMem - string too long" ); + OSL_ENSURE( !IsWriteFormats(), "XclExpString::WriteHeaderToMem - formatted strings not supported" ); // length if( mb8BitLen ) { @@ -399,7 +399,7 @@ void XclExpString::WriteHeaderToMem( sal_uInt8* pnMem ) const void XclExpString::WriteBufferToMem( sal_uInt8* pnMem ) const { - DBG_ASSERT( pnMem, "XclExpString::WriteBufferToMem - no memory to write to" ); + OSL_ENSURE( pnMem, "XclExpString::WriteBufferToMem - no memory to write to" ); if( !IsEmpty() ) { if( mbIsBiff8 ) @@ -499,7 +499,7 @@ void XclExpString::SetStrLen( sal_Int32 nNewLen ) void XclExpString::CharsToBuffer( const sal_Unicode* pcSource, sal_Int32 nBegin, sal_Int32 nLen ) { - DBG_ASSERT( maUniBuffer.size() >= static_cast< size_t >( nBegin + nLen ), + OSL_ENSURE( maUniBuffer.size() >= static_cast< size_t >( nBegin + nLen ), "XclExpString::CharsToBuffer - char buffer invalid" ); ScfUInt16Vec::iterator aBeg = maUniBuffer.begin() + nBegin; ScfUInt16Vec::iterator aEnd = aBeg + nLen; @@ -516,7 +516,7 @@ void XclExpString::CharsToBuffer( const sal_Unicode* pcSource, sal_Int32 nBegin, void XclExpString::CharsToBuffer( const sal_Char* pcSource, sal_Int32 nBegin, sal_Int32 nLen ) { - DBG_ASSERT( maCharBuffer.size() >= static_cast< size_t >( nBegin + nLen ), + OSL_ENSURE( maCharBuffer.size() >= static_cast< size_t >( nBegin + nLen ), "XclExpString::CharsToBuffer - char buffer invalid" ); ScfUInt8Vec::iterator aBeg = maCharBuffer.begin() + nBegin; ScfUInt8Vec::iterator aEnd = aBeg + nLen; @@ -576,7 +576,7 @@ void XclExpString::InitAppend( sal_Int32 nAddLen ) void XclExpString::BuildAppend( const sal_Unicode* pcSource, sal_Int32 nAddLen ) { - DBG_ASSERT( mbIsBiff8, "XclExpString::BuildAppend - must not be called at byte strings" ); + OSL_ENSURE( mbIsBiff8, "XclExpString::BuildAppend - must not be called at byte strings" ); if( mbIsBiff8 ) { sal_uInt16 nOldLen = mnLen; @@ -587,7 +587,7 @@ void XclExpString::BuildAppend( const sal_Unicode* pcSource, sal_Int32 nAddLen ) void XclExpString::BuildAppend( const sal_Char* pcSource, sal_Int32 nAddLen ) { - DBG_ASSERT( !mbIsBiff8, "XclExpString::BuildAppend - must not be called at unicode strings" ); + OSL_ENSURE( !mbIsBiff8, "XclExpString::BuildAppend - must not be called at unicode strings" ); if( !mbIsBiff8 ) { sal_uInt16 nOldLen = mnLen; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index eb5075c189ca..8846c5e1cef3 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -81,7 +81,7 @@ sal_uInt32 lclGetWeighting( XclExpColorType eType ) case EXC_COLOR_TABBG: case EXC_COLOR_CELLAREA: return 20; case EXC_COLOR_GRID: return 50; - default: DBG_ERRORFILE( "lclGetWeighting - unknown color type" ); + default: OSL_FAIL( "lclGetWeighting - unknown color type" ); } return 1; } @@ -409,7 +409,7 @@ void XclExpPaletteImpl::Finalize() nFound = nIndex; // replace default color with list color sal_uInt32 nNearest = aNearestVec[ nFound ].mnPalIndex; - DBG_ASSERT( nNearest < maPalette.size(), "XclExpPaletteImpl::Finalize - algorithm error" ); + OSL_ENSURE( nNearest < maPalette.size(), "XclExpPaletteImpl::Finalize - algorithm error" ); maPalette[ nNearest ].SetColor( mxColorList->at( nFound ).GetColor() ); aRemapVec[ nFound ].SetIndex( nNearest ); } @@ -601,7 +601,7 @@ void XclExpPaletteImpl::RawReducePalette( sal_uInt32 nPass ) sal_uInt8 nR, nG, nB; sal_uInt8& rnComp = ((nPass % 3 == 0) ? nB : ((nPass % 3 == 1) ? nR : nG)); nPass /= 3; - DBG_ASSERT( nPass < 7, "XclExpPaletteImpl::RawReducePalette - reduction not terminated" ); + OSL_ENSURE( nPass < 7, "XclExpPaletteImpl::RawReducePalette - reduction not terminated" ); static const sal_uInt8 spnFactor2[] = { 0x81, 0x82, 0x84, 0x88, 0x92, 0xAA, 0xFF }; sal_uInt8 nFactor1 = static_cast< sal_uInt8 >( 0x02 << nPass ); @@ -884,7 +884,7 @@ sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const S nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN ); break; default: - DBG_ERRORFILE( "XclExpFontHelper::GetFirstUsedScript - unknown script type" ); + OSL_FAIL( "XclExpFontHelper::GetFirstUsedScript - unknown script type" ); nScript = ApiScriptType::LATIN; }; pCurrSet = pCurrSet->GetParent(); @@ -908,7 +908,7 @@ Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxIte case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; - default: DBG_ERRORFILE( "XclExpFontHelper::GetFontFromItemSet - unknown script type" ); + default: OSL_FAIL( "XclExpFontHelper::GetFontFromItemSet - unknown script type" ); } // fill the font object @@ -942,7 +942,7 @@ bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rI case ApiScriptType::LATIN: bUsed = ScfTools::CheckItems( rItemSet, pnLatinIds, bDeep ); break; case ApiScriptType::ASIAN: bUsed = ScfTools::CheckItems( rItemSet, pnAsianIds, bDeep ); break; case ApiScriptType::COMPLEX: bUsed = ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep ); break; - default: DBG_ERRORFILE( "XclExpFontHelper::CheckItems - unknown script type" ); + default: OSL_FAIL( "XclExpFontHelper::CheckItems - unknown script type" ); } } return bUsed; @@ -1012,7 +1012,7 @@ void XclExpFont::WriteBody( XclExpStream& rStrm ) ::set_flag( nAttr, EXC_FONTATTR_OUTLINE, maData.mbOutline ); ::set_flag( nAttr, EXC_FONTATTR_SHADOW, maData.mbShadow ); - DBG_ASSERT( maData.maName.Len() < 256, "XclExpFont::WriteBody - font name too long" ); + OSL_ENSURE( maData.maName.Len() < 256, "XclExpFont::WriteBody - font name too long" ); XclExpString aFontName; if( GetBiff() <= EXC_BIFF5 ) aFontName.AssignByte( maData.maName, GetTextEncoding(), EXC_STR_8BITLENGTH ); @@ -1340,7 +1340,7 @@ String XclExpNumFmtBuffer::GetFormatCode( const XclExpNumFmt& rFormat ) sal_uInt32 nKey; String aTemp( pEntry->GetFormatstring() ); mxFormatter->PutandConvertEntry( aTemp, nCheckPos, nType, nKey, eLang, LANGUAGE_ENGLISH_US ); - DBG_ASSERT( nCheckPos == 0, "XclExpNumFmtBuffer::WriteFormatRecord - format code not convertible" ); + OSL_ENSURE( nCheckPos == 0, "XclExpNumFmtBuffer::WriteFormatRecord - format code not convertible" ); pEntry = mxFormatter->GetEntry( nKey ); } @@ -1351,7 +1351,7 @@ String XclExpNumFmtBuffer::GetFormatCode( const XclExpNumFmt& rFormat ) } else { - DBG_ERRORFILE( "XclExpNumFmtBuffer::WriteFormatRecord - format not found" ); + OSL_FAIL( "XclExpNumFmtBuffer::WriteFormatRecord - format not found" ); aFormatStr.AssignAscii( "General" ); } @@ -2130,10 +2130,10 @@ XclExpStyle::XclExpStyle( sal_uInt32 nXFId, const String& rStyleName ) : mnStyleId( EXC_STYLE_USERDEF ), mnLevel( EXC_STYLE_NOLEVEL ) { - DBG_ASSERT( maName.Len(), "XclExpStyle::XclExpStyle - empty style name" ); + OSL_ENSURE( maName.Len(), "XclExpStyle::XclExpStyle - empty style name" ); #ifdef DBG_UTIL sal_uInt8 nStyleId, nLevel; // do not use members for debug tests - DBG_ASSERT( !XclTools::GetBuiltInStyleId( nStyleId, nLevel, maName ), + OSL_ENSURE( !XclTools::GetBuiltInStyleId( nStyleId, nLevel, maName ), "XclExpStyle::XclExpStyle - this is a built-in style" ); #endif } @@ -2439,7 +2439,7 @@ sal_uInt16 XclExpXFBuffer::GetXFIndex( sal_uInt32 nXFId ) const sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 nXFIndex ) const { - DBG_ASSERT( nXFIndex < maStyleIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); + OSL_ENSURE( nXFIndex < maStyleIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); if( nXFIndex > maStyleIndexes.size() ) return 0; // should be caught/debugged via above assert; return "valid" index. return maStyleIndexes[ nXFIndex ]; @@ -2447,7 +2447,7 @@ sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 nXFIndex ) const sal_Int32 XclExpXFBuffer::GetXmlCellIndex( sal_uInt32 nXFIndex ) const { - DBG_ASSERT( nXFIndex < maCellIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); + OSL_ENSURE( nXFIndex < maCellIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); if( nXFIndex > maCellIndexes.size() ) return 0; // should be caught/debugged via above assert; return "valid" index. return maCellIndexes[ nXFIndex ]; @@ -2548,10 +2548,10 @@ void XclExpXFBuffer::SaveXFXml( XclExpXmlStream& rStrm, XclExpXF& rXF ) { XclExpBorderList::iterator aBorderPos = std::find_if( maBorders.begin(), maBorders.end(), XclExpBorderPred( rXF.GetBorderData() ) ); - DBG_ASSERT( aBorderPos != maBorders.end(), "XclExpXFBuffer::SaveXml - Invalid @borderId!" ); + OSL_ENSURE( aBorderPos != maBorders.end(), "XclExpXFBuffer::SaveXml - Invalid @borderId!" ); XclExpFillList::iterator aFillPos = std::find_if( maFills.begin(), maFills.end(), XclExpFillPred( rXF.GetAreaData() ) ); - DBG_ASSERT( aFillPos != maFills.end(), "XclExpXFBuffer::SaveXml - Invalid @fillId!" ); + OSL_ENSURE( aFillPos != maFills.end(), "XclExpXFBuffer::SaveXml - Invalid @fillId!" ); sal_Int32 nBorderId = 0, nFillId = 0; if( aBorderPos != maBorders.end() ) @@ -2651,7 +2651,7 @@ sal_uInt32 XclExpXFBuffer::InsertStyleXF( const SfxStyleSheetBase& rStyleSheet ) } else { - DBG_ASSERT( maXFList.HasRecord( nXFId ), "XclExpXFBuffer::InsertStyleXF - built-in XF not found" ); + OSL_ENSURE( maXFList.HasRecord( nXFId ), "XclExpXFBuffer::InsertStyleXF - built-in XF not found" ); // XF record still predefined? -> Replace with real XF bool& rbPredefined = maBuiltInMap[ nXFId ].mbPredefined; if( rbPredefined ) @@ -2752,7 +2752,7 @@ void XclExpXFBuffer::InsertDefaultRecords() } else { - DBG_ERRORFILE( "XclExpXFBuffer::InsertDefaultRecords - default style not found" ); + OSL_FAIL( "XclExpXFBuffer::InsertDefaultRecords - default style not found" ); XclExpXFRef xDefStyle( new XclExpDefaultXF( GetRoot(), false ) ); xDefStyle->SetAllUsedFlags( true ); AppendBuiltInXFWithStyle( xDefStyle, EXC_STYLE_NORMAL ); @@ -2803,12 +2803,12 @@ void XclExpXFBuffer::InsertDefaultRecords() void XclExpXFBuffer::AppendXFIndex( sal_uInt32 nXFId ) { - DBG_ASSERT( nXFId < maXFIndexVec.size(), "XclExpXFBuffer::AppendXFIndex - XF ID out of range" ); + OSL_ENSURE( nXFId < maXFIndexVec.size(), "XclExpXFBuffer::AppendXFIndex - XF ID out of range" ); maXFIndexVec[ nXFId ] = static_cast< sal_uInt16 >( maSortedXFList.GetSize() ); XclExpXFRef xXF = maXFList.GetRecord( nXFId ); AddBorderAndFill( *xXF ); maSortedXFList.AppendRecord( xXF ); - DBG_ASSERT( maXFList.HasRecord( nXFId ), "XclExpXFBuffer::AppendXFIndex - XF not found" ); + OSL_ENSURE( maXFList.HasRecord( nXFId ), "XclExpXFBuffer::AppendXFIndex - XF not found" ); } void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF ) diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 09f9752caea2..e6621f000b40 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -60,7 +60,7 @@ XclExpStringRec::XclExpStringRec( const XclExpRoot& rRoot, const String& rResult XclExpRecord( EXC_ID3_STRING ), mxResult( XclExpStringHelper::CreateString( rRoot, rResult ) ) { - DBG_ASSERT( (rRoot.GetBiff() <= EXC_BIFF5) || (mxResult->Len() > 0), + OSL_ENSURE( (rRoot.GetBiff() <= EXC_BIFF5) || (mxResult->Len() > 0), "XclExpStringRec::XclExpStringRec - empty result not allowed in BIFF8+" ); SetRecSize( mxResult->GetSize() ); } @@ -154,7 +154,7 @@ XclExpArrayRef XclExpArrayBuffer::CreateArray( const ScTokenArray& rScTokArr, co const ScAddress& rScPos = rScRange.aStart; XclTokenArrayRef xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_MATRIX, rScTokArr, &rScPos ); - DBG_ASSERT( maRecMap.find( rScPos ) == maRecMap.end(), "XclExpArrayBuffer::CreateArray - array exists already" ); + OSL_ENSURE( maRecMap.find( rScPos ) == maRecMap.end(), "XclExpArrayBuffer::CreateArray - array exists already" ); XclExpArrayRef& rxRec = maRecMap[ rScPos ]; rxRec.reset( new XclExpArray( xTokArr, rScRange ) ); return rxRec; @@ -234,7 +234,7 @@ XclExpShrfmlaRef XclExpShrfmlaBuffer::CreateOrExtendShrfmla( else { // extend existing record - DBG_ASSERT( aIt->second, "XclExpShrfmlaBuffer::CreateOrExtendShrfmla - missing record" ); + OSL_ENSURE( aIt->second, "XclExpShrfmlaBuffer::CreateOrExtendShrfmla - missing record" ); xRec = aIt->second; xRec->ExtendRange( rScPos ); } @@ -312,7 +312,7 @@ bool XclExpTableop::TryExtend( const ScAddress& rScPos, const XclMultipleOpRefs& if( bOk ) { // extend the cell range - DBG_ASSERT( IsAppendable( nXclCol, nXclRow ), "XclExpTableop::TryExtend - wrong cell address" ); + OSL_ENSURE( IsAppendable( nXclCol, nXclRow ), "XclExpTableop::TryExtend - wrong cell address" ); Extend( rScPos ); mnLastAppXclCol = nXclCol; } @@ -559,7 +559,7 @@ void XclExpSingleCellBase::ConvertXFIndexes( const XclExpRoot& rRoot ) void XclExpSingleCellBase::Save( XclExpStream& rStrm ) { - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); AddRecSize( mnContSize ); XclExpCellBase::Save( rStrm ); } @@ -680,7 +680,7 @@ bool XclExpLabelCell::IsMultiLineText() const void XclExpLabelCell::Init( const XclExpRoot& rRoot, const ScPatternAttr* pPattern, XclExpStringRef xText ) { - DBG_ASSERT( xText && xText->Len(), "XclExpLabelCell::XclExpLabelCell - empty string passed" ); + OSL_ENSURE( xText && xText->Len(), "XclExpLabelCell::XclExpLabelCell - empty string passed" ); mxText = xText; mnSstIndex = 0; @@ -688,7 +688,7 @@ void XclExpLabelCell::Init( const XclExpRoot& rRoot, sal_uInt16 nXclFont = mxText->RemoveLeadingFont(); if( GetXFId() == EXC_XFID_NOTFOUND ) { - DBG_ASSERT( nXclFont != EXC_FONT_NOTFOUND, "XclExpLabelCell::Init - leading font not found" ); + OSL_ENSURE( nXclFont != EXC_FONT_NOTFOUND, "XclExpLabelCell::Init - leading font not found" ); bool bForceLineBreak = mxText->IsWrapped(); SetXFId( rRoot.GetXFBuffer().InsertWithFont( pPattern, ApiScriptType::WEAK, nXclFont, bForceLineBreak ) ); } @@ -702,12 +702,12 @@ void XclExpLabelCell::Init( const XclExpRoot& rRoot, { case EXC_BIFF5: // BIFF5-BIFF7: create a LABEL or RSTRING record - DBG_ASSERT( mxText->Len() <= EXC_LABEL_MAXLEN, "XclExpLabelCell::XclExpLabelCell - string too long" ); + OSL_ENSURE( mxText->Len() <= EXC_LABEL_MAXLEN, "XclExpLabelCell::XclExpLabelCell - string too long" ); SetContSize( mxText->GetSize() ); // formatted string is exported in an RSTRING record if( mxText->IsRich() ) { - DBG_ASSERT( mxText->GetFormatsCount() <= EXC_LABEL_MAXLEN, "XclExpLabelCell::WriteContents - too many formats" ); + OSL_ENSURE( mxText->GetFormatsCount() <= EXC_LABEL_MAXLEN, "XclExpLabelCell::WriteContents - too many formats" ); mxText->LimitFormatCount( EXC_LABEL_MAXLEN ); SetRecId( EXC_ID_RSTRING ); SetContSize( GetContSize() + 1 + 2 * mxText->GetFormatsCount() ); @@ -830,7 +830,7 @@ XclExpFormulaCell::XclExpFormulaCell( SCCOL nMatWidth; SCROW nMatHeight; mrScFmlaCell.GetMatColsRows( nMatWidth, nMatHeight ); - DBG_ASSERT( nMatWidth && nMatHeight, "XclExpFormulaCell::XclExpFormulaCell - empty matrix" ); + OSL_ENSURE( nMatWidth && nMatHeight, "XclExpFormulaCell::XclExpFormulaCell - empty matrix" ); ScRange aMatScRange( aScPos ); ScAddress& rMatEnd = aMatScRange.aEnd; rMatEnd.IncCol( static_cast< SCsCOL >( nMatWidth - 1 ) ); @@ -846,7 +846,7 @@ XclExpFormulaCell::XclExpFormulaCell( // other formula cell covered by a matrix - find the ARRAY record mxAddRec = rArrayBfr.FindArray( rScTokArr ); // should always be found, if Calc document is not broken - DBG_ASSERT( mxAddRec, "XclExpFormulaCell::XclExpFormulaCell - no matrix found" ); + OSL_ENSURE( mxAddRec, "XclExpFormulaCell::XclExpFormulaCell - no matrix found" ); } break; default:; @@ -868,7 +868,7 @@ void XclExpFormulaCell::Save( XclExpStream& rStrm ) mxTokArr = mxAddRec->CreateCellTokenArray( rStrm.GetRoot() ); // FORMULA record itself - DBG_ASSERT( mxTokArr, "XclExpFormulaCell::Save - missing token array" ); + OSL_ENSURE( mxTokArr, "XclExpFormulaCell::Save - missing token array" ); if( !mxTokArr ) mxTokArr = rStrm.GetRoot().GetFormulaCompiler().CreateErrorFormula( EXC_ERR_NA ); SetContSize( 16 + mxTokArr->GetSize() ); @@ -1017,7 +1017,7 @@ void XclExpMultiCellBase::ConvertXFIndexes( const XclExpRoot& rRoot ) void XclExpMultiCellBase::Save( XclExpStream& rStrm ) { - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); XclExpMultiXFIdDeq::const_iterator aEnd = maXFIds.end(); XclExpMultiXFIdDeq::const_iterator aRangeBeg = maXFIds.begin(); @@ -1157,7 +1157,7 @@ bool XclExpMultiCellBase::TryMergeXFIds( const XclExpMultiCellBase& rCell ) void XclExpMultiCellBase::GetXFIndexes( ScfUInt16Vec& rXFIndexes ) const { - DBG_ASSERT( GetLastXclCol() < rXFIndexes.size(), "XclExpMultiCellBase::GetXFIndexes - vector too small" ); + OSL_ENSURE( GetLastXclCol() < rXFIndexes.size(), "XclExpMultiCellBase::GetXFIndexes - vector too small" ); ScfUInt16Vec::iterator aDestIt = rXFIndexes.begin() + GetXclCol(); for( XclExpMultiXFIdDeq::const_iterator aIt = maXFIds.begin(), aEnd = maXFIds.end(); aIt != aEnd; ++aIt ) { @@ -1170,7 +1170,7 @@ void XclExpMultiCellBase::RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes { // save last column before calling maXFIds.clear() sal_uInt16 nLastXclCol = GetLastXclCol(); - DBG_ASSERT( nLastXclCol < rXFIndexes.size(), "XclExpMultiCellBase::RemoveUnusedXFIndexes - XF index vector too small" ); + OSL_ENSURE( nLastXclCol < rXFIndexes.size(), "XclExpMultiCellBase::RemoveUnusedXFIndexes - XF index vector too small" ); // build new XF index vector, containing passed XF indexes maXFIds.clear(); @@ -1201,7 +1201,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( XclExpBlankCell, 256, 256 ) XclExpBlankCell::XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId ) : XclExpMultiCellBase( EXC_ID3_BLANK, EXC_ID_MULBLANK, 0, rXclPos ) { - DBG_ASSERT( rXFId.mnCount > 0, "XclExpBlankCell::XclExpBlankCell - invalid count" ); + OSL_ENSURE( rXFId.mnCount > 0, "XclExpBlankCell::XclExpBlankCell - invalid count" ); AppendXFId( rXFId ); } @@ -1210,7 +1210,7 @@ XclExpBlankCell::XclExpBlankCell( const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId ) : XclExpMultiCellBase( EXC_ID3_BLANK, EXC_ID_MULBLANK, 0, rXclPos ) { - DBG_ASSERT( rXclPos.mnCol <= nLastXclCol, "XclExpBlankCell::XclExpBlankCell - invalid column range" ); + OSL_ENSURE( rXclPos.mnCol <= nLastXclCol, "XclExpBlankCell::XclExpBlankCell - invalid column range" ); // #i46627# use default script type instead of ApiScriptType::WEAK AppendXFId( rRoot, pPattern, rRoot.GetDefApiScript(), nForcedXFId, nLastXclCol - rXclPos.mnCol + 1 ); } @@ -1286,7 +1286,7 @@ void XclExpRkCell::WriteXmlContents( XclExpXmlStream& rStrm, const XclAddress& r void XclExpRkCell::WriteContents( XclExpStream& rStrm, sal_uInt16 nRelCol ) { - DBG_ASSERT( nRelCol < maRkValues.size(), "XclExpRkCell::WriteContents - overflow error" ); + OSL_ENSURE( nRelCol < maRkValues.size(), "XclExpRkCell::WriteContents - overflow error" ); rStrm << maRkValues[ nRelCol ]; } @@ -1703,7 +1703,7 @@ void XclExpDefrowheight::SetDefaultData( const XclExpDefaultRowData& rDefData ) void XclExpDefrowheight::WriteBody( XclExpStream& rStrm ) { - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF3 ); rStrm << maDefData.mnFlags << maDefData.mnHeight; } @@ -1755,7 +1755,7 @@ XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow, void XclExpRow::AppendCell( XclExpCellRef xCell, bool bIsMergedBase ) { - DBG_ASSERT( !mbAlwaysEmpty, "XclExpRow::AppendCell - row is marked to be always empty" ); + OSL_ENSURE( !mbAlwaysEmpty, "XclExpRow::AppendCell - row is marked to be always empty" ); // try to merge with last existing cell InsertCell( xCell, maCellList.GetSize(), bIsMergedBase ); } @@ -1768,7 +1768,7 @@ void XclExpRow::Finalize( const ScfUInt16Vec& rColXFIndexes ) // additionally collect the blank XF indexes size_t nColCount = GetMaxPos().Col() + 1; - DBG_ASSERT( rColXFIndexes.size() == nColCount, "XclExpRow::Finalize - wrong column XF index count" ); + OSL_ENSURE( rColXFIndexes.size() == nColCount, "XclExpRow::Finalize - wrong column XF index count" ); ScfUInt16Vec aXFIndexes( nColCount, EXC_XF_NOTFOUND ); for( nPos = 0, nSize = maCellList.GetSize(); nPos < nSize; ++nPos ) @@ -1924,7 +1924,7 @@ void XclExpRow::DisableIfDefault( const XclExpDefaultRowData& rDefRowData ) void XclExpRow::WriteCellList( XclExpStream& rStrm ) { - DBG_ASSERT( mbEnabled || maCellList.IsEmpty(), "XclExpRow::WriteCellList - cells in disabled row" ); + OSL_ENSURE( mbEnabled || maCellList.IsEmpty(), "XclExpRow::WriteCellList - cells in disabled row" ); maCellList.Save( rStrm ); } @@ -1936,7 +1936,7 @@ void XclExpRow::Save( XclExpStream& rStrm ) void XclExpRow::InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase ) { - DBG_ASSERT( xCell, "XclExpRow::InsertCell - missing cell" ); + OSL_ENSURE( xCell, "XclExpRow::InsertCell - missing cell" ); /* If we have a multi-line text in a merged cell, and the resulting row height has not been confirmed, we need to force the EXC_ROW_UNSYNCED @@ -2005,7 +2005,7 @@ XclExpRowBuffer::XclExpRowBuffer( const XclExpRoot& rRoot ) : void XclExpRowBuffer::AppendCell( XclExpCellRef xCell, bool bIsMergedBase ) { - DBG_ASSERT( xCell, "XclExpRowBuffer::AppendCell - missing cell" ); + OSL_ENSURE( xCell, "XclExpRowBuffer::AppendCell - missing cell" ); GetOrCreateRow( xCell->GetXclRow(), false ).AppendCell( xCell, bIsMergedBase ); } @@ -2326,7 +2326,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : break; default: - DBG_ERRORFILE( "XclExpCellTable::XclExpCellTable - unknown cell type" ); + OSL_FAIL( "XclExpCellTable::XclExpCellTable - unknown cell type" ); // run-through! case CELLTYPE_NONE: case CELLTYPE_NOTE: @@ -2360,7 +2360,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : aScRange.aEnd.IncRow( rMergeItem.GetRowMerge() - 1 ); sal_uInt32 nXFId = xCell ? xCell->GetFirstXFId() : EXC_XFID_NOTFOUND; // blank cells merged vertically may occur repeatedly - DBG_ASSERT( (aScRange.aStart.Col() == aScRange.aEnd.Col()) || (nScCol == nLastScCol), + OSL_ENSURE( (aScRange.aStart.Col() == aScRange.aEnd.Col()) || (nScCol == nLastScCol), "XclExpCellTable::XclExpCellTable - invalid repeated blank merged cell" ); for( SCCOL nIndex = nScCol; nIndex <= nLastScCol; ++nIndex ) { @@ -2419,7 +2419,7 @@ XclExpRecordRef XclExpCellTable::CreateRecord( sal_uInt16 nRecId ) const case EXC_ID_MERGEDCELLS: xRec = mxMergedcells; break; case EXC_ID_HLINK: xRec = mxHyperlinkList; break; case EXC_ID_DVAL: xRec = mxDval; break; - default: DBG_ERRORFILE( "XclExpCellTable::CreateRecord - unknown record id" ); + default: OSL_FAIL( "XclExpCellTable::CreateRecord - unknown record id" ); } return xRec; } diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 47175656f06e..7d81945e37bc 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -165,7 +165,7 @@ void XclExpScl::Shorten( sal_uInt16 nFactor ) void XclExpScl::WriteBody( XclExpStream& rStrm ) { - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF4 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() >= EXC_BIFF4 ); rStrm << mnNum << mnDenom; } @@ -178,7 +178,7 @@ XclExpPane::XclExpPane( const XclTabViewData& rData ) : maSecondXclPos( rData.maSecondXclPos ), mnActivePane( rData.mnActivePane ) { - DBG_ASSERT( rData.IsSplit(), "XclExpPane::XclExpPane - no PANE record for unsplit view" ); + OSL_ENSURE( rData.IsSplit(), "XclExpPane::XclExpPane - no PANE record for unsplit view" ); } static const char* lcl_GetActivePane( sal_uInt8 nActivePane ) diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 0393ad2d45bf..39a89479f231 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -435,7 +435,7 @@ void XclImpChGroupBase::ReadRecordGroup( XclImpStream& rStrm ) void XclImpChGroupBase::SkipBlock( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecId() == EXC_ID_CHBEGIN, "XclImpChGroupBase::SkipBlock - no CHBEGIN record" ); + OSL_ENSURE( rStrm.GetRecId() == EXC_ID_CHBEGIN, "XclImpChGroupBase::SkipBlock - no CHBEGIN record" ); // do nothing if current record is not CHBEGIN bool bLoop = rStrm.GetRecId() == EXC_ID_CHBEGIN; while( bLoop && rStrm.StartNextRecord() ) @@ -593,7 +593,7 @@ XclImpChFrameBase::XclImpChFrameBase( const XclChFormatInfo& rFmtInfo ) } break; default: - DBG_ERRORFILE( "XclImpChFrameBase::XclImpChFrameBase - unknown frame type" ); + OSL_FAIL( "XclImpChFrameBase::XclImpChFrameBase - unknown frame type" ); } } @@ -859,7 +859,7 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin } catch( Exception& ) { -// DBG_ERRORFILE( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); +// OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); } } return xDataSeq; @@ -1840,7 +1840,7 @@ void XclImpChSeries::SetDataLabel( XclImpChTextRef xLabel ) void XclImpChSeries::AddChildSeries( const XclImpChSeries& rSeries ) { - DBG_ASSERT( !HasParentSeries(), "XclImpChSeries::AddChildSeries - not allowed for child series" ); + OSL_ENSURE( !HasParentSeries(), "XclImpChSeries::AddChildSeries - not allowed for child series" ); /* In Excel, trend lines and error bars are stored as own series. In Calc, these are properties of the parent series. This function adds the @@ -1922,7 +1922,7 @@ ScfPropertySet lclGetPointPropSet( Reference< XDataSeries > xDataSeries, sal_uIn } catch( Exception& ) { - DBG_ERRORFILE( "lclGetPointPropSet - no data point property set" ); + OSL_FAIL( "lclGetPointPropSet - no data point property set" ); } return aPropSet; } @@ -2137,7 +2137,7 @@ void XclImpChSeries::ConvertTrendLines( Reference< XDataSeries > xDataSeries ) c } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChSeries::ConvertTrendLines - cannot add regression curve" ); + OSL_FAIL( "XclImpChSeries::ConvertTrendLines - cannot add regression curve" ); } } } @@ -2386,7 +2386,7 @@ void XclImpChChart3d::Convert( ScfPropertySet& rPropSet, bool b3dWallChart ) con namespace cssd = ::com::sun::star::drawing; // #i104057# do not assert this, written by broken external generators -// DBG_ASSERT( ::get_flag( maData.mnFlags, EXC_CHCHART3D_HASWALLS ) == b3dWallChart, "XclImpChChart3d::Convert - wrong wall flag" ); +// OSL_ENSURE( ::get_flag( maData.mnFlags, EXC_CHCHART3D_HASWALLS ) == b3dWallChart, "XclImpChChart3d::Convert - wrong wall flag" ); sal_Int32 nRotationY = 0; sal_Int32 nRotationX = 0; @@ -2696,7 +2696,7 @@ void XclImpChTypeGroup::SetUsedFormatIndex( sal_uInt16 nFormatIdx ) sal_uInt16 XclImpChTypeGroup::PopUnusedFormatIndex() { - DBG_ASSERT( !maUnusedFormats.empty(), "XclImpChTypeGroup::PopUnusedFormatIndex - no more format indexes available" ); + OSL_ENSURE( !maUnusedFormats.empty(), "XclImpChTypeGroup::PopUnusedFormatIndex - no more format indexes available" ); sal_uInt16 nFormatIdx = maUnusedFormats.empty() ? 0 : *maUnusedFormats.begin(); SetUsedFormatIndex( nFormatIdx ); return nFormatIdx; @@ -2740,7 +2740,7 @@ Reference< XCoordinateSystem > XclImpChTypeGroup::CreateCoordSystem() const Reference< XChartType > XclImpChTypeGroup::CreateChartType( Reference< XDiagram > xDiagram, sal_Int32 nApiAxesSetIdx ) const { - DBG_ASSERT( IsValidGroup(), "XclImpChTypeGroup::CreateChartType - type group without series" ); + OSL_ENSURE( IsValidGroup(), "XclImpChTypeGroup::CreateChartType - type group without series" ); // create the chart type object Reference< XChartType > xChartType = maType.CreateChartType( xDiagram, Is3dChart() ); @@ -2836,7 +2836,7 @@ void XclImpChTypeGroup::InsertDataSeries( Reference< XChartType > xChartType, } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChTypeGroup::InsertDataSeries - cannot add data series" ); + OSL_FAIL( "XclImpChTypeGroup::InsertDataSeries - cannot add data series" ); } } } @@ -2867,7 +2867,7 @@ void XclImpChTypeGroup::CreateStockSeries( Reference< XChartType > xChartType, s { // create a list of data sequences from all series ::std::vector< Reference< XLabeledDataSequence > > aLabeledSeqVec; - DBG_ASSERT( maSeries.size() >= 3, "XclImpChTypeGroup::CreateChartType - missing stock series" ); + OSL_ENSURE( maSeries.size() >= 3, "XclImpChTypeGroup::CreateChartType - missing stock series" ); int nRoleIdx = (maSeries.size() == 3) ? 1 : 0; for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); (nRoleIdx < 4) && (aIt != aEnd); ++nRoleIdx, ++aIt ) @@ -3339,7 +3339,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_PIE ); break; default: - DBG_ERRORFILE( "XclImpChAxis::CreateAxis - unknown axis type" ); + OSL_FAIL( "XclImpChAxis::CreateAxis - unknown axis type" ); } /* Do not set a value to the Origin member anymore (will be done via @@ -3571,7 +3571,7 @@ void XclImpChAxesSet::Convert( Reference< XDiagram > xDiagram ) const } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChAxesSet::Convert - cannot insert coordinate system" ); + OSL_FAIL( "XclImpChAxesSet::Convert - cannot insert coordinate system" ); } // create the axes with grids and axis titles and insert them into the diagram @@ -3652,7 +3652,7 @@ Reference< XCoordinateSystem > XclImpChAxesSet::CreateCoordSystem( Reference< XD if( xCoordSystemCont.is() ) { Sequence< Reference< XCoordinateSystem > > aCoordSystems = xCoordSystemCont->getCoordinateSystems(); - DBG_ASSERT( aCoordSystems.getLength() <= 1, "XclImpChAxesSet::CreateCoordSystem - too many existing coordinate systems" ); + OSL_ENSURE( aCoordSystems.getLength() <= 1, "XclImpChAxesSet::CreateCoordSystem - too many existing coordinate systems" ); if( aCoordSystems.getLength() > 0 ) xCoordSystem = aCoordSystems[ 0 ]; } @@ -3686,7 +3686,7 @@ Reference< XCoordinateSystem > XclImpChAxesSet::CreateCoordSystem( Reference< XD } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChAxesSet::CreateCoordSystem - cannot add chart type" ); + OSL_FAIL( "XclImpChAxesSet::CreateCoordSystem - cannot add chart type" ); } } } @@ -3713,7 +3713,7 @@ void XclImpChAxesSet::ConvertAxis( } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChAxesSet::ConvertAxis - cannot set axis title" ); + OSL_FAIL( "XclImpChAxesSet::ConvertAxis - cannot set axis title" ); } // insert axis into coordinate system @@ -3725,7 +3725,7 @@ void XclImpChAxesSet::ConvertAxis( } catch( Exception& ) { - DBG_ERRORFILE( "XclImpChAxesSet::ConvertAxis - cannot set axis" ); + OSL_FAIL( "XclImpChAxesSet::ConvertAxis - cannot set axis" ); } } } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 07bfb4e239fa..243d6ad87443 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -238,7 +238,7 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) const XclImpRoot& rRoot = rStrm.GetRoot(); SfxObjectShell* pDocShell = rRoot.GetDocShell(); - DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); sal_uInt32 nFlags; XclGuid aGuid; @@ -246,7 +246,7 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) rStrm.Ignore( 4 ); rStrm >> nFlags; - DBG_ASSERT( aGuid == XclTools::maGuidStdLink, "XclImpHyperlink::ReadEmbeddedData - unknown header GUID" ); + OSL_ENSURE( aGuid == XclTools::maGuidStdLink, "XclImpHyperlink::ReadEmbeddedData - unknown header GUID" ); ::std::auto_ptr< String > xLongName; // link / file name ::std::auto_ptr< String > xShortName; // 8.3-representation of file name @@ -309,7 +309,7 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) } else { - DBG_ERRORFILE( "XclImpHyperlink::ReadEmbeddedData - unknown content GUID" ); + OSL_FAIL( "XclImpHyperlink::ReadEmbeddedData - unknown content GUID" ); } } @@ -322,7 +322,7 @@ String XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) rStrm.SetNulSubstChar(); // back to default - DBG_ASSERT( rStrm.GetRecLeft() == 0, "XclImpHyperlink::ReadEmbeddedData - record size mismatch" ); + OSL_ENSURE( rStrm.GetRecLeft() == 0, "XclImpHyperlink::ReadEmbeddedData - record size mismatch" ); if( !xLongName.get() && xShortName.get() ) xLongName = xShortName; @@ -423,7 +423,7 @@ void XclImpHyperlink::InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRa void XclImpLabelranges::ReadLabelranges( XclImpStream& rStrm ) { const XclImpRoot& rRoot = rStrm.GetRoot(); - DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); ScDocument& rDoc = rRoot.GetDoc(); SCTAB nScTab = rRoot.GetCurrScTab(); @@ -494,7 +494,7 @@ XclImpCondFormat::~XclImpCondFormat() void XclImpCondFormat::ReadCondfmt( XclImpStream& rStrm ) { - DBG_ASSERT( !mnCondCount, "XclImpCondFormat::ReadCondfmt - already initialized" ); + OSL_ENSURE( !mnCondCount, "XclImpCondFormat::ReadCondfmt - already initialized" ); XclRangeList aXclRanges; rStrm >> mnCondCount; rStrm.Ignore( 10 ); @@ -506,7 +506,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) { if( mnCondIndex >= mnCondCount ) { - DBG_ERRORFILE( "XclImpCondFormat::ReadCF - CF without leading CONDFMT" ); + OSL_FAIL( "XclImpCondFormat::ReadCF - CF without leading CONDFMT" ); return; } @@ -673,7 +673,7 @@ void XclImpCondFormatManager::ReadCondfmt( XclImpStream& rStrm ) void XclImpCondFormatManager::ReadCF( XclImpStream& rStrm ) { - DBG_ASSERT( !maCondFmtList.empty(), "XclImpCondFormatManager::ReadCF - CF without leading CONDFMT" ); + OSL_ENSURE( !maCondFmtList.empty(), "XclImpCondFormatManager::ReadCF - CF without leading CONDFMT" ); if( !maCondFmtList.empty() ) maCondFmtList.back().ReadCF( rStrm ); } @@ -698,14 +698,14 @@ XclImpValidationManager::XclImpValidationManager( const XclImpRoot& rRoot ) : void XclImpValidationManager::ReadDval( XclImpStream& rStrm ) { const XclImpRoot& rRoot = rStrm.GetRoot(); - DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); sal_uInt32 nObjId; rStrm.Ignore( 10 ); rStrm >> nObjId; if( nObjId != EXC_DVAL_NOOBJ ) { - DBG_ASSERT( nObjId <= 0xFFFF, "XclImpValidation::ReadDval - invalid object ID" ); + OSL_ENSURE( nObjId <= 0xFFFF, "XclImpValidation::ReadDval - invalid object ID" ); rRoot.GetCurrSheetDrawing().SetSkipObj( static_cast< sal_uInt16 >( nObjId ) ); } } @@ -713,7 +713,7 @@ void XclImpValidationManager::ReadDval( XclImpStream& rStrm ) void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) { const XclImpRoot& rRoot = rStrm.GetRoot(); - DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rRoot.GetBiff() == EXC_BIFF8 ); ScDocument& rDoc = rRoot.GetDoc(); SCTAB nScTab = rRoot.GetCurrScTab(); @@ -1035,7 +1035,7 @@ namespace { XclImpDecrypterRef lclReadFilepass5( XclImpStream& rStrm ) { XclImpDecrypterRef xDecr; - DBG_ASSERT( rStrm.GetRecLeft() == 4, "lclReadFilepass5 - wrong record size" ); + OSL_ENSURE( rStrm.GetRecLeft() == 4, "lclReadFilepass5 - wrong record size" ); if( rStrm.GetRecLeft() == 4 ) { sal_uInt16 nKey, nHash; @@ -1048,7 +1048,7 @@ XclImpDecrypterRef lclReadFilepass5( XclImpStream& rStrm ) XclImpDecrypterRef lclReadFilepass8_Standard( XclImpStream& rStrm ) { XclImpDecrypterRef xDecr; - DBG_ASSERT( rStrm.GetRecLeft() == 48, "lclReadFilepass8 - wrong record size" ); + OSL_ENSURE( rStrm.GetRecLeft() == 48, "lclReadFilepass8 - wrong record size" ); if( rStrm.GetRecLeft() == 48 ) { sal_uInt8 pnSalt[ 16 ]; @@ -1094,13 +1094,13 @@ XclImpDecrypterRef lclReadFilepass8( XclImpStream& rStrm ) xDecr = lclReadFilepass8_Strong( rStrm ); break; default: - DBG_ERRORFILE( "lclReadFilepass8 - unknown BIFF8 encryption sub mode" ); + OSL_FAIL( "lclReadFilepass8 - unknown BIFF8 encryption sub mode" ); } } break; default: - DBG_ERRORFILE( "lclReadFilepass8 - unknown encryption mode" ); + OSL_FAIL( "lclReadFilepass8 - unknown encryption mode" ); } return xDecr; diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 8d360b6f9259..dd2bd616a900 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -330,7 +330,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr { sal_uInt16 nSubRecId, nSubRecSize, nObjType; rStrm >> nSubRecId >> nSubRecSize >> nObjType; - DBG_ASSERT( nSubRecId == EXC_ID_OBJCMO, "XclImpDrawObjBase::ReadObj8 - OBJCMO subrecord expected" ); + OSL_ENSURE( nSubRecId == EXC_ID_OBJCMO, "XclImpDrawObjBase::ReadObj8 - OBJCMO subrecord expected" ); if( (nSubRecId == EXC_ID_OBJCMO) && (nSubRecSize >= 6) ) { switch( nObjType ) @@ -541,13 +541,13 @@ void XclImpDrawObjBase::ReadMacro8( XclImpStream& rStrm ) sal_uInt16 nFmlaSize; rStrm >> nFmlaSize; rStrm.Ignore( 4 ); - DBG_ASSERT( nFmlaSize == 7, "XclImpDrawObjBase::ReadMacro - unexpected formula size" ); + OSL_ENSURE( nFmlaSize == 7, "XclImpDrawObjBase::ReadMacro - unexpected formula size" ); if( nFmlaSize == 7 ) { sal_uInt8 nTokenId; sal_uInt16 nExtSheet, nExtName; rStrm >> nTokenId >> nExtSheet >> nExtName; - DBG_ASSERT( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ), + OSL_ENSURE( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ), "XclImpDrawObjBase::ReadMacro - tNameXR token expected" ); if( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ) ) maMacroName = GetLinkManager().GetMacroName( nExtSheet, nExtName ); @@ -831,7 +831,7 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) switch( nSubRecId ) { case EXC_ID_OBJCMO: - DBG_ASSERT( rStrm.GetRecPos() == 4, "XclImpDrawObjBase::ImplReadObj8 - unexpected OBJCMO subrecord" ); + OSL_ENSURE( rStrm.GetRecPos() == 4, "XclImpDrawObjBase::ImplReadObj8 - unexpected OBJCMO subrecord" ); if( (rStrm.GetRecPos() == 4) && (nSubRecSize >= 6) ) { sal_uInt16 nObjFlags; @@ -873,10 +873,10 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) // skip following CONTINUE records until IMGDATA ends while( (nDataSize > 0) && (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord() ) { - DBG_ASSERT( nDataSize >= rStrm.GetRecLeft(), "XclImpDrawObjBase::ImplReadObj8 - CONTINUE too long" ); + OSL_ENSURE( nDataSize >= rStrm.GetRecLeft(), "XclImpDrawObjBase::ImplReadObj8 - CONTINUE too long" ); nDataSize -= ::std::min< sal_uInt32 >( rStrm.GetRecLeft(), nDataSize ); } - DBG_ASSERT( nDataSize == 0, "XclImpDrawObjBase::ImplReadObj8 - missing CONTINUE records" ); + OSL_ENSURE( nDataSize == 0, "XclImpDrawObjBase::ImplReadObj8 - missing CONTINUE records" ); // next record may be MSODRAWING or CONTINUE or anything else } } @@ -1244,7 +1244,7 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm ) { if( (rStrm.GetNextRecId() == EXC_ID_COORDLIST) && rStrm.StartNextRecord() ) { - DBG_ASSERT( rStrm.GetRecLeft() / 4 == mnPointCount, "XclImpPolygonObj::ReadCoordList - wrong polygon point count" ); + OSL_ENSURE( rStrm.GetRecLeft() / 4 == mnPointCount, "XclImpPolygonObj::ReadCoordList - wrong polygon point count" ); while( rStrm.GetRecLeft() >= 4 ) { sal_uInt16 nX, nY; @@ -1550,7 +1550,7 @@ void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm ) sal_uInt16 nBofType; rStrm.Seek( 2 ); rStrm >> nBofType; - DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" ); + OSL_ENSURE( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" ); // read chart, even if BOF record contains wrong substream identifier mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) ); @@ -1560,7 +1560,7 @@ void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm ) } else { - DBG_ERRORFILE( "XclImpChartObj::ReadChartSubStream - missing chart substream" ); + OSL_FAIL( "XclImpChartObj::ReadChartSubStream - missing chart substream" ); } } @@ -1668,7 +1668,7 @@ void XclImpChartObj::FinalizeTabChart() { /* #i44077# Calculate and store DFF anchor for sheet charts. Needed to get used area if this chart is inserted as OLE object. */ - DBG_ASSERT( mbOwnTab, "XclImpChartObj::FinalizeTabChart - not allowed for embedded chart objects" ); + OSL_ENSURE( mbOwnTab, "XclImpChartObj::FinalizeTabChart - not allowed for embedded chart objects" ); // set uninitialized page to landscape if( !GetPageSettings().GetPageData().mbValid ) @@ -2576,7 +2576,7 @@ void XclImpListBoxObj::ReadFullLbsData( XclImpStream& rStrm, sal_Size nRecLeft ) { sal_Size nRecEnd = rStrm.GetRecPos() + nRecLeft; ReadLbsData( rStrm ); - DBG_ASSERT( (rStrm.GetRecPos() == nRecEnd) || (rStrm.GetRecPos() + mnEntryCount == nRecEnd), + OSL_ENSURE( (rStrm.GetRecPos() == nRecEnd) || (rStrm.GetRecPos() + mnEntryCount == nRecEnd), "XclImpListBoxObj::ReadFullLbsData - invalid size of OBJLBSDATA record" ); while( rStrm.IsValid() && (rStrm.GetRecPos() < nRecEnd) ) maSelection.push_back( rStrm.ReaduInt8() ); @@ -2929,7 +2929,7 @@ void XclImpPictureObj::ReadFlags8( XclImpStream& rStrm ) mbSymbol = ::get_flag( nFlags, EXC_OBJ_PIC_SYMBOL ); mbControl = ::get_flag( nFlags, EXC_OBJ_PIC_CONTROL ); mbUseCtlsStrm = ::get_flag( nFlags, EXC_OBJ_PIC_CTLSSTREAM ); - DBG_ASSERT( mbControl || !mbUseCtlsStrm, "XclImpPictureObj::ReadFlags8 - CTLS stream for controls only" ); + OSL_ENSURE( mbControl || !mbUseCtlsStrm, "XclImpPictureObj::ReadFlags8 - CTLS stream for controls only" ); SetProcessSdrObj( mbControl || !mbUseCtlsStrm ); } @@ -2940,7 +2940,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) { sal_uInt16 nFmlaSize; rStrm >> nFmlaSize; - DBG_ASSERT( nFmlaSize > 0, "XclImpPictureObj::ReadPictFmla - missing link formula" ); + OSL_ENSURE( nFmlaSize > 0, "XclImpPictureObj::ReadPictFmla - missing link formula" ); // BIFF3/BIFF4 do not support storages, nothing to do here if( (nFmlaSize > 0) && (GetBiff() >= EXC_BIFF5) ) { @@ -2983,7 +2983,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) else if( nToken == XclTokenArrayHelper::GetTokenId( EXC_TOKID_TBL, EXC_TOKCLASS_NONE ) ) { mbEmbedded = true; - DBG_ASSERT( nFmlaSize == 5, "XclImpPictureObj::ReadPictFmla - unexpected formula size" ); + OSL_ENSURE( nFmlaSize == 5, "XclImpPictureObj::ReadPictFmla - unexpected formula size" ); rStrm.Ignore( nFmlaSize - 1 ); // token ID already read if( nFmlaSize & 1 ) rStrm.Ignore( 1 ); // padding byte @@ -3025,7 +3025,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) // additional string (16-bit characters), e.g. for progress bar control sal_uInt32 nAddStrSize; rStrm >> nAddStrSize; - DBG_ASSERT( rStrm.GetRecLeft() >= nAddStrSize + 4, "XclImpPictureObj::ReadPictFmla - missing data" ); + OSL_ENSURE( rStrm.GetRecLeft() >= nAddStrSize + 4, "XclImpPictureObj::ReadPictFmla - missing data" ); if( rStrm.GetRecLeft() >= nAddStrSize + 4 ) { rStrm.Ignore( nAddStrSize ); @@ -3209,7 +3209,7 @@ void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize ) void XclImpDffConverter::Progress( sal_Size nDelta ) { - DBG_ASSERT( mxProgress, "XclImpDffConverter::Progress - invalid call, no progress bar" ); + OSL_ENSURE( mxProgress, "XclImpDffConverter::Progress - invalid call, no progress bar" ); mxProgress->Progress( nDelta ); } @@ -3255,7 +3255,7 @@ void XclImpDffConverter::ProcessDrawing( SvStream& rDffStrm ) rDffStrm.Seek( STREAM_SEEK_TO_BEGIN ); DffRecordHeader aHeader; rDffStrm >> aHeader; - DBG_ASSERT( aHeader.nRecType == DFF_msofbtDgContainer, "XclImpDffConverter::ProcessDrawing - unexpected record" ); + OSL_ENSURE( aHeader.nRecType == DFF_msofbtDgContainer, "XclImpDffConverter::ProcessDrawing - unexpected record" ); if( aHeader.nRecType == DFF_msofbtDgContainer ) ProcessDgContainer( rDffStrm, aHeader ); } @@ -3263,7 +3263,7 @@ void XclImpDffConverter::ProcessDrawing( SvStream& rDffStrm ) void XclImpDffConverter::FinalizeDrawing() { - DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::FinalizeDrawing - no drawing manager on stack" ); + OSL_ENSURE( !maDataStack.empty(), "XclImpDffConverter::FinalizeDrawing - no drawing manager on stack" ); maDataStack.pop_back(); // restore previous model at core DFF converter if( !maDataStack.empty() ) @@ -3374,7 +3374,7 @@ void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm, XclImpDffConvData& rConvData = GetConvData(); if( XclImpDrawObjBase* pDrawObj = rConvData.mrDrawing.FindDrawObj( rObjData.rSpHd ).get() ) { - DBG_ASSERT( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffConverter::ProcessClientAnchor2 - no client anchor record" ); + OSL_ENSURE( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffConverter::ProcessClientAnchor2 - no client anchor record" ); XclObjAnchor aAnchor; rHeader.SeekToContent( rDffStrm ); rDffStrm.SeekRel( 2 ); // flags @@ -3517,7 +3517,7 @@ sal_Bool XclImpDffConverter::InsertControl( const Reference< XFormComponent >& r } catch( Exception& ) { - DBG_ERRORFILE( "XclImpDffConverter::InsertControl - cannot create form control" ); + OSL_FAIL( "XclImpDffConverter::InsertControl - cannot create form control" ); } return false; @@ -3527,13 +3527,13 @@ sal_Bool XclImpDffConverter::InsertControl( const Reference< XFormComponent >& r XclImpDffConverter::XclImpDffConvData& XclImpDffConverter::GetConvData() { - DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" ); + OSL_ENSURE( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" ); return *maDataStack.back(); } const XclImpDffConverter::XclImpDffConvData& XclImpDffConverter::GetConvData() const { - DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" ); + OSL_ENSURE( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" ); return *maDataStack.back(); } @@ -3716,7 +3716,7 @@ Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm { case EXC_IMGDATA_WMF: ReadWmf( aGraphic, rRoot, rStrm ); break; case EXC_IMGDATA_BMP: ReadBmp( aGraphic, rRoot, rStrm ); break; - default: DBG_ERRORFILE( "XclImpDrawing::ReadImgData - unknown image format" ); + default: OSL_FAIL( "XclImpDrawing::ReadImgData - unknown image format" ); } } return aGraphic; @@ -3729,7 +3729,7 @@ void XclImpDrawing::ReadObj( XclImpStream& rStrm ) /* #i61786# In BIFF8 streams, OBJ records may occur without MSODRAWING records. In this case, the OBJ records are in BIFF5 format. Do a sanity check here that there is no DFF data loaded before. */ - DBG_ASSERT( maDffStrm.Tell() == 0, "XclImpDrawing::ReadObj - unexpected DFF stream data, OBJ will be ignored" ); + OSL_ENSURE( maDffStrm.Tell() == 0, "XclImpDrawing::ReadObj - unexpected DFF stream data, OBJ will be ignored" ); if( maDffStrm.Tell() == 0 ) switch( GetBiff() ) { case EXC_BIFF3: @@ -3757,7 +3757,7 @@ void XclImpDrawing::ReadObj( XclImpStream& rStrm ) void XclImpDrawing::ReadMsoDrawing( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF8 ); // disable internal CONTINUE handling rStrm.ResetRecord( false ); // read leading MSODRAWING record @@ -3865,7 +3865,7 @@ void XclImpDrawing::ImplConvertObjects( XclImpDffConverter& rDffConv, SdrModel& void XclImpDrawing::AppendRawObject( const XclImpDrawObjRef& rxDrawObj ) { - DBG_ASSERT( rxDrawObj, "XclImpDrawing::AppendRawObject - unexpected empty reference" ); + OSL_ENSURE( rxDrawObj, "XclImpDrawing::AppendRawObject - unexpected empty reference" ); maRawObjs.push_back( rxDrawObj ); } @@ -3949,7 +3949,7 @@ void XclImpDrawing::ReadTxo( XclImpStream& rStrm ) if( xTextData->maData.mnTextLen > 0 ) { bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord(); - DBG_ASSERT( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" ); + OSL_ENSURE( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" ); if( bValid ) xTextData->mxString.reset( new XclImpString( rStrm.ReadUniString( xTextData->maData.mnTextLen ) ) ); } @@ -3958,7 +3958,7 @@ void XclImpDrawing::ReadTxo( XclImpStream& rStrm ) if( xTextData->maData.mnFormatSize > 0 ) { bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord(); - DBG_ASSERT( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" ); + OSL_ENSURE( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" ); if( bValid ) xTextData->ReadFormats( rStrm ); } @@ -3994,7 +3994,7 @@ void XclImpSheetDrawing::ReadNote( XclImpStream& rStrm ) void XclImpSheetDrawing::ReadTabChart( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF5 ); + OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF5 ); boost::shared_ptr< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) ); xChartObj->ReadChartSubStream( rStrm ); // insert the chart as raw object without connected DFF data @@ -4037,10 +4037,10 @@ void XclImpSheetDrawing::ReadNote3( XclImpStream& rStrm ) while( (nTotalLen > 0) && (rStrm.GetNextRecId() == EXC_ID_NOTE) && rStrm.StartNextRecord() ) { rStrm >> aXclPos >> nPartLen; - DBG_ASSERT( aXclPos.mnRow == 0xFFFF, "XclImpObjectManager::ReadNote3 - missing continuation NOTE record" ); + OSL_ENSURE( aXclPos.mnRow == 0xFFFF, "XclImpObjectManager::ReadNote3 - missing continuation NOTE record" ); if( aXclPos.mnRow == 0xFFFF ) { - DBG_ASSERT( nPartLen <= nTotalLen, "XclImpObjectManager::ReadNote3 - string too long" ); + OSL_ENSURE( nPartLen <= nTotalLen, "XclImpObjectManager::ReadNote3 - string too long" ); aNoteText.Append( rStrm.ReadRawByteString( nPartLen ) ); nTotalLen = nTotalLen - ::std::min( nTotalLen, nPartLen ); } @@ -4104,7 +4104,7 @@ XclImpObjectManager::~XclImpObjectManager() void XclImpObjectManager::ReadMsoDrawingGroup( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF8 ); // Excel continues this record with MSODRAWINGGROUP and CONTINUE records, hmm. rStrm.ResetRecord( true, EXC_ID_MSODRAWINGGROUP ); maDggStrm.Seek( STREAM_SEEK_TO_END ); diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 7fd1dd17e65a..621f17f49b42 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -756,7 +756,7 @@ void XclImpUrlHelper::DecodeUrl( { String aTabName; DecodeUrl( rUrl, aTabName, rbSameWb, rRoot, rEncodedUrl ); - DBG_ASSERT( !aTabName.Len(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" ); + OSL_ENSURE( !aTabName.Len(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" ); } bool XclImpUrlHelper::DecodeLink( String& rApplic, String& rTopic, const String rEncUrl ) @@ -803,7 +803,7 @@ XclImpCachedValue::XclImpCachedValue( XclImpStream& rStrm ) : } break; default: - DBG_ERRORFILE( "XclImpCachedValue::XclImpCachedValue - unknown data type" ); + OSL_FAIL( "XclImpCachedValue::XclImpCachedValue - unknown data type" ); } } @@ -850,7 +850,7 @@ XclImpCachedMatrix::~XclImpCachedMatrix() ScMatrixRef XclImpCachedMatrix::CreateScMatrix() const { ScMatrixRef xScMatrix; - DBG_ASSERT( mnScCols * mnScRows == maValueList.size(), "XclImpCachedMatrix::CreateScMatrix - element count mismatch" ); + OSL_ENSURE( mnScCols * mnScRows == maValueList.size(), "XclImpCachedMatrix::CreateScMatrix - element count mismatch" ); if( mnScCols && mnScRows && static_cast< sal_uLong >( mnScCols * mnScRows ) <= maValueList.size() ) { xScMatrix = new ScMatrix( mnScCols, mnScRows ); @@ -878,7 +878,7 @@ ScMatrixRef XclImpCachedMatrix::CreateScMatrix() const xScMatrix->PutError( itValue->GetScError(), nScCol, nScRow ); break; default: - DBG_ERRORFILE( "XclImpCachedMatrix::CreateScMatrix - unknown value type" ); + OSL_FAIL( "XclImpCachedMatrix::CreateScMatrix - unknown value type" ); xScMatrix->PutEmpty( nScCol, nScRow ); } ++itValue; diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index 492fe5d2033c..ca588548e4b8 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -257,12 +257,12 @@ SCTAB XclImpTabInfo::GetScTabFromXclName( const String& rXclTabName ) const void XclImpTabInfo::ReadTabid( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ); if( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ) { rStrm.EnableDecryption(); sal_Size nReadCount = rStrm.GetRecLeft() / 2; - DBG_ASSERT( nReadCount <= 0xFFFF, "XclImpTabInfo::ReadTabid - record too long" ); + OSL_ENSURE( nReadCount <= 0xFFFF, "XclImpTabInfo::ReadTabid - record too long" ); maTabIdVec.clear(); maTabIdVec.reserve( nReadCount ); for( sal_Size nIndex = 0; rStrm.IsValid() && (nIndex < nReadCount); ++nIndex ) @@ -642,7 +642,7 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) : { case EXC_SUPB_SELF: meType = EXC_SBTYPE_SELF; break; case EXC_SUPB_ADDIN: meType = EXC_SBTYPE_ADDIN; break; - default: DBG_ERRORFILE( "XclImpSupbook::XclImpSupbook - unknown special SUPBOOK type" ); + default: OSL_FAIL( "XclImpSupbook::XclImpSupbook - unknown special SUPBOOK type" ); } return; } @@ -699,7 +699,7 @@ void XclImpSupbook::ReadExternname( XclImpStream& rStrm, ExcelToSc* pFormulaConv const XclImpExtName* XclImpSupbook::GetExternName( sal_uInt16 nXclIndex ) const { - DBG_ASSERT( nXclIndex > 0, "XclImpSupbook::GetExternName - index must be >0" ); + OSL_ENSURE( nXclIndex > 0, "XclImpSupbook::GetExternName - index must be >0" ); if (meType == EXC_SBTYPE_SELF || nXclIndex > maExtNameList.size()) return NULL; return &maExtNameList[nXclIndex-1]; @@ -712,7 +712,7 @@ bool XclImpSupbook::GetLinkData( String& rApplic, String& rTopic ) const const String& XclImpSupbook::GetMacroName( sal_uInt16 nXclNameIdx ) const { - DBG_ASSERT( nXclNameIdx > 0, "XclImpSupbook::GetMacroName - index must be >0" ); + OSL_ENSURE( nXclNameIdx > 0, "XclImpSupbook::GetMacroName - index must be >0" ); const XclImpName* pName = (meType == EXC_SBTYPE_SELF) ? GetNameManager().GetName( nXclNameIdx ) : 0; return (pName && pName->IsVBName()) ? pName->GetScName() : EMPTY_STRING; } @@ -760,7 +760,7 @@ void XclImpLinkManagerImpl::ReadExternsheet( XclImpStream& rStrm ) { sal_uInt16 nXtiCount; rStrm >> nXtiCount; - DBG_ASSERT( static_cast< sal_Size >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); + OSL_ENSURE( static_cast< sal_Size >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); nXtiCount = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nXtiCount, rStrm.GetRecLeft() / 6 ) ); /* #i104057# A weird external XLS generator writes multiple EXTERNSHEET diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 15bf618d8530..f2ade90977fb 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -270,7 +270,7 @@ const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nSc const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const { - DBG_ASSERT( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" ); + OSL_ENSURE( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" ); return &(maNameList.at( nXclNameIdx - 1 )); } diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index f40743c52146..687daa9b3efe 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -62,7 +62,7 @@ void XclImpPageSettings::Initialize() void XclImpPageSettings::ReadSetup( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF4 ); + OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF4 ); if( GetBiff() < EXC_BIFF4 ) return; @@ -97,19 +97,19 @@ void XclImpPageSettings::ReadMargin( XclImpStream& rStrm ) case EXC_ID_RIGHTMARGIN: rStrm >> maData.mfRightMargin; break; case EXC_ID_TOPMARGIN: rStrm >> maData.mfTopMargin; break; case EXC_ID_BOTTOMMARGIN: rStrm >> maData.mfBottomMargin; break; - default: DBG_ERRORFILE( "XclImpPageSettings::ReadMargin - unknown record" ); + default: OSL_FAIL( "XclImpPageSettings::ReadMargin - unknown record" ); } } void XclImpPageSettings::ReadCenter( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF3 ); // read it anyway + OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF3 ); // read it anyway bool bCenter = (rStrm.ReaduInt16() != 0); switch( rStrm.GetRecId() ) { case EXC_ID_HCENTER: maData.mbHorCenter = bCenter; break; case EXC_ID_VCENTER: maData.mbVerCenter = bCenter; break; - default: DBG_ERRORFILE( "XclImpPageSettings::ReadCenter - unknown record" ); + default: OSL_FAIL( "XclImpPageSettings::ReadCenter - unknown record" ); } } @@ -123,7 +123,7 @@ void XclImpPageSettings::ReadHeaderFooter( XclImpStream& rStrm ) { case EXC_ID_HEADER: maData.maHeader = aString; break; case EXC_ID_FOOTER: maData.maFooter = aString; break; - default: DBG_ERRORFILE( "XclImpPageSettings::ReadHeaderFooter - unknown record" ); + default: OSL_FAIL( "XclImpPageSettings::ReadHeaderFooter - unknown record" ); } } @@ -134,7 +134,7 @@ void XclImpPageSettings::ReadPageBreaks( XclImpStream& rStrm ) { case EXC_ID_HORPAGEBREAKS: pVec = &maData.maHorPageBreaks; break; case EXC_ID_VERPAGEBREAKS: pVec = &maData.maVerPageBreaks; break; - default: DBG_ERRORFILE( "XclImpPageSettings::ReadPageBreaks - unknown record" ); + default: OSL_FAIL( "XclImpPageSettings::ReadPageBreaks - unknown record" ); } if( pVec ) @@ -213,7 +213,7 @@ void lclPutMarginItem( SfxItemSet& rItemSet, sal_uInt16 nRecId, double fMarginIn } break; default: - DBG_ERRORFILE( "XclImpPageSettings::SetMarginItem - unknown record id" ); + OSL_FAIL( "XclImpPageSettings::SetMarginItem - unknown record id" ); } } diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index a26b132f198d..1629a066fb34 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -87,7 +87,7 @@ XclImpPCItem::XclImpPCItem( XclImpStream& rStrm ) case EXC_ID_SXSTRING: ReadSxstring( rStrm ); break; case EXC_ID_SXDATETIME: ReadSxdatetime( rStrm ); break; case EXC_ID_SXEMPTY: ReadSxempty( rStrm ); break; - default: DBG_ERRORFILE( "XclImpPCItem::XclImpPCItem - unknown record id" ); + default: OSL_FAIL( "XclImpPCItem::XclImpPCItem - unknown record id" ); } } @@ -138,37 +138,37 @@ void XclImpPCItem::WriteToSource( const XclImpRoot& rRoot, const ScAddress& rScP void XclImpPCItem::ReadSxdouble( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() == 8, "XclImpPCItem::ReadSxdouble - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 8, "XclImpPCItem::ReadSxdouble - wrong record size" ); SetDouble( rStrm.ReadDouble() ); } void XclImpPCItem::ReadSxboolean( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxboolean - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxboolean - wrong record size" ); SetBool( rStrm.ReaduInt16() != 0 ); } void XclImpPCItem::ReadSxerror( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxerror - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxerror - wrong record size" ); SetError( rStrm.ReaduInt16() ); } void XclImpPCItem::ReadSxinteger( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxinteger - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 2, "XclImpPCItem::ReadSxinteger - wrong record size" ); SetInteger( rStrm.ReadInt16() ); } void XclImpPCItem::ReadSxstring( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() >= 3, "XclImpPCItem::ReadSxstring - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() >= 3, "XclImpPCItem::ReadSxstring - wrong record size" ); SetText( rStrm.ReadUniString() ); } void XclImpPCItem::ReadSxdatetime( XclImpStream& rStrm ) { - DBG_ASSERT( rStrm.GetRecSize() == 8, "XclImpPCItem::ReadSxdatetime - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 8, "XclImpPCItem::ReadSxdatetime - wrong record size" ); sal_uInt16 nYear, nMonth; sal_uInt8 nDay, nHour, nMin, nSec; rStrm >> nYear >> nMonth >> nDay >> nHour >> nMin >> nSec; @@ -178,7 +178,7 @@ void XclImpPCItem::ReadSxdatetime( XclImpStream& rStrm ) void XclImpPCItem::ReadSxempty( XclImpStream& rStrm ) { (void)rStrm; // avoid compiler warning - DBG_ASSERT( rStrm.GetRecSize() == 0, "XclImpPCItem::ReadSxempty - wrong record size" ); + OSL_ENSURE( rStrm.GetRecSize() == 0, "XclImpPCItem::ReadSxempty - wrong record size" ); SetEmpty(); } @@ -212,7 +212,7 @@ const String& XclImpPCField::GetFieldName( const ScfStringVec& rVisNames ) const const XclImpPCField* XclImpPCField::GetGroupBaseField() const { - DBG_ASSERT( IsGroupChildField(), "XclImpPCField::GetGroupBaseField - this field type does not have a base field" ); + OSL_ENSURE( IsGroupChildField(), "XclImpPCField::GetGroupBaseField - this field type does not have a base field" ); return IsGroupChildField() ? mrPCache.GetField( maFieldInfo.mnGroupBase ) : 0; } @@ -223,14 +223,14 @@ const XclImpPCItem* XclImpPCField::GetItem( sal_uInt16 nItemIdx ) const const XclImpPCItem* XclImpPCField::GetLimitItem( sal_uInt16 nItemIdx ) const { - DBG_ASSERT( nItemIdx < 3, "XclImpPCField::GetLimitItem - invalid item index" ); - DBG_ASSERT( nItemIdx < maNumGroupItems.size(), "XclImpPCField::GetLimitItem - no item found" ); + OSL_ENSURE( nItemIdx < 3, "XclImpPCField::GetLimitItem - invalid item index" ); + OSL_ENSURE( nItemIdx < maNumGroupItems.size(), "XclImpPCField::GetLimitItem - no item found" ); return (nItemIdx < maNumGroupItems.size()) ? maNumGroupItems[ nItemIdx ].get() : 0; } void XclImpPCField::WriteFieldNameToSource( SCCOL nScCol, SCTAB nScTab ) const { - DBG_ASSERT( HasOrigItems(), "XclImpPCField::WriteFieldNameToSource - only for standard fields" ); + OSL_ENSURE( HasOrigItems(), "XclImpPCField::WriteFieldNameToSource - only for standard fields" ); GetDoc().SetString( nScCol, 0, nScTab, maFieldInfo.maName ); mnSourceScCol = nScCol; } @@ -267,7 +267,7 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) sal_uInt16 nGroupC = maFieldInfo.mnGroupItems; sal_uInt16 nBaseC = maFieldInfo.mnBaseItems; sal_uInt16 nOrigC = maFieldInfo.mnOrigItems; - DBG_ASSERT( nVisC > 0, "XclImpPCField::ReadSxfield - field without visible items" ); + OSL_ENSURE( nVisC > 0, "XclImpPCField::ReadSxfield - field without visible items" ); sal_uInt16 nType = maFieldInfo.mnFlags & EXC_SXFIELD_DATA_MASK; bool bType = @@ -283,7 +283,7 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) bool bTypeNone = (nType == EXC_SXFIELD_DATA_NONE); // for now, ignore data type of calculated fields - DBG_ASSERT( bCalced || bType || bTypeNone, "XclImpPCField::ReadSxfield - unknown item data type" ); + OSL_ENSURE( bCalced || bType || bTypeNone, "XclImpPCField::ReadSxfield - unknown item data type" ); if( nVisC > 0 || bPostp ) { @@ -313,7 +313,7 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) case EXC_SXFIELD_DATA_INT: case EXC_SXFIELD_DATA_DBL: meFieldType = EXC_PCFIELD_NUMGROUP; break; case EXC_SXFIELD_DATA_DATE: meFieldType = EXC_PCFIELD_DATEGROUP; break; - default: DBG_ERRORFILE( "XclImpPCField::ReadSxfield - numeric group with wrong data type" ); + default: OSL_FAIL( "XclImpPCField::ReadSxfield - numeric group with wrong data type" ); } } @@ -325,7 +325,7 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) else if( bTypeNone && (nOrigC == 0) ) meFieldType = EXC_PCFIELD_DATECHILD; } - DBG_ASSERT( meFieldType != EXC_PCFIELD_UNKNOWN, "XclImpPCField::ReadSxfield - invalid standard or grouped field" ); + OSL_ENSURE( meFieldType != EXC_PCFIELD_UNKNOWN, "XclImpPCField::ReadSxfield - invalid standard or grouped field" ); } // 3) calculated field @@ -333,7 +333,7 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) { if( !bChild && !bNum && (nGroupC == 0) && (nBaseC == 0) && (nOrigC == 0) ) meFieldType = EXC_PCFIELD_CALCED; - DBG_ASSERT( meFieldType == EXC_PCFIELD_CALCED, "XclImpPCField::ReadSxfield - invalid calculated field" ); + OSL_ENSURE( meFieldType == EXC_PCFIELD_CALCED, "XclImpPCField::ReadSxfield - invalid calculated field" ); } } @@ -342,14 +342,14 @@ void XclImpPCField::ReadSxfield( XclImpStream& rStrm ) // 4) standard field with postponed items if( !bCalced && !bChild && !bNum && bType && (nGroupC == 0) && (nBaseC == 0) && (nOrigC == 0) ) meFieldType = EXC_PCFIELD_STANDARD; - DBG_ASSERT( meFieldType == EXC_PCFIELD_STANDARD, "XclImpPCField::ReadSxfield - invalid postponed field" ); + OSL_ENSURE( meFieldType == EXC_PCFIELD_STANDARD, "XclImpPCField::ReadSxfield - invalid postponed field" ); } } } void XclImpPCField::ReadItem( XclImpStream& rStrm ) { - DBG_ASSERT( HasInlineItems() || HasPostponedItems(), "XclImpPCField::ReadItem - field does not expect items" ); + OSL_ENSURE( HasInlineItems() || HasPostponedItems(), "XclImpPCField::ReadItem - field does not expect items" ); // read the item XclImpPCItemRef xItem( new XclImpPCItem( rStrm ) ); @@ -374,19 +374,19 @@ void XclImpPCField::ReadItem( XclImpStream& rStrm ) void XclImpPCField::ReadSxnumgroup( XclImpStream& rStrm ) { - DBG_ASSERT( IsNumGroupField() || IsDateGroupField(), "XclImpPCField::ReadSxnumgroup - SXNUMGROUP outside numeric grouping field" ); - DBG_ASSERT( !mbNumGroupInfoRead, "XclImpPCField::ReadSxnumgroup - multiple SXNUMGROUP records" ); - DBG_ASSERT( maItems.size() == maFieldInfo.mnGroupItems, "XclImpPCField::ReadSxnumgroup - SXNUMGROUP out of record order" ); + OSL_ENSURE( IsNumGroupField() || IsDateGroupField(), "XclImpPCField::ReadSxnumgroup - SXNUMGROUP outside numeric grouping field" ); + OSL_ENSURE( !mbNumGroupInfoRead, "XclImpPCField::ReadSxnumgroup - multiple SXNUMGROUP records" ); + OSL_ENSURE( maItems.size() == maFieldInfo.mnGroupItems, "XclImpPCField::ReadSxnumgroup - SXNUMGROUP out of record order" ); rStrm >> maNumGroupInfo; mbNumGroupInfoRead = IsNumGroupField() || IsDateGroupField(); } void XclImpPCField::ReadSxgroupinfo( XclImpStream& rStrm ) { - DBG_ASSERT( IsStdGroupField(), "XclImpPCField::ReadSxgroupinfo - SXGROUPINFO outside grouping field" ); - DBG_ASSERT( maGroupOrder.empty(), "XclImpPCField::ReadSxgroupinfo - multiple SXGROUPINFO records" ); - DBG_ASSERT( maItems.size() == maFieldInfo.mnGroupItems, "XclImpPCField::ReadSxgroupinfo - SXGROUPINFO out of record order" ); - DBG_ASSERT( (rStrm.GetRecLeft() / 2) == maFieldInfo.mnBaseItems, "XclImpPCField::ReadSxgroupinfo - wrong SXGROUPINFO size" ); + OSL_ENSURE( IsStdGroupField(), "XclImpPCField::ReadSxgroupinfo - SXGROUPINFO outside grouping field" ); + OSL_ENSURE( maGroupOrder.empty(), "XclImpPCField::ReadSxgroupinfo - multiple SXGROUPINFO records" ); + OSL_ENSURE( maItems.size() == maFieldInfo.mnGroupItems, "XclImpPCField::ReadSxgroupinfo - SXGROUPINFO out of record order" ); + OSL_ENSURE( (rStrm.GetRecLeft() / 2) == maFieldInfo.mnBaseItems, "XclImpPCField::ReadSxgroupinfo - wrong SXGROUPINFO size" ); maGroupOrder.clear(); size_t nSize = rStrm.GetRecLeft() / 2; maGroupOrder.resize( nSize, 0 ); @@ -490,7 +490,7 @@ void XclImpPCField::ConvertDateGroupField( ScDPSaveData& rSaveData, const ScfStr break; default: - DBG_ERRORFILE( "XclImpPCField::ConvertDateGroupField - unknown date field type" ); + OSL_FAIL( "XclImpPCField::ConvertDateGroupField - unknown date field type" ); } } @@ -548,10 +548,10 @@ ScDPNumGroupInfo XclImpPCField::GetScDateGroupInfo() const const double* XclImpPCField::GetNumGroupLimit( sal_uInt16 nLimitIdx ) const { - DBG_ASSERT( IsNumGroupField(), "XclImpPCField::GetNumGroupLimit - only for numeric grouping fields" ); + OSL_ENSURE( IsNumGroupField(), "XclImpPCField::GetNumGroupLimit - only for numeric grouping fields" ); if( const XclImpPCItem* pItem = GetLimitItem( nLimitIdx ) ) { - DBG_ASSERT( pItem->GetDouble(), "XclImpPCField::GetNumGroupLimit - SXDOUBLE item expected" ); + OSL_ENSURE( pItem->GetDouble(), "XclImpPCField::GetNumGroupLimit - SXDOUBLE item expected" ); return pItem->GetDouble(); } return 0; @@ -559,10 +559,10 @@ const double* XclImpPCField::GetNumGroupLimit( sal_uInt16 nLimitIdx ) const const DateTime* XclImpPCField::GetDateGroupLimit( sal_uInt16 nLimitIdx ) const { - DBG_ASSERT( IsDateGroupField(), "XclImpPCField::GetDateGroupLimit - only for date grouping fields" ); + OSL_ENSURE( IsDateGroupField(), "XclImpPCField::GetDateGroupLimit - only for date grouping fields" ); if( const XclImpPCItem* pItem = GetLimitItem( nLimitIdx ) ) { - DBG_ASSERT( pItem->GetDateTime(), "XclImpPCField::GetDateGroupLimit - SXDATETIME item expected" ); + OSL_ENSURE( pItem->GetDateTime(), "XclImpPCField::GetDateGroupLimit - SXDATETIME item expected" ); return pItem->GetDateTime(); } return 0; @@ -578,10 +578,10 @@ const sal_Int16* XclImpPCField::GetDateGroupStep() const { if( const XclImpPCItem* pItem = GetLimitItem( EXC_SXFIELD_INDEX_STEP ) ) { - DBG_ASSERT( pItem->GetInteger(), "XclImpPCField::GetDateGroupStep - SXINTEGER item expected" ); + OSL_ENSURE( pItem->GetInteger(), "XclImpPCField::GetDateGroupStep - SXINTEGER item expected" ); if( const sal_Int16* pnStep = pItem->GetInteger() ) { - DBG_ASSERT( *pnStep > 0, "XclImpPCField::GetDateGroupStep - invalid step count" ); + OSL_ENSURE( *pnStep > 0, "XclImpPCField::GetDateGroupStep - invalid step count" ); // return nothing for step count 1 - this is also a standard date group in Excel return (*pnStep > 1) ? pnStep : 0; } @@ -849,7 +849,7 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) } } - DBG_ASSERT( maPCInfo.mnTotalFields == maFields.size(), + OSL_ENSURE( maPCInfo.mnTotalFields == maFields.size(), "XclImpPivotCache::ReadPivotCacheStream - field count mismatch" ); if (HasCacheRecords()) @@ -990,7 +990,7 @@ void XclImpPTField::ReadSxvi( XclImpStream& rStrm ) void XclImpPTField::ConvertRowColField( ScDPSaveData& rSaveData ) const { - DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_ROWCOL, "XclImpPTField::ConvertRowColField - no row/column field" ); + OSL_ENSURE( maFieldInfo.mnAxes & EXC_SXVD_AXIS_ROWCOL, "XclImpPTField::ConvertRowColField - no row/column field" ); // special data orientation field? if( maFieldInfo.mnCacheIdx == EXC_SXIVD_DATA ) rSaveData.GetDataLayoutDimension()->SetOrientation( static_cast< sal_uInt16 >( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOL ) ) ); @@ -1007,7 +1007,7 @@ void XclImpPTField::SetPageFieldInfo( const XclPTPageFieldInfo& rPageInfo ) void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const { - DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" ); + OSL_ENSURE( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" ); if( ScDPSaveDimension* pSaveDim = ConvertRCPField( rSaveData ) ) { const String* pName = GetItemName( maPageInfo.mnSelItem ); @@ -1023,7 +1023,7 @@ void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const void XclImpPTField::ConvertHiddenField( ScDPSaveData& rSaveData ) const { - DBG_ASSERT( (maFieldInfo.mnAxes & EXC_SXVD_AXIS_ROWCOLPAGE) == 0, "XclImpPTField::ConvertHiddenField - field not hidden" ); + OSL_ENSURE( (maFieldInfo.mnAxes & EXC_SXVD_AXIS_ROWCOLPAGE) == 0, "XclImpPTField::ConvertHiddenField - field not hidden" ); ConvertRCPField( rSaveData ); } @@ -1036,14 +1036,14 @@ bool XclImpPTField::HasDataFieldInfo() const void XclImpPTField::AddDataFieldInfo( const XclPTDataFieldInfo& rDataInfo ) { - DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_DATA, "XclImpPTField::AddDataFieldInfo - no data field" ); + OSL_ENSURE( maFieldInfo.mnAxes & EXC_SXVD_AXIS_DATA, "XclImpPTField::AddDataFieldInfo - no data field" ); maDataInfoList.push_back( rDataInfo ); } void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const { - DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_DATA, "XclImpPTField::ConvertDataField - no data field" ); - DBG_ASSERT( !maDataInfoList.empty(), "XclImpPTField::ConvertDataField - no data field info" ); + OSL_ENSURE( maFieldInfo.mnAxes & EXC_SXVD_AXIS_DATA, "XclImpPTField::ConvertDataField - no data field" ); + OSL_ENSURE( !maDataInfoList.empty(), "XclImpPTField::ConvertDataField - no data field info" ); if( !maDataInfoList.empty() ) { const String& rFieldName = GetFieldName(); @@ -1273,7 +1273,7 @@ void XclImpPivotTable::ReadSxvd( XclImpStream& rStrm ) mxCurrField->ReadSxvd( rStrm ); // add visible name of new field to list of visible names maVisFieldNames.push_back( mxCurrField->GetVisFieldName() ); - DBG_ASSERT( maFields.size() == maVisFieldNames.size(), + OSL_ENSURE( maFields.size() == maVisFieldNames.size(), "XclImpPivotTable::ReadSxvd - wrong size of visible name array" ); } else diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 9180ed401b62..4f04c8b29167 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -151,7 +151,7 @@ ExcelToSc& XclImpRoot::GetOldFmlaConverter() const XclImpSst& XclImpRoot::GetSst() const { - DBG_ASSERT( mrImpData.mxSst, "XclImpRoot::GetSst - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxSst, "XclImpRoot::GetSst - invalid call, wrong BIFF" ); return *mrImpData.mxSst; } @@ -204,7 +204,7 @@ XclImpNameManager& XclImpRoot::GetNameManager() const XclImpLinkManager& XclImpRoot::GetLinkManager() const { - DBG_ASSERT( mrImpData.mxLinkMgr, "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxLinkMgr, "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" ); return *mrImpData.mxLinkMgr; } @@ -215,50 +215,50 @@ XclImpObjectManager& XclImpRoot::GetObjectManager() const XclImpSheetDrawing& XclImpRoot::GetCurrSheetDrawing() const { - DBG_ASSERT( !IsInGlobals(), "XclImpRoot::GetCurrSheetDrawing - must not be called from workbook globals" ); + OSL_ENSURE( !IsInGlobals(), "XclImpRoot::GetCurrSheetDrawing - must not be called from workbook globals" ); return mrImpData.mxObjMgr->GetSheetDrawing( GetCurrScTab() ); } XclImpCondFormatManager& XclImpRoot::GetCondFormatManager() const { - DBG_ASSERT( mrImpData.mxCondFmtMgr, "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxCondFmtMgr, "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" ); return *mrImpData.mxCondFmtMgr; } XclImpValidationManager& XclImpRoot::GetValidationManager() const { - DBG_ASSERT( mrImpData.mxValidMgr, "XclImpRoot::GetValidationManager - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxValidMgr, "XclImpRoot::GetValidationManager - invalid call, wrong BIFF" ); return *mrImpData.mxValidMgr; } XclImpAutoFilterBuffer& XclImpRoot::GetFilterManager() const { // TODO still in old RootData - DBG_ASSERT( GetOldRoot().pAutoFilterBuffer, "XclImpRoot::GetFilterManager - invalid call, wrong BIFF" ); + OSL_ENSURE( GetOldRoot().pAutoFilterBuffer, "XclImpRoot::GetFilterManager - invalid call, wrong BIFF" ); return *GetOldRoot().pAutoFilterBuffer; } XclImpWebQueryBuffer& XclImpRoot::GetWebQueryBuffer() const { - DBG_ASSERT( mrImpData.mxWebQueryBfr, "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxWebQueryBfr, "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" ); return *mrImpData.mxWebQueryBfr; } XclImpPivotTableManager& XclImpRoot::GetPivotTableManager() const { - DBG_ASSERT( mrImpData.mxPTableMgr, "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxPTableMgr, "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" ); return *mrImpData.mxPTableMgr; } XclImpSheetProtectBuffer& XclImpRoot::GetSheetProtectBuffer() const { - DBG_ASSERT( mrImpData.mxTabProtect, "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxTabProtect, "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" ); return *mrImpData.mxTabProtect; } XclImpDocProtectBuffer& XclImpRoot::GetDocProtectBuffer() const { - DBG_ASSERT( mrImpData.mxDocProtect, "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" ); + OSL_ENSURE( mrImpData.mxDocProtect, "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" ); return *mrImpData.mxDocProtect; } diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index 94e8c8cd3ae3..1487a0e867a0 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -444,7 +444,7 @@ XclImpStream::XclImpStream( SvStream& rInStrm, const XclImpRoot& rRoot, bool bCo mrStrm.Seek( STREAM_SEEK_TO_END ); mnStreamSize = mrStrm.Tell(); mrStrm.Seek( STREAM_SEEK_TO_BEGIN ); - DBG_ASSERT( mnStreamSize < STREAM_SEEK_TO_END, "XclImpStream::XclImpStream - stream error" ); + OSL_ENSURE( mnStreamSize < STREAM_SEEK_TO_END, "XclImpStream::XclImpStream - stream error" ); } XclImpStream::~XclImpStream() @@ -531,7 +531,7 @@ void XclImpStream::PushPosition() void XclImpStream::PopPosition() { - DBG_ASSERT( !maPosStack.empty(), "XclImpStream::PopPosition - stack empty" ); + OSL_ENSURE( !maPosStack.empty(), "XclImpStream::PopPosition - stack empty" ); if( !maPosStack.empty() ) { RestorePosition( maPosStack.back() ); @@ -549,7 +549,7 @@ void XclImpStream::StoreGlobalPosition() void XclImpStream::SeekGlobalPosition() { - DBG_ASSERT( mbHasGlobPos, "XclImpStream::SeekGlobalPosition - no position stored" ); + OSL_ENSURE( mbHasGlobPos, "XclImpStream::SeekGlobalPosition - no position stored" ); if( mbHasGlobPos ) { RestorePosition( maGlobPos ); @@ -787,12 +787,12 @@ sal_Size XclImpStream::Read( void* pData, sal_Size nBytes ) sal_uInt16 nReadRet = ReadRawData( pnBuffer, nReadSize ); nRet += nReadRet; mbValid = (nReadSize == nReadRet); - DBG_ASSERT( mbValid, "XclImpStream::Read - stream read error" ); + OSL_ENSURE( mbValid, "XclImpStream::Read - stream read error" ); pnBuffer += nReadRet; nBytesLeft -= nReadRet; if( mbValid && (nBytesLeft > 0) ) JumpToNextContinue(); - DBG_ASSERT( mbValid, "XclImpStream::Read - record overread" ); + OSL_ENSURE( mbValid, "XclImpStream::Read - record overread" ); } } return nRet; @@ -862,7 +862,7 @@ void XclImpStream::Ignore( sal_Size nBytes ) nBytesLeft -= nReadSize; if( nBytesLeft > 0 ) JumpToNextContinue(); - DBG_ASSERT( mbValid, "XclImpStream::Ignore - record overread" ); + OSL_ENSURE( mbValid, "XclImpStream::Ignore - record overread" ); } } @@ -872,7 +872,7 @@ sal_Size XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, bool& rbRich, bool& rbFareast, sal_uInt16& rnFormatRuns, sal_uInt32& rnExtInf, sal_uInt8 nFlags ) { - DBG_ASSERT( !::get_flag( nFlags, EXC_STRF_UNKNOWN ), "XclImpStream::ReadUniStringExt - unknown flags" ); + OSL_ENSURE( !::get_flag( nFlags, EXC_STRF_UNKNOWN ), "XclImpStream::ReadUniStringExt - unknown flags" ); rb16Bit = ::get_flag( nFlags, EXC_STRF_16BIT ); rbRich = ::get_flag( nFlags, EXC_STRF_RICH ); rbFareast = ::get_flag( nFlags, EXC_STRF_FAREAST ); @@ -904,7 +904,7 @@ String XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) if( b16Bit ) { nReadSize = ::std::min< sal_uInt16 >( nCharsLeft, mnRawRecLeft / 2 ); - DBG_ASSERT( (nReadSize <= nCharsLeft) || !(mnRawRecLeft & 0x1), + OSL_ENSURE( (nReadSize <= nCharsLeft) || !(mnRawRecLeft & 0x1), "XclImpStream::ReadRawUniString - missing a byte" ); } else @@ -973,7 +973,7 @@ void XclImpStream::IgnoreRawUniString( sal_uInt16 nChars, bool b16Bit ) if( b16Bit ) { nReadSize = ::std::min< sal_uInt16 >( nCharsLeft, mnRawRecLeft / 2 ); - DBG_ASSERT( (nReadSize <= nCharsLeft) || !(mnRawRecLeft & 0x1), + OSL_ENSURE( (nReadSize <= nCharsLeft) || !(mnRawRecLeft & 0x1), "XclImpStream::IgnoreRawUniString - missing a byte" ); Ignore( nReadSize * 2 ); } @@ -1085,7 +1085,7 @@ bool XclImpStream::JumpToNextContinue() bool XclImpStream::JumpToNextStringContinue( bool& rb16Bit ) { - DBG_ASSERT( mnRawRecLeft == 0, "XclImpStream::JumpToNextStringContinue - unexpected garbage" ); + OSL_ENSURE( mnRawRecLeft == 0, "XclImpStream::JumpToNextStringContinue - unexpected garbage" ); if( mbCont && (GetRecLeft() > 0) ) { @@ -1115,7 +1115,7 @@ bool XclImpStream::EnsureRawReadSize( sal_uInt16 nBytes ) { while( mbValid && !mnRawRecLeft ) JumpToNextContinue(); mbValid = mbValid && (nBytes <= mnRawRecLeft); - DBG_ASSERT( mbValid, "XclImpStream::EnsureRawReadSize - record overread" ); + OSL_ENSURE( mbValid, "XclImpStream::EnsureRawReadSize - record overread" ); } return mbValid; } @@ -1127,7 +1127,7 @@ sal_uInt16 XclImpStream::GetMaxRawReadSize( sal_Size nBytes ) const sal_uInt16 XclImpStream::ReadRawData( void* pData, sal_uInt16 nBytes ) { - DBG_ASSERT( (nBytes <= mnRawRecLeft), "XclImpStream::ReadRawData - record overread" ); + OSL_ENSURE( (nBytes <= mnRawRecLeft), "XclImpStream::ReadRawData - record overread" ); sal_uInt16 nRet = 0; if( mbUseDecr ) nRet = mxDecrypter->Read( mrStrm, pData, nBytes ); diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index c50b0605e3ee..e2165850a914 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -57,7 +57,7 @@ void XclImpString::Read( XclImpStream& rStrm, XclStrFlags nFlags ) if( !::get_flag( nFlags, EXC_STR_SEPARATEFORMATS ) ) maFormats.clear(); - DBG_ASSERT( (nFlags & ~nAllowedFlags) == 0, "XclImpString::Read - unknown flag" ); + OSL_ENSURE( (nFlags & ~nAllowedFlags) == 0, "XclImpString::Read - unknown flag" ); bool b16BitLen = !::get_flag( nFlags, EXC_STR_8BITLENGTH ); switch( rStrm.GetRoot().GetBiff() ) @@ -104,7 +104,7 @@ void XclImpString::Read( XclImpStream& rStrm, XclStrFlags nFlags ) void XclImpString::AppendFormat( XclFormatRunVec& rFormats, sal_uInt16 nChar, sal_uInt16 nFontIdx ) { // #i33341# real life -- same character index may occur several times - DBG_ASSERT( rFormats.empty() || (rFormats.back().mnChar <= nChar), "XclImpString::AppendFormat - wrong char order" ); + OSL_ENSURE( rFormats.empty() || (rFormats.back().mnChar <= nChar), "XclImpString::AppendFormat - wrong char order" ); if( rFormats.empty() || (rFormats.back().mnChar < nChar) ) rFormats.push_back( XclFormatRun( nChar, nFontIdx ) ); else diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 11381e54bb4e..1fe26fd27bf9 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -174,7 +174,7 @@ void XclImpPalette::ReadPalette( XclImpStream& rStrm ) { sal_uInt16 nCount; rStrm >> nCount; - DBG_ASSERT( rStrm.GetRecLeft() == static_cast< sal_Size >( 4 * nCount ), + OSL_ENSURE( rStrm.GetRecLeft() == static_cast< sal_Size >( 4 * nCount ), "XclImpPalette::ReadPalette - size mismatch" ); maColorTable.resize( nCount ); @@ -281,7 +281,7 @@ void XclImpFont::ReadEfont( XclImpStream& rStrm ) void XclImpFont::ReadCFFontBlock( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 ); + OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF8 ); if( GetBiff() != EXC_BIFF8 ) return; @@ -662,7 +662,7 @@ void XclImpNumFmtBuffer::ReadFormat( XclImpStream& rStrm ) void XclImpNumFmtBuffer::CreateScFormats() { - DBG_ASSERT( maIndexMap.empty(), "XclImpNumFmtBuffer::CreateScFormats - already created" ); + OSL_ENSURE( maIndexMap.empty(), "XclImpNumFmtBuffer::CreateScFormats - already created" ); SvNumberFormatter& rFormatter = GetFormatter(); for( XclNumFmtMap::const_iterator aIt = GetFormatMap().begin(), aEnd = GetFormatMap().end(); aIt != aEnd; ++aIt ) @@ -703,7 +703,7 @@ void XclImpNumFmtBuffer::FillToItemSet( SfxItemSet& rItemSet, sal_uInt16 nXclNum void XclImpNumFmtBuffer::FillScFmtToItemSet( SfxItemSet& rItemSet, sal_uLong nScNumFmt, bool bSkipPoolDefs ) const { - DBG_ASSERT( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND, "XclImpNumFmtBuffer::FillScFmtToItemSet - invalid number format" ); + OSL_ENSURE( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND, "XclImpNumFmtBuffer::FillScFmtToItemSet - invalid number format" ); ScfTools::PutItem( rItemSet, SfxUInt32Item( ATTR_VALUE_FORMAT, nScNumFmt ), bSkipPoolDefs ); if( rItemSet.GetItemState( ATTR_VALUE_FORMAT, false ) == SFX_ITEM_SET ) ScGlobal::AddLanguage( rItemSet, GetFormatter() ); @@ -1382,7 +1382,7 @@ XclImpStyle::XclImpStyle( const XclImpRoot& rRoot ) : void XclImpStyle::ReadStyle( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF3 ); + OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF3 ); sal_uInt16 nXFIndex; rStrm >> nXFIndex; @@ -1430,7 +1430,7 @@ ScStyleSheet* XclImpStyle::CreateStyleSheet() // use existing "Default" style sheet mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) ); - DBG_ASSERT( mpStyleSheet, "XclImpStyle::CreateStyleSheet - Default style not found" ); + OSL_ENSURE( mpStyleSheet, "XclImpStyle::CreateStyleSheet - Default style not found" ); bCreatePattern = true; } else @@ -1487,7 +1487,7 @@ void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm ) XclImpStyle* pStyle = new XclImpStyle( GetRoot() ); pStyle->ReadStyle( rStrm ); (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( pStyle ); - DBG_ASSERT( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" ); + OSL_ENSURE( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" ); maStylesByXf[ pStyle->GetXfId() ] = pStyle; } @@ -1543,7 +1543,7 @@ void XclImpXFBuffer::CreateUserStyles() for( XclImpStyleList::iterator itStyle = maBuiltinStyles.begin(); itStyle != maBuiltinStyles.end(); ++itStyle ) { String aStyleName = XclTools::GetBuiltInStyleName( itStyle->GetBuiltinId(), itStyle->GetName(), itStyle->GetLevel() ); - DBG_ASSERT( bReserveAll || (aCellStyles.count( aStyleName ) == 0), + OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0), "XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" ); if( aCellStyles.count( aStyleName ) > 0 ) aConflictNameStyles.push_back( &(*itStyle) ); @@ -1616,7 +1616,7 @@ bool XclImpXFRange::Expand( SCROW nScRow, const XclImpXFIndex& rXFIndex ) bool XclImpXFRange::Expand( const XclImpXFRange& rNextRange ) { - DBG_ASSERT( mnScRow2 < rNextRange.mnScRow1, "XclImpXFRange::Expand - rows out of order" ); + OSL_ENSURE( mnScRow2 < rNextRange.mnScRow1, "XclImpXFRange::Expand - rows out of order" ); if( (maXFIndex == rNextRange.maXFIndex) && (mnScRow2 + 1 == rNextRange.mnScRow1) ) { mnScRow2 = rNextRange.mnScRow2; @@ -1631,7 +1631,7 @@ void XclImpXFRangeColumn::SetDefaultXF( const XclImpXFIndex& rXFIndex ) { // List should be empty when inserting the default column format. // Later explicit SetXF() calls will break up this range. - DBG_ASSERT( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" ); + OSL_ENSURE( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" ); // insert a complete row range with one insert. maIndexList.push_back( new XclImpXFRange( 0, MAXROW, rXFIndex ) ); @@ -1756,7 +1756,7 @@ void XclImpXFRangeColumn::Find( { nMidIndex = (nPrevIndex + rnNextIndex) / 2; pMidRange = &maIndexList[nMidIndex]; - DBG_ASSERT( pMidRange, "XclImpXFRangeColumn::Find - missing XF index range" ); + OSL_ENSURE( pMidRange, "XclImpXFRangeColumn::Find - missing XF index range" ); if( nScRow < pMidRange->mnScRow1 ) // row is really before pMidRange { rpNextRange = pMidRange; @@ -1871,7 +1871,7 @@ void XclImpXFRangeBuffer::SetColumnDefXF( SCCOL nScCol, sal_uInt16 nXFIndex ) size_t nIndex = static_cast< size_t >( nScCol ); if( maColumns.size() <= nIndex ) maColumns.resize( nIndex + 1 ); - DBG_ASSERT( !maColumns[ nIndex ], "XclImpXFRangeBuffer::SetColumnDefXF - default column of XFs already has values" ); + OSL_ENSURE( !maColumns[ nIndex ], "XclImpXFRangeBuffer::SetColumnDefXF - default column of XFs already has values" ); maColumns[ nIndex ].reset( new XclImpXFRangeColumn ); maColumns[ nIndex ]->SetDefaultXF( XclImpXFIndex( nXFIndex ) ); } diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx index 4f4781317df9..b111075e3886 100644 --- a/sc/source/filter/excel/xiview.cxx +++ b/sc/source/filter/excel/xiview.cxx @@ -109,7 +109,7 @@ void XclImpTabViewSettings::Initialize() void XclImpTabViewSettings::ReadTabBgColor( XclImpStream& rStrm, XclImpPalette& rPal ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF8 ); + OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF8 ); if( GetBiff() < EXC_BIFF8 ) return; @@ -191,7 +191,7 @@ void XclImpTabViewSettings::ReadScl( XclImpStream& rStrm ) { sal_uInt16 nNum, nDenom; rStrm >> nNum >> nDenom; - DBG_ASSERT( nDenom > 0, "XclImpPageSettings::ReadScl - invalid denominator" ); + OSL_ENSURE( nDenom > 0, "XclImpPageSettings::ReadScl - invalid denominator" ); if( nDenom > 0 ) maData.mnCurrentZoom = limit_cast< sal_uInt16 >( (nNum * 100) / nDenom ); } diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx index e66251b33bde..98b5453e48fe 100644 --- a/sc/source/filter/excel/xladdress.cxx +++ b/sc/source/filter/excel/xladdress.cxx @@ -121,7 +121,7 @@ void XclRangeList::Write( XclExpStream& rStrm, bool bCol16Bit ) const void XclRangeList::WriteSubList( XclExpStream& rStrm, size_t nBegin, size_t nCount, bool bCol16Bit ) const { - DBG_ASSERT( nBegin <= size(), "XclRangeList::WriteSubList - invalid start position" ); + OSL_ENSURE( nBegin <= size(), "XclRangeList::WriteSubList - invalid start position" ); size_t nEnd = ::std::min< size_t >( nBegin + nCount, size() ); sal_uInt16 nXclCount = ulimit_cast< sal_uInt16 >( nEnd - nBegin ); rStrm << nXclCount; @@ -141,8 +141,8 @@ XclAddressConverterBase::XclAddressConverterBase( XclTracer& rTracer, const ScAd mbRowTrunc( false ), mbTabTrunc( false ) { - DBG_ASSERT( static_cast< size_t >( rMaxPos.Col() ) <= SAL_MAX_UINT16, "XclAddressConverterBase::XclAddressConverterBase - invalid max column" ); - DBG_ASSERT( static_cast< size_t >( rMaxPos.Row() ) <= SAL_MAX_UINT32, "XclAddressConverterBase::XclAddressConverterBase - invalid max row" ); + OSL_ENSURE( static_cast< size_t >( rMaxPos.Col() ) <= SAL_MAX_UINT16, "XclAddressConverterBase::XclAddressConverterBase - invalid max column" ); + OSL_ENSURE( static_cast< size_t >( rMaxPos.Row() ) <= SAL_MAX_UINT32, "XclAddressConverterBase::XclAddressConverterBase - invalid max row" ); } XclAddressConverterBase::~XclAddressConverterBase() diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index 033468998ea5..6a71736aecc5 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -473,7 +473,7 @@ OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType ) case EXC_CHSERERR_XMINUS: return EXC_CHPROP_ROLE_ERRORBARS_NEGX; case EXC_CHSERERR_YPLUS: return EXC_CHPROP_ROLE_ERRORBARS_POSY; case EXC_CHSERERR_YMINUS: return EXC_CHPROP_ROLE_ERRORBARS_NEGY; - default: DBG_ERRORFILE( "XclChartHelper::GetErrorBarValuesRole - unknown bar type" ); + default: OSL_FAIL( "XclChartHelper::GetErrorBarValuesRole - unknown bar type" ); } return OUString(); } @@ -517,7 +517,7 @@ XclChFormatInfoProvider::XclChFormatInfoProvider() const XclChFormatInfo& XclChFormatInfoProvider::GetFormatInfo( XclChObjectType eObjType ) const { XclFmtInfoMap::const_iterator aIt = maInfoMap.find( eObjType ); - DBG_ASSERT( aIt != maInfoMap.end(), "XclChFormatInfoProvider::GetFormatInfo - unknown object type" ); + OSL_ENSURE( aIt != maInfoMap.end(), "XclChFormatInfoProvider::GetFormatInfo - unknown object type" ); return (aIt == maInfoMap.end()) ? *spFmtInfos : *aIt->second; } @@ -586,7 +586,7 @@ XclChTypeInfoProvider::XclChTypeInfoProvider() const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfo( XclChTypeId eTypeId ) const { XclChTypeInfoMap::const_iterator aIt = maInfoMap.find( eTypeId ); - DBG_ASSERT( aIt != maInfoMap.end(), "XclChTypeInfoProvider::GetTypeInfo - unknown chart type" ); + OSL_ENSURE( aIt != maInfoMap.end(), "XclChTypeInfoProvider::GetTypeInfo - unknown chart type" ); return (aIt == maInfoMap.end()) ? *maInfoMap.rbegin()->second : *aIt->second; } @@ -596,7 +596,7 @@ const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromRecId( sal_uInt16 nRe for( const XclChTypeInfo* pIt = spTypeInfos; pIt != pEnd; ++pIt ) if( pIt->mnRecId == nRecId ) return *pIt; - DBG_ERRORFILE( "XclChTypeInfoProvider::GetTypeInfoFromRecId - unknown record id" ); + OSL_FAIL( "XclChTypeInfoProvider::GetTypeInfoFromRecId - unknown record id" ); return GetTypeInfo( EXC_CHTYPEID_UNKNOWN ); } @@ -606,7 +606,7 @@ const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromService( const OUStri for( const XclChTypeInfo* pIt = spTypeInfos; pIt != pEnd; ++pIt ) if( rServiceName.equalsAscii( pIt->mpcServiceName ) ) return *pIt; - DBG_ERRORFILE( "XclChTypeInfoProvider::GetTypeInfoFromService - unknown service name" ); + OSL_FAIL( "XclChTypeInfoProvider::GetTypeInfoFromService - unknown service name" ); return GetTypeInfo( EXC_CHTYPEID_UNKNOWN ); } @@ -626,7 +626,7 @@ Any XclChObjectTable::GetObject( const OUString& rObjName ) // get object table if( !mxContainer.is() ) mxContainer.set( ScfApiHelper::CreateInstance( mxFactory, maServiceName ), UNO_QUERY ); - DBG_ASSERT( mxContainer.is(), "XclChObjectTable::GetObject - container not found" ); + OSL_ENSURE( mxContainer.is(), "XclChObjectTable::GetObject - container not found" ); Any aObj; if( mxContainer.is() ) @@ -638,7 +638,7 @@ Any XclChObjectTable::GetObject( const OUString& rObjName ) } catch( Exception& ) { - DBG_ERRORFILE( "XclChObjectTable::GetObject - object not found" ); + OSL_FAIL( "XclChObjectTable::GetObject - object not found" ); } } return aObj; @@ -650,7 +650,7 @@ OUString XclChObjectTable::InsertObject( const Any& rObj ) // create object table if( !mxContainer.is() ) mxContainer.set( ScfApiHelper::CreateInstance( mxFactory, maServiceName ), UNO_QUERY ); - DBG_ASSERT( mxContainer.is(), "XclChObjectTable::InsertObject - container not found" ); + OSL_ENSURE( mxContainer.is(), "XclChObjectTable::InsertObject - container not found" ); OUString aObjName; if( mxContainer.is() ) @@ -669,7 +669,7 @@ OUString XclChObjectTable::InsertObject( const Any& rObj ) } catch( Exception& ) { - DBG_ERRORFILE( "XclChObjectTable::InsertObject - cannot insert object" ); + OSL_FAIL( "XclChObjectTable::InsertObject - cannot insert object" ); aObjName = OUString(); } } @@ -795,7 +795,7 @@ void XclChPropSetHelper::ReadLineProperties( } break; default: - DBG_ERRORFILE( "XclChPropSetHelper::ReadLineProperties - unknown line style" ); + OSL_FAIL( "XclChPropSetHelper::ReadLineProperties - unknown line style" ); rLineFmt.mnPattern = EXC_CHLINEFORMAT_SOLID; } } @@ -844,7 +844,7 @@ void XclChPropSetHelper::ReadEscherProperties( { case cssd::FillStyle_SOLID: { - DBG_ASSERT( nTransparency > 0, "XclChPropSetHelper::ReadEscherProperties - unexpected solid area without transparency" ); + OSL_ENSURE( nTransparency > 0, "XclChPropSetHelper::ReadEscherProperties - unexpected solid area without transparency" ); if( (0 < nTransparency) && (nTransparency <= 100) ) { // convert to Escher properties @@ -916,7 +916,7 @@ void XclChPropSetHelper::ReadEscherProperties( } break; default: - DBG_ERRORFILE( "XclChPropSetHelper::ReadEscherProperties - unknown fill style" ); + OSL_FAIL( "XclChPropSetHelper::ReadEscherProperties - unknown fill style" ); } } @@ -1132,7 +1132,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet, } break; default: - DBG_ERRORFILE( "XclChPropSetHelper::WriteEscherProperties - unknown fill mode" ); + OSL_FAIL( "XclChPropSetHelper::WriteEscherProperties - unknown fill mode" ); } } } @@ -1196,7 +1196,7 @@ ScfPropSetHelper& XclChPropSetHelper::GetLineHelper( XclChPropertyMode ePropMode case EXC_CHPROPMODE_COMMON: return maLineHlpCommon; case EXC_CHPROPMODE_LINEARSERIES: return maLineHlpLinear; case EXC_CHPROPMODE_FILLEDSERIES: return maLineHlpFilled; - default: DBG_ERRORFILE( "XclChPropSetHelper::GetLineHelper - unknown property mode" ); + default: OSL_FAIL( "XclChPropSetHelper::GetLineHelper - unknown property mode" ); } return maLineHlpCommon; } @@ -1207,7 +1207,7 @@ ScfPropSetHelper& XclChPropSetHelper::GetAreaHelper( XclChPropertyMode ePropMode { case EXC_CHPROPMODE_COMMON: return maAreaHlpCommon; case EXC_CHPROPMODE_FILLEDSERIES: return maAreaHlpFilled; - default: DBG_ERRORFILE( "XclChPropSetHelper::GetAreaHelper - unknown property mode" ); + default: OSL_FAIL( "XclChPropSetHelper::GetAreaHelper - unknown property mode" ); } return maAreaHlpCommon; } @@ -1218,7 +1218,7 @@ ScfPropSetHelper& XclChPropSetHelper::GetGradientHelper( XclChPropertyMode eProp { case EXC_CHPROPMODE_COMMON: return maGradHlpCommon; case EXC_CHPROPMODE_FILLEDSERIES: return maGradHlpFilled; - default: DBG_ERRORFILE( "XclChPropSetHelper::GetGradientHelper - unknown property mode" ); + default: OSL_FAIL( "XclChPropSetHelper::GetGradientHelper - unknown property mode" ); } return maGradHlpCommon; } @@ -1229,7 +1229,7 @@ ScfPropSetHelper& XclChPropSetHelper::GetHatchHelper( XclChPropertyMode ePropMod { case EXC_CHPROPMODE_COMMON: return maHatchHlpCommon; case EXC_CHPROPMODE_FILLEDSERIES: return maHatchHlpFilled; - default: DBG_ERRORFILE( "XclChPropSetHelper::GetHatchHelper - unknown property mode" ); + default: OSL_FAIL( "XclChPropSetHelper::GetHatchHelper - unknown property mode" ); } return maHatchHlpCommon; } @@ -1300,7 +1300,7 @@ XclChRootData::~XclChRootData() void XclChRootData::InitConversion( const XclRoot& rRoot, const Reference< XChartDocument >& rxChartDoc, const Rectangle& rChartRect ) { // remember chart document reference and chart shape position/size - DBG_ASSERT( rxChartDoc.is(), "XclChRootData::InitConversion - missing chart document" ); + OSL_ENSURE( rxChartDoc.is(), "XclChRootData::InitConversion - missing chart document" ); mxChartDoc = rxChartDoc; maChartRect = rChartRect; diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 7c531a64d018..ddfb1da28231 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -88,7 +88,7 @@ double lclGetTwipsScale( MapUnit eMapUnit ) { case MAP_TWIP: fScale = 72 / POINTS_PER_INCH; break; // Calc twips <-> real twips case MAP_100TH_MM: fScale = HMM_PER_TWIPS; break; // Calc twips <-> 1/100mm - default: DBG_ERRORFILE( "lclGetTwipsScale - map unit not implemented" ); + default: OSL_FAIL( "lclGetTwipsScale - map unit not implemented" ); } return fScale; } @@ -223,7 +223,7 @@ void XclObjAnchor::SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 { case MAP_TWIP: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm case MAP_100TH_MM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm - default: DBG_ERRORFILE( "XclObjAnchor::SetRect - map unit not implemented" ); + default: OSL_FAIL( "XclObjAnchor::SetRect - map unit not implemented" ); } /* In objects with DFF client anchor, the position of the shape is stored diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 336de4ded284..1ea523cae6ae 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -431,7 +431,7 @@ XclFunctionProvider::XclFunctionProvider( const XclRoot& rRoot ) const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclFunc( sal_uInt16 nXclFunc ) const { // only in import filter allowed - DBG_ASSERT( !maXclFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromXclFunc - wrong filter" ); + OSL_ENSURE( !maXclFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromXclFunc - wrong filter" ); XclFuncMap::const_iterator aIt = maXclFuncMap.find( nXclFunc ); return (aIt == maXclFuncMap.end()) ? 0 : aIt->second; } @@ -439,7 +439,7 @@ const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclFunc( sal_uInt16 n const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclMacroName( const String& rXclMacroName ) const { // only in import filter allowed, but do not test maXclMacroNameMap, it may be empty for old BIFF versions - DBG_ASSERT( !maXclFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromXclMacroName - wrong filter" ); + OSL_ENSURE( !maXclFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromXclMacroName - wrong filter" ); XclMacroNameMap::const_iterator aIt = maXclMacroNameMap.find( rXclMacroName ); return (aIt == maXclMacroNameMap.end()) ? 0 : aIt->second; } @@ -447,7 +447,7 @@ const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclMacroName( const S const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromOpCode( OpCode eOpCode ) const { // only in export filter allowed - DBG_ASSERT( !maScFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromOpCode - wrong filter" ); + OSL_ENSURE( !maScFuncMap.empty(), "XclFunctionProvider::GetFuncInfoFromOpCode - wrong filter" ); ScFuncMap::const_iterator aIt = maScFuncMap.find( eOpCode ); return (aIt == maScFuncMap.end()) ? 0 : aIt->second; } @@ -494,7 +494,7 @@ XclTokenArray::XclTokenArray( ScfUInt8Vec& rTokVec, ScfUInt8Vec& rExtDataVec, bo sal_uInt16 XclTokenArray::GetSize() const { - DBG_ASSERT( maTokVec.size() <= 0xFFFF, "XclTokenArray::GetSize - array too long" ); + OSL_ENSURE( maTokVec.size() <= 0xFFFF, "XclTokenArray::GetSize - array too long" ); return limit_cast< sal_uInt16 >( maTokVec.size() ); } diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index fb0a7bbb64fe..fca43df784da 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -123,7 +123,7 @@ bool XclPCItem::IsEqual( const XclPCItem& rItem ) const case EXC_PCITEM_INTEGER: return mnValue == rItem.mnValue; case EXC_PCITEM_BOOL: return mbValue == rItem.mbValue; case EXC_PCITEM_ERROR: return mnError == rItem.mnError; - default: DBG_ERRORFILE( "XclPCItem::IsEqual - unknown pivot cache item type" ); + default: OSL_FAIL( "XclPCItem::IsEqual - unknown pivot cache item type" ); } return false; } diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 3dc0fda96dc0..a6e3ea0d1406 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -79,7 +79,7 @@ using namespace ::com::sun::star; #ifdef DBG_UTIL XclDebugObjCounter::~XclDebugObjCounter() { - DBG_ASSERT( mnObjCnt == 0, "XclDebugObjCounter::~XclDebugObjCounter - wrong root object count" ); + OSL_ENSURE( mnObjCnt == 0, "XclDebugObjCounter::~XclDebugObjCounter - wrong root object count" ); } #endif @@ -119,7 +119,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, case SCRIPTTYPE_LATIN: mnDefApiScript = ApiScriptType::LATIN; break; case SCRIPTTYPE_ASIAN: mnDefApiScript = ApiScriptType::ASIAN; break; case SCRIPTTYPE_COMPLEX: mnDefApiScript = ApiScriptType::COMPLEX; break; - default: DBG_ERRORFILE( "XclRootData::XclRootData - unknown script type" ); + default: OSL_FAIL( "XclRootData::XclRootData - unknown script type" ); } // maximum cell position @@ -204,7 +204,7 @@ XclRoot& XclRoot::operator=( const XclRoot& rRoot ) { (void)rRoot; // avoid compiler warning // allowed for assignment in derived classes - but test if the same root data is used - DBG_ASSERT( &mrData == &rRoot.mrData, "XclRoot::operator= - incompatible root data" ); + OSL_ENSURE( &mrData == &rRoot.mrData, "XclRoot::operator= - incompatible root data" ); return *this; } @@ -229,7 +229,7 @@ void XclRoot::SetCharWidth( const XclFontData& rFontData ) if( mrData.mnCharWidth <= 0 ) { // #i48717# Win98 with HP LaserJet returns 0 - DBG_ERRORFILE( "XclRoot::SetCharWidth - invalid character width (no printer?)" ); + OSL_FAIL( "XclRoot::SetCharWidth - invalid character width (no printer?)" ); mrData.mnCharWidth = 11 * rFontData.mnHeight / 20; } } diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index 85537d32e547..08684409de07 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -318,7 +318,7 @@ void XclFontData::SetScFamily( FontFamily eScFamily ) case FAMILY_SWISS: mnFamily = EXC_FONTFAM_SWISS; break; case FAMILY_SYSTEM: mnFamily = EXC_FONTFAM_SYSTEM; break; default: - DBG_ERRORFILE( "XclFontData::SetScFamily - unknown font family" ); + OSL_FAIL( "XclFontData::SetScFamily - unknown font family" ); mnFamily = EXC_FONTFAM_DONTKNOW; } } @@ -753,7 +753,7 @@ ScfPropSetHelper& XclFontPropSetHelper::GetChartHelper( sal_Int16 nScript ) case ApiScriptType::LATIN: return maHlpChWstrn; case ApiScriptType::ASIAN: return maHlpChAsian; case ApiScriptType::COMPLEX: return maHlpChCmplx; - default: DBG_ERRORFILE( "XclFontPropSetHelper::GetChartHelper - unknown script type" ); + default: OSL_FAIL( "XclFontPropSetHelper::GetChartHelper - unknown script type" ); } return maHlpChWstrn; } @@ -1517,7 +1517,7 @@ void XclNumFmtBuffer::InsertBuiltinFormats() { OSL_TRACE( "XclNumFmtBuffer::InsertBuiltinFormats - language 0x%04hX not supported (#i29949#)", meSysLang ); XclBuiltInMap::const_iterator aMIt = aBuiltInMap.find( LANGUAGE_DONTKNOW ); - DBG_ASSERT( aMIt != aBuiltInMap.end(), "XclNumFmtBuffer::InsertBuiltinFormats - default map not found" ); + OSL_ENSURE( aMIt != aBuiltInMap.end(), "XclNumFmtBuffer::InsertBuiltinFormats - default map not found" ); if( aMIt != aBuiltInMap.end() ) aBuiltInVec.push_back( aMIt->second ); } @@ -1593,7 +1593,7 @@ SvxCellHorJustify XclCellAlign::GetScHorAlign() const case EXC_XF_HOR_FILL: eHorJust = SVX_HOR_JUSTIFY_REPEAT; break; case EXC_XF_HOR_JUSTIFY: case EXC_XF_HOR_DISTRIB: eHorJust = SVX_HOR_JUSTIFY_BLOCK; break; - default: DBG_ERRORFILE( "XclCellAlign::GetScHorAlign - unknown horizontal alignment" ); + default: OSL_FAIL( "XclCellAlign::GetScHorAlign - unknown horizontal alignment" ); } return eHorJust; } @@ -1613,7 +1613,7 @@ SvxCellVerJustify XclCellAlign::GetScVerAlign() const case EXC_XF_VER_BOTTOM: eVerJust = SVX_VER_JUSTIFY_STANDARD; break; case EXC_XF_VER_JUSTIFY: case EXC_XF_VER_DISTRIB: eVerJust = SVX_VER_JUSTIFY_BLOCK; break; - default: DBG_ERRORFILE( "XclCellAlign::GetScVerAlign - unknown vertical alignment" ); + default: OSL_FAIL( "XclCellAlign::GetScVerAlign - unknown vertical alignment" ); } return eVerJust; } @@ -1631,7 +1631,7 @@ SvxFrameDirection XclCellAlign::GetScFrameDir() const case EXC_XF_TEXTDIR_CONTEXT: eFrameDir = FRMDIR_ENVIRONMENT; break; case EXC_XF_TEXTDIR_LTR: eFrameDir = FRMDIR_HORI_LEFT_TOP; break; case EXC_XF_TEXTDIR_RTL: eFrameDir = FRMDIR_HORI_RIGHT_TOP; break; - default: DBG_ERRORFILE( "XclCellAlign::GetScFrameDir - unknown CTL text direction" ); + default: OSL_FAIL( "XclCellAlign::GetScFrameDir - unknown CTL text direction" ); } return eFrameDir; } @@ -1672,7 +1672,7 @@ void XclCellAlign::SetScFrameDir( SvxFrameDirection eFrameDir ) case FRMDIR_HORI_LEFT_TOP: mnTextDir = EXC_XF_TEXTDIR_LTR; break; case FRMDIR_HORI_RIGHT_TOP: mnTextDir = EXC_XF_TEXTDIR_RTL; break; default: mnTextDir = EXC_XF_TEXTDIR_CONTEXT; - DBG_ERRORFILE( "XclCellAlign::SetScFrameDir - unknown CTL text direction" ); + OSL_FAIL( "XclCellAlign::SetScFrameDir - unknown CTL text direction" ); } } diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index aba8b38fc340..74ea9815b63e 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -174,7 +174,7 @@ sal_Int32 XclTools::GetScRotation( sal_uInt16 nXclRot, sal_Int32 nRotForStacked { if( nXclRot == EXC_ROT_STACKED ) return nRotForStacked; - DBG_ASSERT( nXclRot <= 180, "XclTools::GetScRotation - illegal rotation angle" ); + OSL_ENSURE( nXclRot <= 180, "XclTools::GetScRotation - illegal rotation angle" ); return static_cast< sal_Int32 >( (nXclRot <= 180) ? (100 * ((nXclRot > 90) ? (450 - nXclRot) : nXclRot)) : 0 ); } @@ -200,7 +200,7 @@ sal_uInt8 XclTools::GetXclRotFromOrient( sal_uInt8 nXclOrient ) case EXC_ORIENT_STACKED: return EXC_ROT_STACKED; case EXC_ORIENT_90CCW: return EXC_ROT_90CCW; case EXC_ORIENT_90CW: return EXC_ROT_90CW; - default: DBG_ERRORFILE( "XclTools::GetXclRotFromOrient - unknown text orientation" ); + default: OSL_FAIL( "XclTools::GetXclRotFromOrient - unknown text orientation" ); } return EXC_ROT_NONE; } @@ -209,7 +209,7 @@ sal_uInt8 XclTools::GetXclOrientFromRot( sal_uInt16 nXclRot ) { if( nXclRot == EXC_ROT_STACKED ) return EXC_ORIENT_STACKED; - DBG_ASSERT( nXclRot <= 180, "XclTools::GetXclOrientFromRot - unknown text rotation" ); + OSL_ENSURE( nXclRot <= 180, "XclTools::GetXclOrientFromRot - unknown text rotation" ); if( (45 < nXclRot) && (nXclRot <= 90) ) return EXC_ORIENT_90CCW; if( (135 < nXclRot) && (nXclRot <= 180) ) @@ -254,7 +254,7 @@ sal_uInt16 XclTools::GetScErrorCode( sal_uInt8 nXclError ) case EXC_ERR_NAME: return errNoName; case EXC_ERR_NUM: return errIllegalFPOperation; case EXC_ERR_NA: return NOTAVAILABLE; - default: DBG_ERRORFILE( "XclTools::GetScErrorCode - unknown error code" ); + default: OSL_FAIL( "XclTools::GetScErrorCode - unknown error code" ); } return NOTAVAILABLE; } @@ -491,7 +491,7 @@ static const sal_Char* const ppcDefNames[] = String XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn ) { - DBG_ASSERT( SAL_N_ELEMENTS( ppcDefNames ) == EXC_BUILTIN_UNKNOWN, + OSL_ENSURE( SAL_N_ELEMENTS( ppcDefNames ) == EXC_BUILTIN_UNKNOWN, "XclTools::GetXclBuiltInDefName - built-in defined name list modified" ); String aDefName; if( cBuiltIn < SAL_N_ELEMENTS( ppcDefNames ) ) diff --git a/sc/source/filter/excel/xlview.cxx b/sc/source/filter/excel/xlview.cxx index 63512e4ec2d5..3c2089e8eb84 100644 --- a/sc/source/filter/excel/xlview.cxx +++ b/sc/source/filter/excel/xlview.cxx @@ -94,7 +94,7 @@ bool XclTabViewData::HasPane( sal_uInt8 nPaneId ) const case EXC_PANE_BOTTOMLEFT: return mnSplitY > 0; case EXC_PANE_TOPLEFT: return true; } - DBG_ERRORFILE( "XclExpPane::HasPane - wrong pane ID" ); + OSL_FAIL( "XclExpPane::HasPane - wrong pane ID" ); return false; } diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx index 3e96a92d6485..7aa04dcbadf4 100644 --- a/sc/source/filter/ftools/fapihelper.cxx +++ b/sc/source/filter/ftools/fapihelper.cxx @@ -95,7 +95,7 @@ Reference< XInterface > ScfApiHelper::CreateInstance( } catch( Exception& ) { - DBG_ERRORFILE( "ScfApiHelper::CreateInstance - cannot create instance" ); + OSL_FAIL( "ScfApiHelper::CreateInstance - cannot create instance" ); } } return xInt; @@ -123,7 +123,7 @@ Reference< XInterface > ScfApiHelper::CreateInstanceWithArgs( } catch( Exception& ) { - DBG_ERRORFILE( "ScfApiHelper::CreateInstanceWithArgs - cannot create instance" ); + OSL_FAIL( "ScfApiHelper::CreateInstanceWithArgs - cannot create instance" ); } } return xInt; @@ -236,7 +236,7 @@ void ScfPropertySet::GetProperties( Sequence< Any >& rValues, const Sequence< OU { try { - DBG_ASSERT( mxMultiPropSet.is(), "ScfPropertySet::GetProperties - multi property set not available" ); + OSL_ENSURE( mxMultiPropSet.is(), "ScfPropertySet::GetProperties - multi property set not available" ); if( mxMultiPropSet.is() ) // first try the XMultiPropertySet { rValues = mxMultiPropSet->getPropertyValues( rPropNames ); @@ -268,7 +268,7 @@ void ScfPropertySet::SetAnyProperty( const OUString& rPropName, const Any& rValu } catch( Exception& ) { - DBG_ERRORFILE( + OSL_FAIL( ByteString( "ScfPropertySet::SetAnyProperty - cannot set property \"" ). Append( ByteString( String( rPropName ), RTL_TEXTENCODING_ASCII_US ) ). Append( '"' ). @@ -278,7 +278,7 @@ void ScfPropertySet::SetAnyProperty( const OUString& rPropName, const Any& rValu void ScfPropertySet::SetProperties( const Sequence< OUString >& rPropNames, const Sequence< Any >& rValues ) { - DBG_ASSERT( rPropNames.getLength() == rValues.getLength(), "ScfPropertySet::SetProperties - length of sequences different" ); + OSL_ENSURE( rPropNames.getLength() == rValues.getLength(), "ScfPropertySet::SetProperties - length of sequences different" ); try { if( mxMultiPropSet.is() ) // first try the XMultiPropertySet @@ -287,7 +287,7 @@ void ScfPropertySet::SetProperties( const Sequence< OUString >& rPropNames, cons } else if( mxPropSet.is() ) { - DBG_ERRORFILE( "ScfPropertySet::SetProperties - multi property set not available" ); + OSL_FAIL( "ScfPropertySet::SetProperties - multi property set not available" ); const OUString* pPropName = rPropNames.getConstArray(); const OUString* pPropNameEnd = pPropName + rPropNames.getLength(); const Any* pValue = rValues.getConstArray(); @@ -297,7 +297,7 @@ void ScfPropertySet::SetProperties( const Sequence< OUString >& rPropNames, cons } catch( Exception& ) { - DBG_ERRORFILE( "ScfPropertySet::SetAnyProperty - cannot set multiple properties" ); + OSL_FAIL( "ScfPropertySet::SetAnyProperty - cannot set multiple properties" ); } } @@ -306,7 +306,7 @@ void ScfPropertySet::SetProperties( const Sequence< OUString >& rPropNames, cons ScfPropSetHelper::ScfPropSetHelper( const sal_Char* const* ppcPropNames ) : mnNextIdx( 0 ) { - DBG_ASSERT( ppcPropNames, "ScfPropSetHelper::ScfPropSetHelper - no strings found" ); + OSL_ENSURE( ppcPropNames, "ScfPropSetHelper::ScfPropSetHelper - no strings found" ); // create OUStrings from ASCII property names typedef ::std::pair< OUString, size_t > IndexedOUString; @@ -408,7 +408,7 @@ void ScfPropSetHelper::WriteToPropertySet( ScfPropertySet& rPropSet ) const Any* ScfPropSetHelper::GetNextAny() { - DBG_ASSERT( mnNextIdx < maNameOrder.size(), "ScfPropSetHelper::GetNextAny - sequence overflow" ); + OSL_ENSURE( mnNextIdx < maNameOrder.size(), "ScfPropSetHelper::GetNextAny - sequence overflow" ); Any* pAny = 0; if( mnNextIdx < maNameOrder.size() ) pAny = &maValueSeq[ maNameOrder[ mnNextIdx++ ] ]; diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx index 20e227f69f46..403591b13335 100644 --- a/sc/source/filter/ftools/fprogressbar.cxx +++ b/sc/source/filter/ftools/fprogressbar.cxx @@ -142,7 +142,7 @@ void ScfProgressBar::IncreaseProgressBar( sal_Size nDelta ) } else { - DBG_ERRORFILE( "ScfProgressBar::IncreaseProgressBar - no progress bar found" ); + OSL_FAIL( "ScfProgressBar::IncreaseProgressBar - no progress bar found" ); } mnTotalPos = nNewPos; @@ -150,7 +150,7 @@ void ScfProgressBar::IncreaseProgressBar( sal_Size nDelta ) sal_Int32 ScfProgressBar::AddSegment( sal_Size nSize ) { - DBG_ASSERT( !mbInProgress, "ScfProgressBar::AddSegment - already in progress mode" ); + OSL_ENSURE( !mbInProgress, "ScfProgressBar::AddSegment - already in progress mode" ); if( nSize == 0 ) return SCF_INV_SEGMENT; @@ -162,7 +162,7 @@ sal_Int32 ScfProgressBar::AddSegment( sal_Size nSize ) ScfProgressBar& ScfProgressBar::GetSegmentProgressBar( sal_Int32 nSegment ) { ScfProgressSegment* pSegment = GetSegment( nSegment ); - DBG_ASSERT( !pSegment || (pSegment->mnPos == 0), "ScfProgressBar::GetSegmentProgressBar - segment already started" ); + OSL_ENSURE( !pSegment || (pSegment->mnPos == 0), "ScfProgressBar::GetSegmentProgressBar - segment already started" ); if( pSegment && (pSegment->mnPos == 0) ) { if( !pSegment->mxProgress.get() ) @@ -174,24 +174,24 @@ ScfProgressBar& ScfProgressBar::GetSegmentProgressBar( sal_Int32 nSegment ) bool ScfProgressBar::IsFull() const { - DBG_ASSERT( mbInProgress && mpCurrSegment, "ScfProgressBar::IsFull - no segment started" ); + OSL_ENSURE( mbInProgress && mpCurrSegment, "ScfProgressBar::IsFull - no segment started" ); return mpCurrSegment && (mpCurrSegment->mnPos >= mpCurrSegment->mnSize); } void ScfProgressBar::ActivateSegment( sal_Int32 nSegment ) { - DBG_ASSERT( mnTotalSize > 0, "ScfProgressBar::ActivateSegment - progress range is zero" ); + OSL_ENSURE( mnTotalSize > 0, "ScfProgressBar::ActivateSegment - progress range is zero" ); if( mnTotalSize > 0 ) SetCurrSegment( GetSegment( nSegment ) ); } void ScfProgressBar::ProgressAbs( sal_Size nPos ) { - DBG_ASSERT( mbInProgress && mpCurrSegment, "ScfProgressBar::ProgressAbs - no segment started" ); + OSL_ENSURE( mbInProgress && mpCurrSegment, "ScfProgressBar::ProgressAbs - no segment started" ); if( mpCurrSegment ) { - DBG_ASSERT( mpCurrSegment->mnPos <= nPos, "ScfProgressBar::ProgressAbs - delta pos < 0" ); - DBG_ASSERT( nPos <= mpCurrSegment->mnSize, "ScfProgressBar::ProgressAbs - segment overflow" ); + OSL_ENSURE( mpCurrSegment->mnPos <= nPos, "ScfProgressBar::ProgressAbs - delta pos < 0" ); + OSL_ENSURE( nPos <= mpCurrSegment->mnSize, "ScfProgressBar::ProgressAbs - segment overflow" ); if( (mpCurrSegment->mnPos < nPos) && (nPos <= mpCurrSegment->mnSize) ) { IncreaseProgressBar( nPos - mpCurrSegment->mnPos ); diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 8c0165a2a8a0..87c30020e479 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -198,7 +198,7 @@ SotStorageStreamRef ScfTools::OpenStorageStreamRead( SotStorageRef xStrg, const SotStorageStreamRef ScfTools::OpenStorageStreamWrite( SotStorageRef xStrg, const String& rStrmName ) { - DBG_ASSERT( !xStrg || !xStrg->IsContained( rStrmName ), "ScfTools::OpenStorageStreamWrite - stream exists already" ); + OSL_ENSURE( !xStrg || !xStrg->IsContained( rStrmName ), "ScfTools::OpenStorageStreamWrite - stream exists already" ); SotStorageStreamRef xStrm; if( xStrg.Is() ) xStrm = xStrg->OpenSotStream( rStrmName, STREAM_STD_WRITE | STREAM_TRUNC ); @@ -214,7 +214,7 @@ bool ScfTools::CheckItem( const SfxItemSet& rItemSet, sal_uInt16 nWhichId, bool bool ScfTools::CheckItems( const SfxItemSet& rItemSet, const sal_uInt16* pnWhichIds, bool bDeep ) { - DBG_ASSERT( pnWhichIds, "ScfTools::CheckItems - no which id list" ); + OSL_ENSURE( pnWhichIds, "ScfTools::CheckItems - no which id list" ); for( const sal_uInt16* pnWhichId = pnWhichIds; *pnWhichId != 0; ++pnWhichId ) if( CheckItem( rItemSet, *pnWhichId, bDeep ) ) return true; diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 877514344829..6b104c99de34 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -285,7 +285,7 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument if( pItem ) { aCId = ((const SfxStringItem *)pItem)->GetValue(); - DBG_ASSERT( aCId.Len(), "CID ohne Laenge!" ); + OSL_ENSURE( aCId.Len(), "CID ohne Laenge!" ); } } } @@ -470,7 +470,7 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab ) { SfxStyleSheetBasePool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = NULL; - DBG_ASSERT( pStylePool, "StylePool not found! :-(" ); + OSL_ENSURE( pStylePool, "StylePool not found! :-(" ); // remember defaults for compare in WriteCell if ( !aHTMLStyle.bInitialized ) @@ -479,7 +479,7 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab ) pStyleSheet = pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ); - DBG_ASSERT( pStyleSheet, "ParaStyle not found! :-(" ); + OSL_ENSURE( pStyleSheet, "ParaStyle not found! :-(" ); if (!pStyleSheet) pStyleSheet = pStylePool->First(); const SfxItemSet& rSetPara = pStyleSheet->GetItemSet(); @@ -500,7 +500,7 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab ) // There's only one background graphic in HTML! pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL ); pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); - DBG_ASSERT( pStyleSheet, "PageStyle not found! :-(" ); + OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" ); if (!pStyleSheet) pStyleSheet = pStylePool->First(); const SfxItemSet& rSet = pStyleSheet->GetItemSet(); @@ -1070,7 +1070,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) nFormat, ((ScFormulaCell*)pCell)->GetFormatType() ); break; default: - DBG_ERRORFILE( "value data with unsupported cell type" ); + OSL_FAIL( "value data with unsupported cell type" ); } } } @@ -1347,7 +1347,7 @@ void ScHTMLExport::MakeCIdURL( String& rURL ) return; String aLastName( aURLObj.GetLastName() ); - DBG_ASSERT( aLastName.Len(), "Dateiname ohne Laenge!" ); + OSL_ENSURE( aLastName.Len(), "Dateiname ohne Laenge!" ); aLastName.ToLowerAscii(); rURL.AssignAscii( "cid:" ); diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 5bae367a3f65..dd21daf6516a 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -97,7 +97,7 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScR aPageSize = ((const SvxSizeItem&) rSet.Get(ATTR_PAGE_SIZE)).GetSize(); if ( !aPageSize.Width() || !aPageSize.Height() ) { - DBG_ERRORFILE("PageSize Null ?!?!?"); + OSL_FAIL("PageSize Null ?!?!?"); aPageSize = SvxPaperInfo::GetPaperSize( PAPER_A4 ); } aPageSize.Width() -= nLeftMargin + nRightMargin; @@ -106,7 +106,7 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScR } else { - DBG_ERRORFILE("kein StyleSheet?!?"); + OSL_FAIL("kein StyleSheet?!?"); aPageSize = pDefaultDev->LogicToPixel( SvxPaperInfo::GetPaperSize( PAPER_A4 ), MapMode( MAP_TWIP ) ); } @@ -223,7 +223,7 @@ String ScFormatFilterPluginImpl::GetHTMLRangeNameList( ScDocument* pDoc, const S String ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName ) { - DBG_ASSERT( pDoc, "ScHTMLImport::GetHTMLRangeNameList - missing document" ); + OSL_ENSURE( pDoc, "ScHTMLImport::GetHTMLRangeNameList - missing document" ); String aNewName; ScRangeName* pRangeNames = pDoc->GetRangeName(); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 0c3531af7e51..5eeed78bf15f 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -240,7 +240,7 @@ void ScHTMLLayoutParser::EntryEnd( ScEEParseEntry* pE, const ESelection& rSel ) } else { - DBG_ERRORFILE( "EntryEnd: EditEngine ESelection End < Start" ); + OSL_FAIL( "EntryEnd: EditEngine ESelection End < Start" ); } } @@ -260,7 +260,7 @@ void ScHTMLLayoutParser::NextRow( ImportInfo* pInfo ) sal_Bool ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, sal_uInt16 nOffset, SCCOL* pCol, sal_uInt16 nOffsetTol ) { - DBG_ASSERT( pOffset, "ScHTMLLayoutParser::SeekOffset - illegal call" ); + OSL_ENSURE( pOffset, "ScHTMLLayoutParser::SeekOffset - illegal call" ); sal_uInt16 nPos; sal_Bool bFound = pOffset->Seek_Entry( nOffset, &nPos ); *pCol = static_cast<SCCOL>(nPos); @@ -285,7 +285,7 @@ sal_Bool ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, sal_uInt16 nO void ScHTMLLayoutParser::MakeCol( ScHTMLColOffset* pOffset, sal_uInt16& nOffset, sal_uInt16& nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol ) { - DBG_ASSERT( pOffset, "ScHTMLLayoutParser::MakeCol - illegal call" ); + OSL_ENSURE( pOffset, "ScHTMLLayoutParser::MakeCol - illegal call" ); SCCOL nPos; if ( SeekOffset( pOffset, nOffset, &nPos, nOffsetTol ) ) nOffset = (sal_uInt16)(*pOffset)[nPos]; @@ -304,7 +304,7 @@ void ScHTMLLayoutParser::MakeCol( ScHTMLColOffset* pOffset, sal_uInt16& nOffset, void ScHTMLLayoutParser::MakeColNoRef( ScHTMLColOffset* pOffset, sal_uInt16 nOffset, sal_uInt16 nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol ) { - DBG_ASSERT( pOffset, "ScHTMLLayoutParser::MakeColNoRef - illegal call" ); + OSL_ENSURE( pOffset, "ScHTMLLayoutParser::MakeColNoRef - illegal call" ); SCCOL nPos; if ( SeekOffset( pOffset, nOffset, &nPos, nOffsetTol ) ) nOffset = (sal_uInt16)(*pOffset)[nPos]; @@ -321,7 +321,7 @@ void ScHTMLLayoutParser::MakeColNoRef( ScHTMLColOffset* pOffset, sal_uInt16 nOff void ScHTMLLayoutParser::ModifyOffset( ScHTMLColOffset* pOffset, sal_uInt16& nOldOffset, sal_uInt16& nNewOffset, sal_uInt16 nOffsetTol ) { - DBG_ASSERT( pOffset, "ScHTMLLayoutParser::ModifyOffset - illegal call" ); + OSL_ENSURE( pOffset, "ScHTMLLayoutParser::ModifyOffset - illegal call" ); SCCOL nPos; if ( !SeekOffset( pOffset, nOldOffset, &nPos, nOffsetTol ) ) { @@ -646,7 +646,7 @@ void ScHTMLLayoutParser::SetWidths() if ( pE->nTab == nTable ) { nCol = pE->nCol - nColCntStart; - DBG_ASSERT( nCol < nColsPerRow, "ScHTMLLayoutParser::SetWidths: column overflow" ); + OSL_ENSURE( nCol < nColsPerRow, "ScHTMLLayoutParser::SetWidths: column overflow" ); if ( nCol < nColsPerRow ) { pE->nOffset = pOffsets[nCol]; @@ -676,7 +676,7 @@ void ScHTMLLayoutParser::SetWidths() if ( !pE->nWidth ) { pE->nWidth = GetWidth( pE ); - DBG_ASSERT( pE->nWidth, "SetWidths: pE->nWidth == 0" ); + OSL_ENSURE( pE->nWidth, "SetWidths: pE->nWidth == 0" ); } MakeCol( pColOffset, pE->nOffset, pE->nWidth, nOffsetTolerance, nOffsetTolerance ); } @@ -755,7 +755,7 @@ void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo ) } if ( rSel.nStartPara > rSel.nEndPara ) { // gibt GPF in CreateTextObject - DBG_ERRORFILE( "CloseEntry: EditEngine ESelection Start > End" ); + OSL_FAIL( "CloseEntry: EditEngine ESelection Start > End" ); rSel.nEndPara = rSel.nStartPara; } if ( rSel.HasRange() ) @@ -806,7 +806,7 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) case HTMLIMP_INSERTFIELD: break; default: - DBG_ERRORFILE("HTMLImportHdl: unknown ImportInfo.eState"); + OSL_FAIL("HTMLImportHdl: unknown ImportInfo.eState"); } return 0; } @@ -1279,7 +1279,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) } if ( !pImage->aURL.Len() ) { - DBG_ERRORFILE( "Image: Grafik ohne URL ?!?" ); + OSL_FAIL( "Image: Grafik ohne URL ?!?" ); return ; } @@ -1703,7 +1703,7 @@ void ScHTMLEntry::AdjustStart( const ImportInfo& rInfo ) void ScHTMLEntry::AdjustEnd( const ImportInfo& rInfo ) { - DBG_ASSERT( (aSel.nEndPara < rInfo.aSelection.nEndPara) || + OSL_ENSURE( (aSel.nEndPara < rInfo.aSelection.nEndPara) || ((aSel.nEndPara == rInfo.aSelection.nEndPara) && (aSel.nEndPos <= rInfo.aSelection.nEndPos)), "ScHTMLQueryParser::AdjustEntryEnd - invalid end position" ); // set end position @@ -1954,14 +1954,14 @@ ScHTMLTable* ScHTMLTable::FindNestedTable( ScHTMLTableId nTableId ) const void ScHTMLTable::PutItem( const SfxPoolItem& rItem ) { - DBG_ASSERT( mxCurrEntry.get(), "ScHTMLTable::PutItem - no current entry" ); + OSL_ENSURE( mxCurrEntry.get(), "ScHTMLTable::PutItem - no current entry" ); if( mxCurrEntry.get() && mxCurrEntry->IsEmpty() ) mxCurrEntry->GetItemSet().Put( rItem ); } void ScHTMLTable::PutText( const ImportInfo& rInfo ) { - DBG_ASSERT( mxCurrEntry.get(), "ScHTMLTable::PutText - no current entry" ); + OSL_ENSURE( mxCurrEntry.get(), "ScHTMLTable::PutText - no current entry" ); if( mxCurrEntry.get() ) { if( !mxCurrEntry->HasContents() && IsSpaceCharInfo( rInfo ) ) @@ -2000,7 +2000,7 @@ void ScHTMLTable::InsertLeadingEmptyLine() void ScHTMLTable::AnchorOn() { - DBG_ASSERT( mxCurrEntry.get(), "ScHTMLTable::AnchorOn - no current entry" ); + OSL_ENSURE( mxCurrEntry.get(), "ScHTMLTable::AnchorOn - no current entry" ); // don't skip entries with single hyperlinks if( mxCurrEntry.get() ) mxCurrEntry->SetImportAlways(); @@ -2185,7 +2185,7 @@ void ScHTMLTable::GetDocRange( ScRange& rRange ) const void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos ) const { - DBG_ASSERT( pDoc, "ScHTMLTable::ApplyCellBorders - no document" ); + OSL_ENSURE( pDoc, "ScHTMLTable::ApplyCellBorders - no document" ); if( pDoc && mbBorderOn ) { const SCCOL nLastCol = maSize.mnCols - 1; @@ -2246,7 +2246,7 @@ ScHTMLTable::ScHTMLEntryPtr ScHTMLTable::CreateEntry() const void ScHTMLTable::CreateNewEntry( const ImportInfo& rInfo ) { - DBG_ASSERT( !mxCurrEntry.get(), "ScHTMLTable::CreateNewEntry - old entry still present" ); + OSL_ENSURE( !mxCurrEntry.get(), "ScHTMLTable::CreateNewEntry - old entry still present" ); mxCurrEntry = CreateEntry(); mxCurrEntry->aSel = rInfo.aSelection; } @@ -2281,7 +2281,7 @@ bool ScHTMLTable::PushEntry( ScHTMLEntryPtr& rxEntry ) } else { - DBG_ERRORFILE( "ScHTMLTable::PushEntry - cannot push entry, no parent found" ); + OSL_FAIL( "ScHTMLTable::PushEntry - cannot push entry, no parent found" ); } } return bPushed; @@ -2289,7 +2289,7 @@ bool ScHTMLTable::PushEntry( ScHTMLEntryPtr& rxEntry ) bool ScHTMLTable::PushEntry( const ImportInfo& rInfo, bool bLastInCell ) { - DBG_ASSERT( mxCurrEntry.get(), "ScHTMLTable::PushEntry - no current entry" ); + OSL_ENSURE( mxCurrEntry.get(), "ScHTMLTable::PushEntry - no current entry" ); bool bPushed = false; if( mxCurrEntry.get() ) { @@ -2313,7 +2313,7 @@ bool ScHTMLTable::PushEntry( const ImportInfo& rInfo, bool bLastInCell ) bool ScHTMLTable::PushTableEntry( ScHTMLTableId nTableId ) { - DBG_ASSERT( nTableId != SC_HTML_GLOBAL_TABLE, "ScHTMLTable::PushTableEntry - cannot push global table" ); + OSL_ENSURE( nTableId != SC_HTML_GLOBAL_TABLE, "ScHTMLTable::PushTableEntry - cannot push global table" ); bool bPushed = false; if( nTableId != SC_HTML_GLOBAL_TABLE ) { @@ -2327,7 +2327,7 @@ ScHTMLTable* ScHTMLTable::GetExistingTable( ScHTMLTableId nTableId ) const { ScHTMLTable* pTable = ((nTableId != SC_HTML_GLOBAL_TABLE) && mxNestedTables.get()) ? mxNestedTables->FindTable( nTableId, false ) : 0; - DBG_ASSERT( pTable || (nTableId == SC_HTML_GLOBAL_TABLE), "ScHTMLTable::GetExistingTable - table not found" ); + OSL_ENSURE( pTable || (nTableId == SC_HTML_GLOBAL_TABLE), "ScHTMLTable::GetExistingTable - table not found" ); return pTable; } @@ -2483,7 +2483,7 @@ void ScHTMLTable::ProcessFormatOptions( SfxItemSet& rItemSet, const ImportInfo& void ScHTMLTable::SetDocSize( ScHTMLOrient eOrient, SCCOLROW nCellPos, SCCOLROW nSize ) { - DBG_ASSERT( nCellPos >= 0, "ScHTMLTable::SetDocSize - unexpected negative position" ); + OSL_ENSURE( nCellPos >= 0, "ScHTMLTable::SetDocSize - unexpected negative position" ); ScSizeVec& rSizes = maCumSizes[ eOrient ]; size_t nIndex = static_cast< size_t >( nCellPos ); // expand with height/width == 1 @@ -2988,7 +2988,7 @@ IMPL_LINK( ScHTMLQueryParser, HTMLImportHdl, const ImportInfo*, pInfo ) break; default: - DBG_ERRORFILE( "ScHTMLQueryParser::HTMLImportHdl - unknown ImportInfo::eState" ); + OSL_FAIL( "ScHTMLQueryParser::HTMLImportHdl - unknown ImportInfo::eState" ); } return 0; } diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx index 36b8c873f213..a33d411e19bb 100644 --- a/sc/source/filter/inc/fapihelper.hxx +++ b/sc/source/filter/inc/fapihelper.hxx @@ -112,7 +112,7 @@ public: template< typename Type > ::com::sun::star::uno::Sequence< Type > ScfApiHelper::VectorToSequence( const ::std::vector< Type >& rVector ) { - DBG_ASSERT( !rVector.empty(), "ScfApiHelper::VectorToSequence - vector is empty" ); + OSL_ENSURE( !rVector.empty(), "ScfApiHelper::VectorToSequence - vector is empty" ); return ::com::sun::star::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) ); } diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx index 1a6619c73f9f..54d4f8799e09 100644 --- a/sc/source/filter/inc/namebuff.hxx +++ b/sc/source/filter/inc/namebuff.hxx @@ -156,7 +156,7 @@ inline const String* NameBuffer::Get( sal_uInt16 n ) inline sal_uInt16 NameBuffer::GetLastIndex( void ) { - DBG_ASSERT( Count() + nBase <= 0xFFFF, "*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" ); + OSL_ENSURE( Count() + nBase <= 0xFFFF, "*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" ); return ( sal_uInt16 ) ( Count() + nBase ); } diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx index 56b7c017dcfa..6d8c60a88733 100644 --- a/sc/source/filter/inc/tokstack.hxx +++ b/sc/source/filter/inc/tokstack.hxx @@ -257,7 +257,7 @@ class TokenStack inline const TokenId TokenStack::Get( void ) { - DBG_ASSERT( nPos > 0, + OSL_ENSURE( nPos > 0, "*TokenStack::Get(): Leer ist leer, ist leer, ist leer, ist..." ); TokenId nRet; @@ -276,7 +276,7 @@ inline const TokenId TokenStack::Get( void ) inline TokenStack &TokenStack::operator <<( const TokenId nNewId ) {// Element auf Stack - DBG_ASSERT( nPos < nSize, "*TokenStack::<<(): Stackueberlauf" ); + OSL_ENSURE( nPos < nSize, "*TokenStack::<<(): Stackueberlauf" ); if( nPos < nSize ) { pStack[ nPos ] = nNewId; @@ -289,7 +289,7 @@ inline TokenStack &TokenStack::operator <<( const TokenId nNewId ) inline void TokenStack::operator >>( TokenId& rId ) {// Element von Stack - DBG_ASSERT( nPos > 0, + OSL_ENSURE( nPos > 0, "*TokenStack::>>(): Leer ist leer, ist leer, ist leer, ..." ); if( nPos > 0 ) { @@ -312,7 +312,7 @@ inline TokenPool& TokenPool::operator <<( const TokenId nId ) // POST: nId's werden hintereinander im Pool unter einer neuen Id // abgelegt. Vorgang wird mit >> oder Store() abgeschlossen // nId -> ( sal_uInt16 ) nId - 1; - DBG_ASSERT( ( sal_uInt16 ) nId < nScTokenOff, + OSL_ENSURE( ( sal_uInt16 ) nId < nScTokenOff, "-TokenPool::operator <<: TokenId im DefToken-Bereich!" ); if( nP_IdAkt >= nP_Id ) @@ -327,7 +327,7 @@ inline TokenPool& TokenPool::operator <<( const TokenId nId ) inline TokenPool& TokenPool::operator <<( const DefTokenId eId ) { - DBG_ASSERT( ( sal_uInt32 ) eId + nScTokenOff < 0xFFFF, + OSL_ENSURE( ( sal_uInt32 ) eId + nScTokenOff < 0xFFFF, "-TokenPool::operator<<: enmum zu gross!" ); if( nP_IdAkt >= nP_Id ) diff --git a/sc/source/filter/inc/tool.h b/sc/source/filter/inc/tool.h index 8b0aac6a05d8..462c97179ca9 100644 --- a/sc/source/filter/inc/tool.h +++ b/sc/source/filter/inc/tool.h @@ -144,14 +144,14 @@ inline const SfxUInt32Item* FormCache::GetAttr( sal_uInt8 nFormat, sal_uInt8 nSt aCompareIdent.SetStamp( nFormat, nSt ); nIndex = aCompareIdent.GetStamp(); - DBG_ASSERT( nIndex < __nSize, "FormCache::GetAttr(): Uuuuuuups... so nicht!" ); + OSL_ENSURE( nIndex < __nSize, "FormCache::GetAttr(): Uuuuuuups... so nicht!" ); if( bValid[ nIndex ] ) pRet = aIdents[ nIndex ].GetAttr(); else { // neues Attribut anlegen pAttr = NewAttr( nFormat, nSt ); - DBG_ASSERT( pAttr, "FormCache::GetAttr(): Nix Speicherus" ); + OSL_ENSURE( pAttr, "FormCache::GetAttr(): Nix Speicherus" ); aIdents[ nIndex ] = FormIdent( nFormat, nSt, *pAttr ); bValid[ nIndex ] = sal_True; diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx index 1f9cf30909e9..3a9e6e7972c4 100644 --- a/sc/source/filter/inc/xlformula.hxx +++ b/sc/source/filter/inc/xlformula.hxx @@ -553,14 +553,14 @@ public: inline sal_uInt8 XclTokenArrayHelper::GetTokenId( sal_uInt8 nBaseId, sal_uInt8 nTokenClass ) { - DBG_ASSERT( !::get_flag( nBaseId, static_cast< sal_uInt8 >( ~EXC_TOKID_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token ID" ); - DBG_ASSERT( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token class" ); + OSL_ENSURE( !::get_flag( nBaseId, static_cast< sal_uInt8 >( ~EXC_TOKID_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token ID" ); + OSL_ENSURE( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::GetTokenId - invalid token class" ); return nBaseId | nTokenClass; } inline void XclTokenArrayHelper::ChangeTokenClass( sal_uInt8& rnTokenId, sal_uInt8 nTokenClass ) { - DBG_ASSERT( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::ChangeTokenClass - invalid token class" ); + OSL_ENSURE( !::get_flag( nTokenClass, static_cast< sal_uInt8 >( ~EXC_TOKCLASS_MASK ) ), "XclTokenArrayHelper::ChangeTokenClass - invalid token class" ); ::set_flag( rnTokenId, EXC_TOKCLASS_MASK, false ); ::set_flag( rnTokenId, nTokenClass ); } diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx index e9e306e2f1c6..9edd3f603b52 100644 --- a/sc/source/filter/inc/xltools.hxx +++ b/sc/source/filter/inc/xltools.hxx @@ -37,8 +37,8 @@ class SfxObjectShell; // BIFF versions ============================================================== -#define DBG_ERROR_BIFF() DBG_ERRORFILE( "Unknown BIFF type!" ) -#define DBG_ASSERT_BIFF( c ) DBG_ASSERT( c, "Unknown BIFF type!" ) +#define DBG_ERROR_BIFF() OSL_FAIL( "Unknown BIFF type!" ) +#define OSL_ENSURE_BIFF( c ) OSL_ENSURE( c, "Unknown BIFF type!" ) // Enumerations =============================================================== diff --git a/sc/source/filter/lotus/expop.cxx b/sc/source/filter/lotus/expop.cxx index e1bd599c29cd..1f89745c5159 100644 --- a/sc/source/filter/lotus/expop.cxx +++ b/sc/source/filter/lotus/expop.cxx @@ -102,8 +102,8 @@ inline void ExportWK1::Dimensions() #endif sal_uInt16 nCol = static_cast<sal_uInt16>(nEndCol); sal_uInt16 nRow = static_cast<sal_uInt16>(nEndRow); - DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Dimensions(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Dimensions(): Row > WK1MAXROW" ); + OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Dimensions(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Dimensions(): Row > WK1MAXROW" ); aOut << nCol << nRow; // Ending Col/Row } @@ -143,8 +143,8 @@ inline void ExportWK1::Colw() void ExportWK1::Blank( const sal_uInt16 nCol, const sal_uInt16 nRow, const ScPatternAttr& aAttr ) { // (0x0C) // PREC: nCol <= WK1MAXCOL, nRow <= WK1MAXROW - DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Blank(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Blank(): Row > WK1MAXROW" ); + OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Blank(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Blank(): Row > WK1MAXROW" ); aOut << ( sal_uInt16 ) 0x0C << ( sal_uInt16 ) 5 << GenFormByte( aAttr ) << nCol << nRow; } @@ -153,8 +153,8 @@ void ExportWK1::Blank( const sal_uInt16 nCol, const sal_uInt16 nRow, const ScPat void ExportWK1::Number( const sal_uInt16 nCol, const sal_uInt16 nRow, const double fWert, const ScPatternAttr &aAttr ) { // (0x0E) // PREC: nCol <= WK1MAXCOL, nRow <= WK1MAXROW - DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Number(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Number(): Row > WK1MAXROW" ); + OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Number(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Number(): Row > WK1MAXROW" ); aOut << ( sal_uInt16 ) 0x0E << ( sal_uInt16 ) 13 << GenFormByte( aAttr ) << nCol << nRow << fWert; } @@ -163,8 +163,8 @@ void ExportWK1::Number( const sal_uInt16 nCol, const sal_uInt16 nRow, const doub void ExportWK1::Label( const sal_uInt16 nCol, const sal_uInt16 nRow, const String& rStr, const ScPatternAttr& aAttr ) { // (0x0F) // PREC: nCol <= WK1MAXCOL, nRow <= WK1MAXROW - DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Label(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Label(): Row > WK1MAXROW" ); + OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Label(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Label(): Row > WK1MAXROW" ); ByteString aStr( rStr, eZielChar ); @@ -190,8 +190,8 @@ void ExportWK1::Label( const sal_uInt16 nCol, const sal_uInt16 nRow, const Strin void ExportWK1::Formula( const sal_uInt16 nCol, const sal_uInt16 nRow, const ScFormulaCell* pFC, const ScPatternAttr& aAttr ) { // (0x10) // PREC: nCol <= WK1MAXCOL, nRow <= WK1MAXROW - DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Formula(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Formula(): Row > WK1MAXROW" ); + OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Formula(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Formula(): Row > WK1MAXROW" ); sal_uInt16 nLaenge = 15; // Bytes bis Formel double fErgebnis; @@ -269,8 +269,8 @@ inline void ExportWK1::Cursorw12() void ExportWK1::WKString( const sal_uInt16 /*nCol*/, const sal_uInt16 /*nRow*/, const ScFormulaCell* /*pFC*/, const ScPatternAttr& /*aAttr*/ ) { // (0x33) // PREC: nCol <= WK1MAXCOL, nRow <= WK1MAXROW -/* DBG_ASSERT( nCol <= WK1MAXCOL, "ExportWK1::Label(): Col > WK1MAXCOL" ); - DBG_ASSERT( nRow <= WK1MAXROW, "ExportWK1::Label(): Row > WK1MAXROW" ); +/* OSL_ENSURE( nCol <= WK1MAXCOL, "ExportWK1::Label(): Col > WK1MAXCOL" ); + OSL_ENSURE( nRow <= WK1MAXROW, "ExportWK1::Label(): Row > WK1MAXROW" ); String aStr; ( ( ScFormulaCell * ) pFC )->GetString( aStr ); // Formeltext zunaechst so belassen @@ -399,7 +399,7 @@ FltError ExportWK1::Write() case CELLTYPE_NONE: break; default: - DBG_ASSERT( false, "ExportWK1::Write(): unbekannter Celltype!" ); + OSL_ENSURE( false, "ExportWK1::Write(): unbekannter Celltype!" ); } } while( aIter.GetNext() ); diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx index 6e1a8519c1a6..e997c0df7f0a 100644 --- a/sc/source/filter/lotus/lotattr.cxx +++ b/sc/source/filter/lotus/lotattr.cxx @@ -189,7 +189,7 @@ void LotAttrCache::LotusToScBorderLine( sal_uInt8 nLine, ::editeng::SvxBorderLin const SvxColorItem& LotAttrCache::GetColorItem( const sal_uInt8 nLotIndex ) const { - DBG_ASSERT( nLotIndex > 0 && nLotIndex < 7, + OSL_ENSURE( nLotIndex > 0 && nLotIndex < 7, "-LotAttrCache::GetColorItem(): so nicht!" ); return *ppColorItems[ nLotIndex - 1 ]; @@ -198,14 +198,14 @@ const SvxColorItem& LotAttrCache::GetColorItem( const sal_uInt8 nLotIndex ) cons const Color& LotAttrCache::GetColor( const sal_uInt8 nLotIndex ) const { // Farbe <-> Index passt fuer Background, nicht aber fuer Fonts (0 <-> 7)! - DBG_ASSERT( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7!" ); + OSL_ENSURE( nLotIndex < 8, "*LotAttrCache::GetColor(): Index > 7!" ); return pColTab[ nLotIndex ]; } void LotAttrCol::SetAttr( const SCROW nRow, const ScPatternAttr& rAttr ) { - DBG_ASSERT( ValidRow(nRow), "*LotAttrCol::SetAttr(): ... und rums?!" ); + OSL_ENSURE( ValidRow(nRow), "*LotAttrCol::SetAttr(): ... und rums?!" ); boost::ptr_vector<ENTRY>::reverse_iterator iterLast = aEntries.rbegin(); diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx index 589b291864cb..0869a2309b51 100644 --- a/sc/source/filter/lotus/lotform.cxx +++ b/sc/source/filter/lotus/lotform.cxx @@ -62,7 +62,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri sal_Bool bAddIn = false; sal_Bool bNeg = false; - DBG_ASSERT( nAnz < 128, "-LotusToSc::DoFunc(): Neee! -so viel kann ich nicht!" ); + OSL_ENSURE( nAnz < 128, "-LotusToSc::DoFunc(): Neee! -so viel kann ich nicht!" ); if( eOc == ocNoName ) { @@ -103,7 +103,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri switch( eOc ) { case ocIndex: - DBG_ASSERT( nAnz > 2, "+LotusToSc::DoFunc(): ocIndex braucht mind. 2 Parameter!" ); + OSL_ENSURE( nAnz > 2, "+LotusToSc::DoFunc(): ocIndex braucht mind. 2 Parameter!" ); nMerk0 = eParam[ 0 ]; eParam[ 0 ] = eParam[ 1 ]; eParam[ 1 ] = nMerk0; @@ -112,7 +112,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri break; case ocIRR: { - DBG_ASSERT( nAnz == 2, "+LotusToSc::DoFunc(): ocIRR hat nur 2 Parameter!" ); + OSL_ENSURE( nAnz == 2, "+LotusToSc::DoFunc(): ocIRR hat nur 2 Parameter!" ); nMerk0 = eParam[ 0 ]; eParam[ 0 ] = eParam[ 1 ]; eParam[ 1 ] = nMerk0; @@ -145,7 +145,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri case ocZins: { // neue Anzahl = 4! - DBG_ASSERT( nAnz == 3, + OSL_ENSURE( nAnz == 3, "*LotusToSc::DoFunc(): ZINS() hat 3 Parameter!" ); nAnz = 4; eParam[ 3 ] = eParam[ 0 ]; // 3. -> 1. @@ -173,7 +173,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri if( eOc == ocRMZ ) { // Extrawurst ocRMZ letzter Parameter negiert! // zusaetzlich: 1. -> 3., 3. -> 2., 2. -> 1. - DBG_ASSERT( nAnz == 3, + OSL_ENSURE( nAnz == 3, "+LotusToSc::DoFunc(): ocRMZ hat genau 3 Parameter!" ); aPool << eParam[ 1 ] << ocSep << eParam[ 0 ] << ocSep << ocNegSub << eParam[ 2 ]; @@ -654,8 +654,8 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest, rpErg = aPool[ aStack.Get() ]; - DBG_ASSERT( nBytesLeft >= 0, "*LotusToSc::Convert(): zuviel verarbeitet!"); - DBG_ASSERT( nBytesLeft <= 0, "*LotusToSc::Convert(): wat is mit'm Rest?" ); + OSL_ENSURE( nBytesLeft >= 0, "*LotusToSc::Convert(): zuviel verarbeitet!"); + OSL_ENSURE( nBytesLeft <= 0, "*LotusToSc::Convert(): wat is mit'm Rest?" ); if( rRest ) aIn.SeekRel( nBytesLeft ); // eventuellen Rest/Ueberlauf korrigieren diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx index 150fee171646..4c32b0f5e404 100644 --- a/sc/source/filter/lotus/lotimpop.cxx +++ b/sc/source/filter/lotus/lotimpop.cxx @@ -131,7 +131,7 @@ sal_Bool ImportLotus::BofFm3( void ) void ImportLotus::Columnwidth( sal_uInt16 nRecLen ) { - DBG_ASSERT( nRecLen >= 4, "*ImportLotus::Columnwidth(): Record zu kurz!" ); + OSL_ENSURE( nRecLen >= 4, "*ImportLotus::Columnwidth(): Record zu kurz!" ); sal_uInt8 nLTab, nWindow2; sal_uInt16 nCnt = ( nRecLen - 4 ) / 2; @@ -163,7 +163,7 @@ void ImportLotus::Columnwidth( sal_uInt16 nRecLen ) void ImportLotus::Hiddencolumn( sal_uInt16 nRecLen ) { - DBG_ASSERT( nRecLen >= 4, "*ImportLotus::Hiddencolumn(): Record zu kurz!" ); + OSL_ENSURE( nRecLen >= 4, "*ImportLotus::Hiddencolumn(): Record zu kurz!" ); sal_uInt8 nLTab, nWindow2; sal_uInt16 nCnt = ( nRecLen - 4 ) / 2; @@ -271,7 +271,7 @@ void ImportLotus::Smallnumcell( void ) ScFormulaCell *ImportLotus::Formulacell( sal_uInt16 n ) { - DBG_ASSERT( pIn, "-ImportLotus::Formulacell(): Null-Stream -> Rums!" ); + OSL_ENSURE( pIn, "-ImportLotus::Formulacell(): Null-Stream -> Rums!" ); ScAddress aAddr; @@ -305,7 +305,7 @@ void ImportLotus::Read( String &r ) void ImportLotus::RowPresentation( sal_uInt16 nRecLen ) { - DBG_ASSERT( nRecLen > 4, "*ImportLotus::RowPresentation(): Record zu kurz!" ); + OSL_ENSURE( nRecLen > 4, "*ImportLotus::RowPresentation(): Record zu kurz!" ); sal_uInt8 nLTab, nFlags; sal_uInt16 nRow, nHeight; @@ -401,7 +401,7 @@ void ImportLotus::Font_Ysize( void ) void ImportLotus::_Row( const sal_uInt16 nRecLen ) { - DBG_ASSERT( nExtTab >= 0, "*ImportLotus::_Row(): Kann hier nicht sein!" ); + OSL_ENSURE( nExtTab >= 0, "*ImportLotus::_Row(): Kann hier nicht sein!" ); sal_uInt16 nRow; sal_uInt16 nHeight; diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx index 84cb8df148ba..fbc0532ed4c2 100644 --- a/sc/source/filter/lotus/lotread.cxx +++ b/sc/source/filter/lotus/lotread.cxx @@ -202,7 +202,7 @@ FltError ImportLotus::Read() #endif } - DBG_ASSERT( nNextRec >= pIn->Tell(), + OSL_ENSURE( nNextRec >= pIn->Tell(), "*ImportLotus::Read(): Etwas zu gierig..." ); pIn->Seek( nNextRec ); @@ -224,7 +224,7 @@ FltError ImportLotus::Read() } for( nCnt = 1 ; nCnt < nTabs ; nCnt++ ) { - DBG_ASSERT( pD->HasTable( nCnt ), + OSL_ENSURE( pD->HasTable( nCnt ), "-ImportLotus::Read(): Wo ist meine Tabelle?!" ); pD->GetName( nCnt, aTabName ); if( aTabName == aRef ) @@ -282,7 +282,7 @@ FltError ImportLotus::Read( SvStream& rIn ) case 0x0001: // EOF bRead = false; - DBG_ASSERT( nTab == 0, + OSL_ENSURE( nTab == 0, "-ImportLotus::Read( SvStream& ): Zweimal EOF nicht erlaubt" ); nTab++; break; @@ -309,7 +309,7 @@ FltError ImportLotus::Read( SvStream& rIn ) break; } - DBG_ASSERT( nNextRec >= pIn->Tell(), + OSL_ENSURE( nNextRec >= pIn->Tell(), "*ImportLotus::Read(): Etwas zu gierig..." ); pIn->Seek( nNextRec ); aPrgrsBar.Progress(); diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx index f0a69cae3358..c9c6ae13ec38 100644 --- a/sc/source/filter/lotus/op.cxx +++ b/sc/source/filter/lotus/op.cxx @@ -647,7 +647,7 @@ void OP_ApplyPatternArea123( SvStream& rStream ) std::map<sal_uInt16, ScPatternAttr>::iterator loc = aLotusPatternPool.find( nData ); // apparently, files with invalid index occur in the wild -> don't crash then - DBG_ASSERT( loc != aLotusPatternPool.end(), "invalid format index" ); + OSL_ENSURE( loc != aLotusPatternPool.end(), "invalid format index" ); if ( loc != aLotusPatternPool.end() ) pDoc->ApplyPatternAreaTab( nCol, nRow, nCol + nColCount - 1, nRow + nRowCount - 1, static_cast< SCTAB >( nTab + i ), loc->second ); } diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index 3688066fcb6a..3084f75e02c7 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -87,7 +87,7 @@ SCROW LotusRangeList::nEingRow; void PutFormString( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Char* pString ) { // Label-Format-Auswertung - DBG_ASSERT( pString != NULL, "PutFormString(): pString == NULL" ); + OSL_ENSURE( pString != NULL, "PutFormString(): pString == NULL" ); sal_Char cForm; SvxHorJustifyItem* pJustify = NULL; @@ -490,7 +490,7 @@ LR_ID LotusRangeList::GetIndex( const LotusRange &rRef ) void LotusRangeList::Append( LotusRange* pLR, const String& rName ) { - DBG_ASSERT( pLR, "*LotusRangeList::Append(): das wird nichts!" ); + OSL_ENSURE( pLR, "*LotusRangeList::Append(): das wird nichts!" ); List::Insert( pLR, CONTAINER_APPEND ); ScTokenArray aTokArray; diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index ec01c82efce1..75c2489a2eb0 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -373,7 +373,7 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor, sal_uInt32 nNewIndex = pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, LANGUAGE_SYSTEM); - DBG_ASSERT( nNewIndex != nIndex, "ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?"); + OSL_ENSURE( nNewIndex != nIndex, "ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?"); pFormatter->GetInputLineString( fEnVal, nNewIndex, aStr); } pFormatter->ChangeIntl( LANGUAGE_SYSTEM); diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index d22e8aa4be5e..c6b032f178b0 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -224,7 +224,7 @@ IMPL_LINK( ScRTFParser, RTFImportHdl, ImportInfo*, pInfo ) case RTFIMP_INSERTPARA: break; default: - DBG_ERRORFILE("unknown ImportInfo.eState"); + OSL_FAIL("unknown ImportInfo.eState"); } return 0; } @@ -266,7 +266,7 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ ) } pDefMerge = NULL; pActDefault = &(pDefaultList->front()); - DBG_ASSERT( pActDefault, "NewCellRow: pActDefault==0" ); + OSL_ENSURE( pActDefault, "NewCellRow: pActDefault==0" ); } @@ -325,7 +325,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo ) && !(pDefaultList->empty()) ) pDefMerge = &( pDefaultList->back() ); - DBG_ASSERT( pDefMerge, "RTF_CLMRG: pDefMerge==0" ); + OSL_ENSURE( pDefMerge, "RTF_CLMRG: pDefMerge==0" ); if ( pDefMerge ) // sonst rottes RTF pDefMerge->nColOverlap++; // mehrere nacheinander moeglich pInsDefault->nColOverlap = 0; // Flag: ignoriere diese @@ -358,7 +358,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo ) break; case RTF_CELL: // denotes the end of a cell. { - DBG_ASSERT( pActDefault, "RTF_CELL: pActDefault==0" ); + OSL_ENSURE( pActDefault, "RTF_CELL: pActDefault==0" ); if ( bNewDef || !pActDefault ) NewCellRow( pInfo ); // davor war kein \intbl, bad behavior // rottes RTF? retten was zu retten ist diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index a73936399948..3563f9a9d117 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -969,7 +969,7 @@ Sc10Import::~Sc10Import() delete pPatternCollection; delete pDataBaseCollection; - DBG_ASSERT( pPrgrsBar == NULL, + OSL_ENSURE( pPrgrsBar == NULL, "*Sc10Import::Sc10Import(): Progressbar lebt noch!?" ); } @@ -1585,7 +1585,7 @@ void Sc10Import::LoadTables() if ((Count != 0) && (nError == 0)) LoadCol(Col, static_cast<SCTAB> (TabNo)); } - DBG_ASSERT( nError == 0, "Stream" ); + OSL_ENSURE( nError == 0, "Stream" ); } pPrgrsBar->Progress(); diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx index e1fc11a68719..4c1dd04aeee5 100644 --- a/sc/source/filter/starcalc/scfobj.cxx +++ b/sc/source/filter/starcalc/scfobj.cxx @@ -78,11 +78,11 @@ void Sc10InsertObject::InsertChart( ScDocument* pDoc, SCTAB nDestTab, const Rect { pDoc->InitDrawLayer(); pModel = pDoc->GetDrawLayer(); - DBG_ASSERT(pModel,"Draw Layer ?"); + OSL_ENSURE(pModel,"Draw Layer ?"); } SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nDestTab)); - DBG_ASSERT(pPage,"Page ?"); + OSL_ENSURE(pPage,"Page ?"); pPage->InsertObject(pSdrOle2Obj); pSdrOle2Obj->SetLogicRect(rRect); // erst nach InsertObject !!! diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index cab208e7dc21..e92f8ec89df6 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -88,7 +88,7 @@ void lcl_WriteDateTime( XclExpStream& rStrm, const DateTime& rDateTime ) void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal_Size nLength ) { sal_Size nStrBytes = rString.GetBufferSize(); - DBG_ASSERT( nLength >= nStrBytes, "lcl_WriteFixedString - String too long" ); + OSL_ENSURE( nLength >= nStrBytes, "lcl_WriteFixedString - String too long" ); if( rString.Len() > 0 ) rStrm << rString; if( nLength > nStrBytes ) @@ -489,7 +489,7 @@ XclExpChTrTabIdBuffer::~XclExpChTrTabIdBuffer() void XclExpChTrTabIdBuffer::InitFill( sal_uInt16 nIndex ) { - DBG_ASSERT( nIndex < nLastId, "XclExpChTrTabIdBuffer::Insert - out of range" ); + OSL_ENSURE( nIndex < nLastId, "XclExpChTrTabIdBuffer::Insert - out of range" ); sal_uInt16 nFreeCount = 0; for( sal_uInt16* pElem = pBuffer; pElem <= pLast; pElem++ ) @@ -515,13 +515,13 @@ void XclExpChTrTabIdBuffer::InitFillup() sal_uInt16 XclExpChTrTabIdBuffer::GetId( sal_uInt16 nIndex ) const { - DBG_ASSERT( nIndex < nBufSize, "XclExpChTrTabIdBuffer::GetId - out of range" ); + OSL_ENSURE( nIndex < nBufSize, "XclExpChTrTabIdBuffer::GetId - out of range" ); return pBuffer[ nIndex ]; } void XclExpChTrTabIdBuffer::Remove() { - DBG_ASSERT( pBuffer <= pLast, "XclExpChTrTabIdBuffer::Remove - buffer empty" ); + OSL_ENSURE( pBuffer <= pLast, "XclExpChTrTabIdBuffer::Remove - buffer empty" ); sal_uInt16* pElem = pBuffer; while( (pElem <= pLast) && (*pElem != nLastId) ) pElem++; @@ -681,7 +681,7 @@ void XclExpChTrAction::SetIndex( sal_uInt32& rIndex ) void XclExpChTrAction::SaveCont( XclExpStream& rStrm ) { - DBG_ASSERT( nOpCode != EXC_CHTR_OP_UNKNOWN, "XclExpChTrAction::SaveCont - unknown action" ); + OSL_ENSURE( nOpCode != EXC_CHTR_OP_UNKNOWN, "XclExpChTrAction::SaveCont - unknown action" ); rStrm << nLength << nIndex << nOpCode @@ -742,7 +742,7 @@ void XclExpChTrData::Clear() void XclExpChTrData::WriteFormula( XclExpStream& rStrm, const XclExpChTrTabIdBuffer& rTabIdBuffer ) { - DBG_ASSERT( mxTokArr && !mxTokArr->Empty(), "XclExpChTrData::Write - no formula" ); + OSL_ENSURE( mxTokArr && !mxTokArr->Empty(), "XclExpChTrData::Write - no formula" ); rStrm << *mxTokArr; for( XclExpRefLog::const_iterator aIt = maRefLog.begin(), aEnd = maRefLog.end(); aIt != aEnd; ++aIt ) @@ -778,7 +778,7 @@ void XclExpChTrData::Write( XclExpStream& rStrm, const XclExpChTrTabIdBuffer& rT rStrm << fValue; break; case EXC_CHTR_TYPE_STRING: - DBG_ASSERT( pString, "XclExpChTrData::Write - no string" ); + OSL_ENSURE( pString, "XclExpChTrData::Write - no string" ); rStrm << *pString; break; case EXC_CHTR_TYPE_FORMULA: @@ -1342,7 +1342,7 @@ XclExpChTrActionStack::~XclExpChTrActionStack() void XclExpChTrActionStack::Push( XclExpChTrAction* pNewRec ) { - DBG_ASSERT( pNewRec, "XclExpChTrActionStack::Push - NULL pointer" ); + OSL_ENSURE( pNewRec, "XclExpChTrActionStack::Push - NULL pointer" ); if( pNewRec ) Stack::Push( pNewRec ); } @@ -1357,7 +1357,7 @@ XclExpChTrRecordList::~XclExpChTrRecordList() void XclExpChTrRecordList::Append( ExcRecord* pNewRec ) { - DBG_ASSERT( pNewRec, "XclExpChTrRecordList::Append - NULL pointer" ); + OSL_ENSURE( pNewRec, "XclExpChTrRecordList::Append - NULL pointer" ); if( pNewRec ) List::Insert( pNewRec, LIST_APPEND ); } @@ -1472,7 +1472,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : pHeader( NULL ), bValidGUID( false ) { - DBG_ASSERT( GetOldRoot().pTabId, "XclExpChangeTrack::XclExpChangeTrack - root data incomplete" ); + OSL_ENSURE( GetOldRoot().pTabId, "XclExpChangeTrack::XclExpChangeTrack - root data incomplete" ); if( !GetOldRoot().pTabId ) return; @@ -1564,13 +1564,13 @@ ScChangeTrack* XclExpChangeTrack::CreateTempChangeTrack() { // get original change track ScChangeTrack* pOrigChangeTrack = GetDoc().GetChangeTrack(); - DBG_ASSERT( pOrigChangeTrack, "XclExpChangeTrack::CreateTempChangeTrack - no change track data" ); + OSL_ENSURE( pOrigChangeTrack, "XclExpChangeTrack::CreateTempChangeTrack - no change track data" ); if( !pOrigChangeTrack ) return NULL; // create empty document pTempDoc = new ScDocument; - DBG_ASSERT( pTempDoc, "XclExpChangeTrack::CreateTempChangeTrack - no temp document" ); + OSL_ENSURE( pTempDoc, "XclExpChangeTrack::CreateTempChangeTrack - no temp document" ); if( !pTempDoc ) return NULL; @@ -1582,7 +1582,7 @@ ScChangeTrack* XclExpChangeTrack::CreateTempChangeTrack() pTempDoc->CreateValidTabName( sTabName ); pTempDoc->InsertTab( SC_TAB_APPEND, sTabName ); } - DBG_ASSERT( nOrigCount == pTempDoc->GetTableCount(), + OSL_ENSURE( nOrigCount == pTempDoc->GetTableCount(), "XclExpChangeTrack::CreateTempChangeTrack - table count mismatch" ); if( nOrigCount != pTempDoc->GetTableCount() ) return false; @@ -1629,7 +1629,7 @@ sal_Bool XclExpChangeTrack::WriteUserNamesStream() { sal_Bool bRet = false; SotStorageStreamRef xSvStrm = OpenStream( EXC_STREAM_USERNAMES ); - DBG_ASSERT( xSvStrm.Is(), "XclExpChangeTrack::WriteUserNamesStream - no stream" ); + OSL_ENSURE( xSvStrm.Is(), "XclExpChangeTrack::WriteUserNamesStream - no stream" ); if( xSvStrm.Is() ) { XclExpStream aXclStrm( *xSvStrm, GetRoot() ); @@ -1651,7 +1651,7 @@ void XclExpChangeTrack::Write() if( WriteUserNamesStream() ) { SotStorageStreamRef xSvStrm = OpenStream( EXC_STREAM_REVLOG ); - DBG_ASSERT( xSvStrm.Is(), "XclExpChangeTrack::Write - no stream" ); + OSL_ENSURE( xSvStrm.Is(), "XclExpChangeTrack::Write - no stream" ); if( xSvStrm.Is() ) { XclExpStream aXclStrm( *xSvStrm, GetRoot(), EXC_MAXRECSIZE_BIFF8 + 8 ); diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 7cf584f317b0..ece66ac49b7e 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -343,7 +343,7 @@ void XclImpChangeTrack::ReadChTrCellContent() Read2DAddress( aPosition ); sal_uInt16 nOldSize; *pStrm >> nOldSize; - DBG_ASSERT( (nOldSize == 0) == (nOldValueType == EXC_CHTR_TYPE_EMPTY), + OSL_ENSURE( (nOldSize == 0) == (nOldValueType == EXC_CHTR_TYPE_EMPTY), "XclImpChangeTrack::ReadChTrCellContent - old value mismatch" ); pStrm->Ignore( 4 ); switch( nValueType & EXC_CHTR_TYPE_FORMATMASK ) @@ -425,14 +425,14 @@ void XclImpChangeTrack::ReadChTrInsertTab() void XclImpChangeTrack::InitNestedMode() { - DBG_ASSERT( eNestedMode == nmBase, "XclImpChangeTrack::InitNestedMode - unexpected nested mode" ); + OSL_ENSURE( eNestedMode == nmBase, "XclImpChangeTrack::InitNestedMode - unexpected nested mode" ); if( eNestedMode == nmBase ) eNestedMode = nmFound; } void XclImpChangeTrack::ReadNestedRecords() { - DBG_ASSERT( eNestedMode == nmFound, "XclImpChangeTrack::StartNestedMode - missing nested mode" ); + OSL_ENSURE( eNestedMode == nmFound, "XclImpChangeTrack::StartNestedMode - missing nested mode" ); if( eNestedMode == nmFound ) { eNestedMode = nmNested; @@ -442,7 +442,7 @@ void XclImpChangeTrack::ReadNestedRecords() sal_Bool XclImpChangeTrack::EndNestedMode() { - DBG_ASSERT( eNestedMode != nmBase, "XclImpChangeTrack::EndNestedMode - missing nested mode" ); + OSL_ENSURE( eNestedMode != nmBase, "XclImpChangeTrack::EndNestedMode - missing nested mode" ); sal_Bool bReturn = (eNestedMode == nmNested); eNestedMode = nmBase; return bReturn; diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index 75bb0335f9d6..7b83846e015b 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -117,7 +117,7 @@ XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, XclExpObjectManager& rObjMgr, XclEscherEx::~XclEscherEx() { - DBG_ASSERT( !aStack.Count(), "~XclEscherEx: stack not empty" ); + OSL_ENSURE( !aStack.Count(), "~XclEscherEx: stack not empty" ); DeleteCurrAppData(); delete pTheClientData; } @@ -329,7 +329,7 @@ void XclEscherEx::EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID ) if( nShapeID == 0 ) { XclObj* pLastObj = mrObjMgr.RemoveLastObj(); - DBG_ASSERT( pLastObj == pCurrXclObj, "XclEscherEx::EndShape - wrong object" ); + OSL_ENSURE( pLastObj == pCurrXclObj, "XclEscherEx::EndShape - wrong object" ); DELETEZ( pLastObj ); pCurrXclObj = 0; } diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index d26cc995b1d0..cef621bd8330 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -126,7 +126,7 @@ XclExpObjList::~XclExpObjList() sal_uInt16 XclExpObjList::Add( XclObj* pObj ) { - DBG_ASSERT( Count() < 0xFFFF, "XclExpObjList::Add: too much for Xcl" ); + OSL_ENSURE( Count() < 0xFFFF, "XclExpObjList::Add: too much for Xcl" ); if ( Count() < 0xFFFF ) { Insert( pObj, LIST_APPEND ); @@ -358,7 +358,7 @@ void XclObj::SetEscherShapeType( sal_uInt16 nType ) void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj ) { - DBG_ASSERT( !pClientTextbox, "XclObj::SetText: already set" ); + OSL_ENSURE( !pClientTextbox, "XclObj::SetText: already set" ); if ( !pClientTextbox ) { mrEscherEx.UpdateDffFragmentEnd(); @@ -371,7 +371,7 @@ void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj ) void XclObj::WriteBody( XclExpStream& rStrm ) { - DBG_ASSERT( mnObjType != EXC_OBJTYPE_UNKNOWN, "XclObj::WriteBody - unknown type" ); + OSL_ENSURE( mnObjType != EXC_OBJTYPE_UNKNOWN, "XclObj::WriteBody - unknown type" ); // create a substream to be able to create subrecords SvMemoryStream aMemStrm; @@ -761,7 +761,7 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObje void XclTxo::SaveCont( XclExpStream& rStrm ) { - DBG_ASSERT( mpString.get(), "XclTxo::SaveCont - missing string" ); + OSL_ENSURE( mpString.get(), "XclTxo::SaveCont - missing string" ); // #i96858# do not save existing string formatting if text is empty sal_uInt16 nRunLen = mpString->IsEmpty() ? 0 : (8 * mpString->GetFormatsCount()); diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 7db33e2c51fa..b96b56bd4978 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -155,7 +155,7 @@ void ScChangeTrackingExportHelper::WriteGenerated(const ScChangeAction* pGenerat { #ifdef DBG_UTIL sal_uInt32 nActionNumber(pGeneratedAction->GetActionNumber()); - DBG_ASSERT(pChangeTrack->IsGenerated(nActionNumber), "a not generated action found"); + OSL_ENSURE(pChangeTrack->IsGenerated(nActionNumber), "a not generated action found"); #endif SvXMLElementExport aElemPrev(rExport, XML_NAMESPACE_TABLE, XML_CELL_CONTENT_DELETION, sal_True, sal_True); WriteBigRange(pGeneratedAction->GetBigRange(), XML_CELL_ADDRESS); @@ -501,7 +501,7 @@ void ScChangeTrackingExportHelper::AddInsertionAttributes(const ScChangeAction* rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertNumber(sBuffer, nPosition); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, sBuffer.makeStringAndClear()); - DBG_ASSERT(nCount > 0, "wrong insertion count"); + OSL_ENSURE(nCount > 0, "wrong insertion count"); if (nCount > 1) { SvXMLUnitConverter::convertNumber(sBuffer, nCount); diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 246e3eed3f20..3c10134dc02f 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -223,7 +223,7 @@ ScXMLChangeTrackingImportHelper::~ScXMLChangeTrackingImportHelper() void ScXMLChangeTrackingImportHelper::StartChangeAction(const ScChangeActionType nActionType) { - DBG_ASSERT(!pCurrentAction, "a not inserted action"); + OSL_ENSURE(!pCurrentAction, "a not inserted action"); switch (nActionType) { case SC_CAT_INSERT_COLS: @@ -273,7 +273,7 @@ sal_uInt32 ScXMLChangeTrackingImportHelper::GetIDFromString(const rtl::OUString& rtl::OUString sValue(sID.copy(nPrefixLength, nLength - nPrefixLength)); sal_Int32 nValue; SvXMLUnitConverter::convertNumber(nValue, sValue); - DBG_ASSERT(nValue > 0, "wrong change action ID"); + OSL_ENSURE(nValue > 0, "wrong change action ID"); nResult = nValue; } else @@ -296,7 +296,7 @@ void ScXMLChangeTrackingImportHelper::SetActionInfo(const ScMyActionInfo& aInfo) void ScXMLChangeTrackingImportHelper::SetPreviousChange(const sal_uInt32 nPreviousAction, ScMyCellInfo* pCellInfo) { - DBG_ASSERT(pCurrentAction->nActionType == SC_CAT_CONTENT, "wrong action type"); + OSL_ENSURE(pCurrentAction->nActionType == SC_CAT_CONTENT, "wrong action type"); ScMyContentAction* pAction = static_cast<ScMyContentAction*>(pCurrentAction); pAction->nPreviousAction = nPreviousAction; pAction->pCellInfo = pCellInfo; @@ -304,10 +304,10 @@ void ScXMLChangeTrackingImportHelper::SetPreviousChange(const sal_uInt32 nPrevio void ScXMLChangeTrackingImportHelper::SetPosition(const sal_Int32 nPosition, const sal_Int32 nCount, const sal_Int32 nTable) { - DBG_ASSERT(((pCurrentAction->nActionType != SC_CAT_MOVE) && + OSL_ENSURE(((pCurrentAction->nActionType != SC_CAT_MOVE) && (pCurrentAction->nActionType != SC_CAT_CONTENT) && (pCurrentAction->nActionType != SC_CAT_REJECT)), "wrong action type"); - DBG_ASSERT(nCount > 0, "wrong count"); + OSL_ENSURE(nCount > 0, "wrong count"); switch(pCurrentAction->nActionType) { case SC_CAT_INSERT_COLS: @@ -357,7 +357,7 @@ void ScXMLChangeTrackingImportHelper::SetMultiSpanned(const sal_Int16 nTempMulti { if (nTempMultiSpanned) { - DBG_ASSERT(((pCurrentAction->nActionType == SC_CAT_DELETE_COLS) || + OSL_ENSURE(((pCurrentAction->nActionType == SC_CAT_DELETE_COLS) || (pCurrentAction->nActionType == SC_CAT_DELETE_ROWS)), "wrong action type"); nMultiSpanned = nTempMultiSpanned; nMultiSpannedSlaveCount = 0; @@ -509,7 +509,7 @@ ScChangeAction* ScXMLChangeTrackingImportHelper::CreateDeleteAction(ScMyDelActio ScChangeAction* ScXMLChangeTrackingImportHelper::CreateMoveAction(ScMyMoveAction* pAction) { - DBG_ASSERT(pAction->pMoveRanges, "no move ranges"); + OSL_ENSURE(pAction->pMoveRanges, "no move ranges"); if (pAction->pMoveRanges) { DateTime aDateTime( Date(0), Time(0) ); @@ -572,7 +572,7 @@ void ScXMLChangeTrackingImportHelper::CreateGeneratedActions(ScMyGeneratedList& if (pCell) { (*aItr)->nID = pTrack->AddLoadedGenerated(pCell, (*aItr)->aBigRange, (*aItr)->pCellInfo->sInputString ); - DBG_ASSERT((*aItr)->nID, "could not insert generated action"); + OSL_ENSURE((*aItr)->nID, "could not insert generated action"); } } ++aItr; @@ -584,7 +584,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc { if (!pAction->aGeneratedList.empty()) { - DBG_ASSERT(((pAction->nActionType == SC_CAT_DELETE_COLS) || + OSL_ENSURE(((pAction->nActionType == SC_CAT_DELETE_COLS) || (pAction->nActionType == SC_CAT_DELETE_ROWS) || (pAction->nActionType == SC_CAT_DELETE_TABS)), "wrong action type"); if (pDelAct) @@ -593,7 +593,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc ScMyGeneratedList::iterator aEndItr(pAction->aGeneratedList.end()); while (aItr != aEndItr) { - DBG_ASSERT((*aItr)->nID, "a not inserted generated action"); + OSL_ENSURE((*aItr)->nID, "a not inserted generated action"); pDelAct->SetDeletedInThis((*aItr)->nID, pTrack); if (*aItr) delete *aItr; @@ -603,7 +603,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc } if (pAction->pInsCutOff) { - DBG_ASSERT(((pAction->nActionType == SC_CAT_DELETE_COLS) || + OSL_ENSURE(((pAction->nActionType == SC_CAT_DELETE_COLS) || (pAction->nActionType == SC_CAT_DELETE_ROWS) || (pAction->nActionType == SC_CAT_DELETE_TABS)), "wrong action type"); ScChangeAction* pChangeAction = pTrack->GetAction(pAction->pInsCutOff->nID); @@ -620,7 +620,7 @@ void ScXMLChangeTrackingImportHelper::SetDeletionDependencies(ScMyDelAction* pAc } if (!pAction->aMoveCutOffs.empty()) { - DBG_ASSERT(((pAction->nActionType == SC_CAT_DELETE_COLS) || + OSL_ENSURE(((pAction->nActionType == SC_CAT_DELETE_COLS) || (pAction->nActionType == SC_CAT_DELETE_ROWS) || (pAction->nActionType == SC_CAT_DELETE_TABS)), "wrong action type"); ScMyMoveCutOffs::iterator aItr(pAction->aMoveCutOffs.begin()); @@ -656,7 +656,7 @@ void ScXMLChangeTrackingImportHelper::SetMovementDependencies(ScMyMoveAction* pA ScMyGeneratedList::iterator aEndItr(pAction->aGeneratedList.end()); while (aItr != aEndItr) { - DBG_ASSERT((*aItr)->nID, "a not inserted generated action"); + OSL_ENSURE((*aItr)->nID, "a not inserted generated action"); pMoveAct->SetDeletedInThis((*aItr)->nID, pTrack); if (*aItr) delete *aItr; @@ -671,7 +671,7 @@ void ScXMLChangeTrackingImportHelper::SetContentDependencies(ScMyContentAction* { if (pAction->nPreviousAction) { - DBG_ASSERT(pAction->nActionType == SC_CAT_CONTENT, "wrong action type"); + OSL_ENSURE(pAction->nActionType == SC_CAT_CONTENT, "wrong action type"); ScChangeAction* pPrevAct = pTrack->GetAction(pAction->nPreviousAction); if (pPrevAct) { @@ -917,7 +917,7 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc) aEndItr = aActions.end(); while (aItr != aEndItr) { - DBG_ASSERT((*aItr)->nActionType == SC_CAT_CONTENT, "wrong action type"); + OSL_ENSURE((*aItr)->nActionType == SC_CAT_CONTENT, "wrong action type"); SetNewCell(static_cast<ScMyContentAction*>(*aItr)); if (*aItr) delete (*aItr); diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx index 5fafe505398a..e7fd8f030a12 100644 --- a/sc/source/filter/xml/XMLConverter.cxx +++ b/sc/source/filter/xml/XMLConverter.cxx @@ -340,7 +340,7 @@ void ScXMLConverter::ParseFormula(OUString& sFormula, const sal_Bool bIsFormula) chPrevious = sFormula[i]; } - DBG_ASSERT(nCountBraces == 0, "there are some braces still open"); + OSL_ENSURE(nCountBraces == 0, "there are some braces still open"); sFormula = sBuffer.makeStringAndClear(); } diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx index 94cf98d39849..541ce346a82c 100644 --- a/sc/source/filter/xml/XMLDDELinksContext.cxx +++ b/sc/source/filter/xml/XMLDDELinksContext.cxx @@ -143,7 +143,7 @@ void ScXMLDDELinkContext::CreateDDELink() nPosition = nPos; else nPosition = -1; - DBG_ASSERT(nPosition > -1, "DDE Link not inserted"); + OSL_ENSURE(nPosition > -1, "DDE Link not inserted"); } } @@ -164,7 +164,7 @@ void ScXMLDDELinkContext::EndElement() if (nPosition > -1 && nColumns && nRows && GetScImport().GetDocument()) { bool bSizeMatch = (static_cast<size_t>(nColumns * nRows) == aDDELinkTable.size()); - DBG_ASSERT( bSizeMatch, "ScXMLDDELinkContext::EndElement: matrix dimension doesn't match cells count"); + OSL_ENSURE( bSizeMatch, "ScXMLDDELinkContext::EndElement: matrix dimension doesn't match cells count"); // Excel writes bad ODF in that it does not write the // table:number-columns-repeated attribute of the // <table:table-column> element, but apparently uses the number of @@ -173,7 +173,7 @@ void ScXMLDDELinkContext::EndElement() if (!bSizeMatch && nColumns == 1) { nColumns = aDDELinkTable.size() / nRows; - DBG_ASSERT( static_cast<size_t>(nColumns * nRows) == aDDELinkTable.size(), + OSL_ENSURE( static_cast<size_t>(nColumns * nRows) == aDDELinkTable.size(), "ScXMLDDELinkContext::EndElement: adapted matrix dimension doesn't match either"); } ScMatrixRef pMatrix = new ScMatrix( static_cast<SCSIZE>(nColumns), static_cast<SCSIZE>(nRows) ); @@ -482,7 +482,7 @@ SvXMLImportContext *ScXMLDDECellContext::CreateChildContext( sal_uInt16 nPrefix, void ScXMLDDECellContext::EndElement() { - DBG_ASSERT(bString == bString2, "something wrong with this type"); + OSL_ENSURE(bString == bString2, "something wrong with this type"); ScDDELinkCell aCell; aCell.sValue = sValue; aCell.fValue = fValue; diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index d0071a9428b2..5b21af42e507 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -555,7 +555,7 @@ void ScXMLExportDataPilot::WriteDatePart(sal_Int32 nPart) void ScXMLExportDataPilot::WriteNumGroupInfo(const ScDPNumGroupInfo& rGroupInfo) { - DBG_ASSERT(rGroupInfo.Enable, "group dimension should be enabled"); + OSL_ENSURE(rGroupInfo.Enable, "group dimension should be enabled"); if (rGroupInfo.DateValues) { if (rGroupInfo.AutoStart) @@ -645,7 +645,7 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const pNumGroupDim = pDimData->GetNumGroupDim(pDim->GetName()); WriteNumGroupDim(pNumGroupDim); - DBG_ASSERT((!pGroupDim || !pNumGroupDim), "there should be no NumGroup and Group at the same field"); + OSL_ENSURE((!pGroupDim || !pNumGroupDim), "there should be no NumGroup and Group at the same field"); } if (pGroupDim || pNumGroupDim) { diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 8a0bdaff3a4d..178d93294cda 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -453,7 +453,7 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans:: sal_Bool bCaseSensitive(aSortFields[0].IsCaseSensitive); for (i = 1; i < nSortFields; ++i) { - DBG_ASSERT(bCaseSensitive == aSortFields[i].IsCaseSensitive, "seems that it is now possible to have every field case sensitive"); + OSL_ENSURE(bCaseSensitive == aSortFields[i].IsCaseSensitive, "seems that it is now possible to have every field case sensitive"); } #endif if (aSortFields[0].CollatorLocale.Language.getLength()) @@ -468,9 +468,9 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans:: rtl::OUString sAlgorithm(aSortFields[0].CollatorAlgorithm); for (i = 1; i < nSortFields; ++i) { - DBG_ASSERT(sLanguage == aSortFields[i].CollatorLocale.Language, "seems that it is now possible to have every field localized"); - DBG_ASSERT(sCountry == aSortFields[i].CollatorLocale.Country, "seems that it is now possible to have every field localized"); - DBG_ASSERT(sAlgorithm == aSortFields[i].CollatorAlgorithm, "seems that it is now possible to have every field localized"); + OSL_ENSURE(sLanguage == aSortFields[i].CollatorLocale.Language, "seems that it is now possible to have every field localized"); + OSL_ENSURE(sCountry == aSortFields[i].CollatorLocale.Country, "seems that it is now possible to have every field localized"); + OSL_ENSURE(sAlgorithm == aSortFields[i].CollatorAlgorithm, "seems that it is now possible to have every field localized"); } #endif SvXMLElementExport aElemS(rExport, XML_NAMESPACE_TABLE, XML_SORT, sal_True, sal_True); diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index d990bf035038..4706a6f8dad9 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -497,7 +497,7 @@ void ScMyDetectiveObjContainer::AddObject( ScDetectiveObjType eObjType, const SC if (eObjType != SC_DETOBJ_FROMOTHERTAB) { // if the ObjType == SC_DETOBJ_FROMOTHERTAB then the SourceRange is not used and so it has not to be tested and changed - DBG_ASSERT(aDetObj.aPosition.Sheet == aDetObj.aSourceRange.Sheet, "It seems to be possible to have different sheets"); + OSL_ENSURE(aDetObj.aPosition.Sheet == aDetObj.aSourceRange.Sheet, "It seems to be possible to have different sheets"); aDetObj.aSourceRange.Sheet = nSheet; } aDetObj.aPosition.Sheet = nSheet; @@ -774,7 +774,7 @@ void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell) void ScMyNotEmptyCellsIterator::SetCurrentTable(const SCTAB nTable, uno::Reference<sheet::XSpreadsheet>& rxTable) { - DBG_ASSERT(aAnnotations.empty(), "not all Annotations saved"); + OSL_ENSURE(aAnnotations.empty(), "not all Annotations saved"); aLastAddress.Row = 0; aLastAddress.Column = 0; aLastAddress.Sheet = nTable; diff --git a/sc/source/filter/xml/XMLExportSharedData.cxx b/sc/source/filter/xml/XMLExportSharedData.cxx index 7849b64efe9c..c8ec037cfc89 100644 --- a/sc/source/filter/xml/XMLExportSharedData.cxx +++ b/sc/source/filter/xml/XMLExportSharedData.cxx @@ -93,14 +93,14 @@ void ScMySharedData::AddDrawPage(const ScMyDrawPage& aDrawPage, const sal_Int32 void ScMySharedData::SetDrawPageHasForms(const sal_Int32 nTable, sal_Bool bHasForms) { - DBG_ASSERT(pDrawPages, "DrawPages not collected"); + OSL_ENSURE(pDrawPages, "DrawPages not collected"); if (pDrawPages) (*pDrawPages)[nTable].bHasForms = bHasForms; } uno::Reference<drawing::XDrawPage> ScMySharedData::GetDrawPage(const sal_Int32 nTable) { - DBG_ASSERT(pDrawPages, "DrawPages not collected"); + OSL_ENSURE(pDrawPages, "DrawPages not collected"); if (pDrawPages) return (*pDrawPages)[nTable].xDrawPage; else diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 34069bad6365..4ccc7227250c 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -462,7 +462,7 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) const rtl::OUString& ScMyValidationsContainer::GetValidationName(const sal_Int32 nIndex) { - DBG_ASSERT( static_cast<size_t>(nIndex) < aValidationVec.size(), "out of range" ); + OSL_ENSURE( static_cast<size_t>(nIndex) < aValidationVec.size(), "out of range" ); return aValidationVec[nIndex].sName; } @@ -679,8 +679,8 @@ void ScRowFormatRanges::AddRange(const sal_Int32 nPrevStartCol, const sal_Int32 void ScRowFormatRanges::AddRange(ScMyRowFormatRange& rFormatRange, const sal_Int32 nRow) { - DBG_ASSERT(pRowDefaults, "no row defaults"); - DBG_ASSERT(pColDefaults, "no column defaults"); + OSL_ENSURE(pRowDefaults, "no row defaults"); + OSL_ENSURE(pColDefaults, "no column defaults"); sal_uInt32 nEnd (rFormatRange.nRepeatRows + nRow - 1); sal_Int32 nPrevIndex((*pRowDefaults)[nRow].nIndex); sal_Bool bPrevAutoStyle((*pRowDefaults)[nRow].bIsAutoStyle); @@ -707,7 +707,7 @@ void ScRowFormatRanges::AddRange(ScMyRowFormatRange& rFormatRange, nEnd = rFormatRange.nStartColumn + rFormatRange.nRepeatColumns; for(i = nPrevStartCol + nRepeat; i < nEnd; i += (*pColDefaults)[i].nRepeat) { - DBG_ASSERT(sal_uInt32(nPrevStartCol + nRepeat) <= nEnd, "something wents wrong"); + OSL_ENSURE(sal_uInt32(nPrevStartCol + nRepeat) <= nEnd, "something wents wrong"); if ((nPrevIndex != (*pColDefaults)[i].nIndex) || (bPrevAutoStyle != (*pColDefaults)[i].bIsAutoStyle)) { @@ -923,7 +923,7 @@ sal_Int32 ScFormatRangeStyles::GetIndexOfStyleName(const rtl::OUString& rString, sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nColumn, const sal_Int32 nRow, sal_Bool& bIsAutoStyle) const { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); ScMyFormatRangeAddresses* pFormatRanges(aTables[nTable]); ScMyFormatRangeAddresses::iterator aItr(pFormatRanges->begin()); ScMyFormatRangeAddresses::iterator aEndItr(pFormatRanges->end()); @@ -946,7 +946,7 @@ sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nColumn, const sal_Int32 nRow, sal_Bool& bIsAutoStyle, sal_Int32& nValidationIndex, sal_Int32& nNumberFormat, const sal_Int32 nRemoveBeforeRow) { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); ScMyFormatRangeAddresses* pFormatRanges(aTables[nTable]); ScMyFormatRangeAddresses::iterator aItr(pFormatRanges->begin()); ScMyFormatRangeAddresses::iterator aEndItr(pFormatRanges->end()); @@ -990,7 +990,7 @@ void ScFormatRangeStyles::GetFormatRanges(const sal_Int32 nStartColumn, const sa const sal_Int32 nTable, ScRowFormatRanges* pRowFormatRanges) { sal_Int32 nTotalColumns(nEndColumn - nStartColumn + 1); - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); ScMyFormatRangeAddresses* pFormatRanges(aTables[nTable]); ScMyFormatRangeAddresses::iterator aItr(pFormatRanges->begin()); ScMyFormatRangeAddresses::iterator aEndItr(pFormatRanges->end()); @@ -1061,7 +1061,7 @@ void ScFormatRangeStyles::AddRangeStyleName(const table::CellRangeAddress aCellR aFormatRange.nValidationIndex = nValidationIndex; aFormatRange.nNumberFormat = nNumberFormat; aFormatRange.bIsAutoStyle = bIsAutoStyle; - DBG_ASSERT(static_cast<size_t>(aCellRangeAddress.Sheet) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(aCellRangeAddress.Sheet) < aTables.size(), "wrong table"); ScMyFormatRangeAddresses* pFormatRanges(aTables[aCellRangeAddress.Sheet]); pFormatRanges->push_back(aFormatRange); } @@ -1136,7 +1136,7 @@ rtl::OUString* ScColumnRowStylesBase::GetStyleNameByIndex(const sal_Int32 nIndex if ( nIndex < 0 || nIndex >= sal::static_int_cast<sal_Int32>( aStyleNames.size() ) ) { // should no longer happen, use first style then - DBG_ERRORFILE("GetStyleNameByIndex: invalid index"); + OSL_FAIL("GetStyleNameByIndex: invalid index"); return aStyleNames[0]; } @@ -1169,7 +1169,7 @@ void ScColumnStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields sal_Int32 ScColumnStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nField, sal_Bool& bIsVisible) { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); if (static_cast<size_t>(nField) < aTables[nTable].size()) { bIsVisible = aTables[nTable][nField].bIsVisible; @@ -1185,8 +1185,8 @@ sal_Int32 ScColumnStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_In void ScColumnStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nField, const sal_Int32 nStringIndex, const sal_Bool bIsVisible) { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); - DBG_ASSERT(aTables[nTable].size() >= static_cast<sal_uInt32>(nField), "wrong field"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(aTables[nTable].size() >= static_cast<sal_uInt32>(nField), "wrong field"); ScColumnStyle aStyle; aStyle.nIndex = nStringIndex; aStyle.bIsVisible = bIsVisible; @@ -1232,7 +1232,7 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields) sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nField) { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); if (maCache.hasCache(nTable, nField)) // Cache hit ! return maCache.mnStyle; @@ -1258,7 +1258,7 @@ sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nField, const sal_Int32 nStringIndex) { - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); StylesType& r = aTables[nTable]; r.insert_back(nField, nField+1, nStringIndex); } @@ -1266,8 +1266,8 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nFie void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nStartField, const sal_Int32 nStringIndex, const sal_Int32 nEndField) { - DBG_ASSERT( nStartField <= nEndField, "bad field range"); - DBG_ASSERT(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); + OSL_ENSURE( nStartField <= nEndField, "bad field range"); + OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table"); StylesType& r = aTables[nTable]; r.insert_back(nStartField, nEndField+1, nStringIndex); } diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx index 1087a6840e8d..15202ccf63db 100644 --- a/sc/source/filter/xml/XMLStylesImportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx @@ -366,7 +366,7 @@ ScMyStylesSet::iterator ScMyStylesImportHelper::GetIterator(const rtl::OUString* void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange) { - DBG_ASSERT(aRowDefaultStyle != aCellStyles.end(), "no row default style"); + OSL_ENSURE(aRowDefaultStyle != aCellStyles.end(), "no row default style"); if (!aRowDefaultStyle->sStyleName.getLength()) { SCCOL nStartCol(rRange.aStart.Col()); @@ -374,12 +374,12 @@ void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange) if (aColDefaultStyles.size() > sal::static_int_cast<sal_uInt32>(nStartCol)) { ScMyStylesSet::iterator aPrevItr(aColDefaultStyles[nStartCol]); - DBG_ASSERT(aColDefaultStyles.size() > sal::static_int_cast<sal_uInt32>(nEndCol), "to much columns"); + OSL_ENSURE(aColDefaultStyles.size() > sal::static_int_cast<sal_uInt32>(nEndCol), "to much columns"); for (SCCOL i = nStartCol + 1; (i <= nEndCol) && (i < sal::static_int_cast<SCCOL>(aColDefaultStyles.size())); ++i) { if (aPrevItr != aColDefaultStyles[i]) { - DBG_ASSERT(aPrevItr != aCellStyles.end(), "no column default style"); + OSL_ENSURE(aPrevItr != aCellStyles.end(), "no column default style"); ScRange aRange(rRange); aRange.aStart.SetCol(nStartCol); aRange.aEnd.SetCol(i - 1); @@ -402,12 +402,12 @@ void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange) } else { - DBG_ERRORFILE("no column default style"); + OSL_FAIL("no column default style"); } } else { - DBG_ERRORFILE("to much columns"); + OSL_FAIL("to much columns"); } } else @@ -447,9 +447,9 @@ void ScMyStylesImportHelper::AddRange() void ScMyStylesImportHelper::AddColumnStyle(const rtl::OUString& sStyleName, const sal_Int32 nColumn, const sal_Int32 nRepeat) { (void)nColumn; // avoid warning in product version - DBG_ASSERT(static_cast<sal_uInt32>(nColumn) == aColDefaultStyles.size(), "some columns are absent"); + OSL_ENSURE(static_cast<sal_uInt32>(nColumn) == aColDefaultStyles.size(), "some columns are absent"); ScMyStylesSet::iterator aItr(GetIterator(&sStyleName)); - DBG_ASSERT(aItr != aCellStyles.end(), "no column default style"); + OSL_ENSURE(aItr != aCellStyles.end(), "no column default style"); aColDefaultStyles.reserve(aColDefaultStyles.size() + nRepeat); for (sal_Int32 i = 0; i < nRepeat; ++i) aColDefaultStyles.push_back(aItr); @@ -485,7 +485,7 @@ void ScMyStylesImportHelper::AddRange(const ScRange& rRange) { if (rRange.aEnd.Row() == aPrevRange.aEnd.Row()) { - DBG_ASSERT(aPrevRange.aEnd.Col() + 1 == rRange.aStart.Col(), "something wents wrong"); + OSL_ENSURE(aPrevRange.aEnd.Col() + 1 == rRange.aStart.Col(), "something wents wrong"); aPrevRange.aEnd.SetCol(rRange.aEnd.Col()); } else @@ -496,7 +496,7 @@ void ScMyStylesImportHelper::AddRange(const ScRange& rRange) if (rRange.aStart.Col() == aPrevRange.aStart.Col() && rRange.aEnd.Col() == aPrevRange.aEnd.Col()) { - DBG_ASSERT(aPrevRange.aEnd.Row() + 1 == rRange.aStart.Row(), "something wents wrong"); + OSL_ENSURE(aPrevRange.aEnd.Row() + 1 == rRange.aStart.Row(), "something wents wrong"); aPrevRange.aEnd.SetRow(rRange.aEnd.Row()); } else diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx b/sc/source/filter/xml/XMLTableMasterPageExport.cxx index 4b145b9df1d3..1eeb10f6d173 100644 --- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx +++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx @@ -59,7 +59,7 @@ void XMLTableMasterPageExport::exportHeaderFooterContent( const Reference< XText >& rText, sal_Bool bAutoStyles, sal_Bool bProgress ) { - DBG_ASSERT( rText.is(), "There is the text" ); + OSL_ENSURE( rText.is(), "There is the text" ); if( bAutoStyles ) GetExport().GetTextParagraphExport() diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index be365f4b1041..18591f7517f9 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -836,7 +836,7 @@ SvXMLImportContext *ScXMLCellContentDeletionContext::CreateChildContext( sal_uIn } else if (IsXMLToken(rLocalName, XML_CELL_ADDRESS)) { - DBG_ASSERT(!nID, "a action with a ID should not contain a BigRange"); + OSL_ENSURE(!nID, "a action with a ID should not contain a BigRange"); bBigRange = sal_True; pContext = new ScXMLBigRangeContext(GetScImport(), nPrefix, rLocalName, xAttrList, aBigRange); } diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index 226d145508b5..ff487074b22d 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -130,7 +130,7 @@ void ScSheetSaveData::AddStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset, sal_ void ScSheetSaveData::StartStreamPos( sal_Int32 nTab, sal_Int32 nStartOffset ) { - DBG_ASSERT( mnStartTab < 0, "StartStreamPos without EndStreamPos" ); + OSL_ENSURE( mnStartTab < 0, "StartStreamPos without EndStreamPos" ); mnStartTab = nTab; mnStartOffset = nStartOffset; diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index a7755b840bca..468b6e9b1013 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -150,7 +150,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, pStyleName = new rtl::OUString(sValue); break; case XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME: - DBG_ASSERT(!pContentValidationName, "here should be only one Validation Name"); + OSL_ENSURE(!pContentValidationName, "here should be only one Validation Name"); pContentValidationName = new rtl::OUString(sValue); break; case XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_ROWS: @@ -207,7 +207,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, { if (sValue.getLength()) { - DBG_ASSERT(!pOUTextValue, "here should be only one string value"); + OSL_ENSURE(!pOUTextValue, "here should be only one string value"); pOUTextValue.reset(sValue); bIsEmpty = false; } @@ -231,7 +231,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, { if (sValue.getLength()) { - DBG_ASSERT(!pOUFormula, "here should be only one formula"); + OSL_ENSURE(!pOUFormula, "here should be only one formula"); rtl::OUString aFormula, aFormulaNmsp; rXMLImport.ExtractFormulaNamespaceGrammar( aFormula, aFormulaNmsp, eGrammar, sValue ); pOUFormula.reset( FormulaWithNamespace( aFormula, aFormulaNmsp ) ); @@ -312,7 +312,7 @@ void ScXMLTableRowCellContext::SetCursorOnTextImport(const rtl::OUString& rOUTem } else { - DBG_ERRORFILE("this method should only be called for a existing cell"); + OSL_FAIL("this method should only be called for a existing cell"); } } @@ -387,7 +387,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr bHasSubTable = IsXMLToken(xAttrList->getValueByIndex( i ), XML_TRUE); } } - DBG_ASSERT(bHasSubTable, "it should be a subtable"); + OSL_ENSURE(bHasSubTable, "it should be a subtable"); pContext = new ScXMLTableContext( rXMLImport , nPrefix, rLName, xAttrList, sal_True, nMergedCols); @@ -398,7 +398,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr case XML_TOK_TABLE_ROW_CELL_ANNOTATION: { bIsEmpty = false; - DBG_ASSERT( !mxAnnotationData.get(), "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell" ); + OSL_ENSURE( !mxAnnotationData.get(), "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell" ); mxAnnotationData.reset( new ScXMLAnnotationData ); pContext = new ScXMLAnnotationContext( rXMLImport, nPrefix, rLName, xAttrList, *mxAnnotationData, this); @@ -513,7 +513,7 @@ void ScXMLTableRowCellContext::DoMerge(const com::sun::star::table::CellAddress& } catch ( lang::IndexOutOfBoundsException & ) { - DBG_ERRORFILE("ScXMLTableRowCellContext::DoMerge: range to be merged larger than what we support"); + OSL_FAIL("ScXMLTableRowCellContext::DoMerge: range to be merged larger than what we support"); } } } @@ -614,13 +614,13 @@ void ScXMLTableRowCellContext::SetAnnotation(const table::CellAddress& aCellAddr uno::Reference< container::XIndexAccess > xShapesIA( xShapes, uno::UNO_QUERY ); sal_Int32 nOldShapeCount = xShapesIA.is() ? xShapesIA->getCount() : 0; - DBG_ASSERT( !mxAnnotationData->mxShape.is() || mxAnnotationData->mxShapes.is(), + OSL_ENSURE( !mxAnnotationData->mxShape.is() || mxAnnotationData->mxShapes.is(), "ScXMLTableRowCellContext::SetAnnotation - shape without drawing page" ); if( mxAnnotationData->mxShape.is() && mxAnnotationData->mxShapes.is() ) { - DBG_ASSERT( mxAnnotationData->mxShapes.get() == xShapes.get(), "ScXMLTableRowCellContext::SetAnnotation - diffenet drawing pages" ); + OSL_ENSURE( mxAnnotationData->mxShapes.get() == xShapes.get(), "ScXMLTableRowCellContext::SetAnnotation - diffenet drawing pages" ); SdrObject* pObject = ::GetSdrObjectFromXShape( mxAnnotationData->mxShape ); - DBG_ASSERT( pObject, "ScXMLTableRowCellContext::SetAnnotation - cannot get SdrObject from shape" ); + OSL_ENSURE( pObject, "ScXMLTableRowCellContext::SetAnnotation - cannot get SdrObject from shape" ); /* Try to reuse the drawing object already created (but only if the note is visible, and the object is a caption object). */ @@ -811,7 +811,7 @@ void ScXMLTableRowCellContext::EndElement() } catch (lang::IndexOutOfBoundsException&) { - DBG_ERRORFILE("It seems here are to many columns or rows"); + OSL_FAIL("It seems here are to many columns or rows"); } } uno::Reference <text::XText> xTempText (xBaseCell, uno::UNO_QUERY); @@ -862,7 +862,7 @@ void ScXMLTableRowCellContext::EndElement() // } // catch (lang::IndexOutOfBoundsException&) // { - // DBG_ERRORFILE("It seems here are to many columns or rows"); + // OSL_FAIL("It seems here are to many columns or rows"); // } // } @@ -1071,12 +1071,12 @@ void ScXMLTableRowCellContext::EndElement() } catch (lang::IndexOutOfBoundsException&) { - DBG_ERRORFILE("It seems here are to many columns or rows"); + OSL_FAIL("It seems here are to many columns or rows"); } if (xCell.is()) { SetCellProperties(xCell); // set now only the validation - DBG_ASSERT(((nCellsRepeated == 1) && (nRepeatedRows == 1)), "repeated cells with formula not possible now"); + OSL_ENSURE(((nCellsRepeated == 1) && (nRepeatedRows == 1)), "repeated cells with formula not possible now"); rXMLImport.GetStylesImportHelper()->AddCell(aCellPos); if (!bIsMatrix) { diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 5dfb3b68b5a6..60cc4f697fd6 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1121,7 +1121,7 @@ void ScXMLExport::WriteRowContent() while (pRowFormatRanges->GetNext(aRange)) { #ifdef DBG_UTIL - DBG_ASSERT(bIsFirst || (!bIsFirst && (nPrevCol + nCols == aRange.nStartColumn)), "here are some columns missing"); + OSL_ENSURE(bIsFirst || (!bIsFirst && (nPrevCol + nCols == aRange.nStartColumn)), "here are some columns missing"); #endif if (bIsFirst) { @@ -1203,7 +1203,7 @@ void ScXMLExport::WriteRowStartTag( if ( nRow >= sal::static_int_cast<sal_Int32>( rRowDefaults.size() ) ) { // used to happen with detective operations - if there are more cases, use the last row's style - DBG_ERRORFILE("WriteRowStartTag: not enough defaults"); + OSL_FAIL("WriteRowStartTag: not enough defaults"); nRow = rRowDefaults.size() - 1; } sal_Int32 nCellStyleIndex(rRowDefaults[nRow].nIndex); @@ -1390,7 +1390,7 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32 pRowFormatRanges->Clear(); pCellStyles->GetFormatRanges(0, pSharedData->GetLastColumn(nSheet), nStartRow + nRows, nSheet, pRowFormatRanges); sal_Int32 nMaxRows = pRowFormatRanges->GetMaxRows(); - DBG_ASSERT(nMaxRows, "something wents wrong"); + OSL_ENSURE(nMaxRows, "something wents wrong"); if (nMaxRows >= nTotalRows - nRows) { OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows, aRowAttr); @@ -2175,7 +2175,7 @@ void ScXMLExport::_ExportAutoStyles() //! separate method AddStyleFromNote needed? ScPostIt* pNote = pDoc->GetNote( aPos ); - DBG_ASSERT( pNote, "note not found" ); + OSL_ENSURE( pNote, "note not found" ); if (pNote) { SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); @@ -2221,7 +2221,7 @@ void ScXMLExport::_ExportAutoStyles() if (bCopySheet) { ScPostIt* pNote = pDoc->GetNote( aPos ); - DBG_ASSERT( pNote, "note not found" ); + OSL_ENSURE( pNote, "note not found" ); if (pNote) { SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); @@ -2256,7 +2256,7 @@ void ScXMLExport::_ExportAutoStyles() if (bCopySheet) { ScPostIt* pNote = pDoc->GetNote( aPos ); - DBG_ASSERT( pNote, "note not found" ); + OSL_ENSURE( pNote, "note not found" ); if (pNote) { SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( aPos ); @@ -2547,7 +2547,7 @@ void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > xShape // #i60851# When the file is saved while editing a new note, // the cell is still empty -> last column/row must be updated - DBG_ASSERT( pCaptData->maStart.Tab() == nCurrentTable, "invalid table in object data" ); + OSL_ENSURE( pCaptData->maStart.Tab() == nCurrentTable, "invalid table in object data" ); pSharedData->SetLastColumn( nCurrentTable, pCaptData->maStart.Col() ); pSharedData->SetLastRow( nCurrentTable, pCaptData->maStart.Row() ); } @@ -2607,7 +2607,7 @@ sal_Bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress, ++nCol; } } - DBG_ASSERT(!(!bReady && nEndRow > nRow && nEndCol > nCol), "should not be possible"); + OSL_ENSURE(!(!bReady && nEndRow > nRow && nEndCol > nCol), "should not be possible"); return !bReady; } @@ -2751,7 +2751,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe ::xmloff::OOfficeFormsExport aForms(*this); GetFormExport()->exportForms( xDrawPage ); sal_Bool bRet(GetFormExport()->seekPage( xDrawPage )); - DBG_ASSERT( bRet, "OFormLayerXMLExport::seekPage failed!" ); + OSL_ENSURE( bRet, "OFormLayerXMLExport::seekPage failed!" ); (void)bRet; // avoid warning in product version } if (pSharedData->HasDrawPage()) @@ -3190,7 +3190,7 @@ void ScXMLExport::WriteTableShapes() ScMyTableShapes* pTableShapes(pSharedData->GetTableShapes()); if (pTableShapes && !(*pTableShapes)[nCurrentTable].empty()) { - DBG_ASSERT(pTableShapes->size() > static_cast<size_t>(nCurrentTable), "wrong Table"); + OSL_ENSURE(pTableShapes->size() > static_cast<size_t>(nCurrentTable), "wrong Table"); SvXMLElementExport aShapesElem(*this, XML_NAMESPACE_TABLE, XML_SHAPES, sal_True, false); ScMyTableXShapes::iterator aItr((*pTableShapes)[nCurrentTable].begin()); ScMyTableXShapes::iterator aEndItr((*pTableShapes)[nCurrentTable].end()); @@ -4175,7 +4175,7 @@ void ScXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& bool bVBACompat = false; uno::Reference <container::XNameAccess> xCodeNameAccess; - DBG_ASSERT( pDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" ); + OSL_ENSURE( pDoc, "ScXMLExport::GetConfigurationSettings - no ScDocument!" ); if( pDoc && pDoc->IsInVBAMode() ) { // VBA compatibility mode @@ -4326,7 +4326,7 @@ void SAL_CALL ScXMLExport::setSourceDocument( const uno::Reference<lang::XCompon SvXMLExport::setSourceDocument( xComponent ); pDoc = ScXMLConverter::GetScDocument( GetModel() ); - DBG_ASSERT( pDoc, "ScXMLExport::setSourceDocument - no ScDocument!" ); + OSL_ENSURE( pDoc, "ScXMLExport::setSourceDocument - no ScDocument!" ); if (!pDoc) throw lang::IllegalArgumentException(); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 07ee74fc0be8..7456b9b2d407 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2382,7 +2382,7 @@ void ScXMLImport::SetType(uno::Reference <beans::XPropertySet>& rProperties, { if (rNumberFormat == -1) rProperties->getPropertyValue( sNumberFormat ) >>= rNumberFormat; - DBG_ASSERT(rNumberFormat != -1, "no NumberFormat"); + OSL_ENSURE(rNumberFormat != -1, "no NumberFormat"); sal_Bool bIsStandard; // sCurrentCurrency may be the ISO code abbreviation if the currency // symbol matches such, or if no match found the symbol itself! @@ -2450,7 +2450,7 @@ void ScXMLImport::AddStyleRange(const table::CellRangeAddress& rCellRange) uno::Reference <lang::XMultiServiceFactory> xMultiServiceFactory(GetModel(), uno::UNO_QUERY); if (xMultiServiceFactory.is()) xSheetCellRanges.set(uno::Reference <sheet::XSheetCellRangeContainer>(xMultiServiceFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetCellRanges"))), uno::UNO_QUERY)); - DBG_ASSERT(xSheetCellRanges.is(), "didn't get SheetCellRanges"); + OSL_ENSURE(xSheetCellRanges.is(), "didn't get SheetCellRanges"); } xSheetCellRanges->addRangeAddress(rCellRange, false); @@ -2506,7 +2506,7 @@ void ScXMLImport::SetStyleToRanges() rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SheetCellRanges"))), uno::UNO_QUERY)); } - DBG_ASSERT(xSheetCellRanges.is(), "didn't get SheetCellRanges"); + OSL_ENSURE(xSheetCellRanges.is(), "didn't get SheetCellRanges"); } void ScXMLImport::SetStyleToRange(const ScRange& rRange, const rtl::OUString* pStyleName, @@ -2552,7 +2552,7 @@ sal_Bool ScXMLImport::SetNullDateOnUnitConverter() { if (!bNullDateSetted) bNullDateSetted = GetMM100UnitConverter().setNullDate(GetModel()); - DBG_ASSERT(bNullDateSetted, "could not set the null date"); + OSL_ENSURE(bNullDateSetted, "could not set the null date"); return bNullDateSetted; } @@ -2585,7 +2585,7 @@ throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::R uno::Reference<frame::XModel> xModel(xDoc, uno::UNO_QUERY); pDoc = ScXMLConverter::GetScDocument( xModel ); - DBG_ASSERT( pDoc, "ScXMLImport::setTargetDocument - no ScDocument!" ); + OSL_ENSURE( pDoc, "ScXMLImport::setTargetDocument - no ScDocument!" ); if (!pDoc) throw lang::IllegalArgumentException(); @@ -2955,7 +2955,7 @@ void ScXMLImport::LockSolarMutex() if (nSolarMutexLocked == 0) { - DBG_ASSERT(!pSolarMutexGuard, "Solar Mutex is locked"); + OSL_ENSURE(!pSolarMutexGuard, "Solar Mutex is locked"); pSolarMutexGuard = new SolarMutexGuard(); } ++nSolarMutexLocked; @@ -2969,7 +2969,7 @@ void ScXMLImport::UnlockSolarMutex() nSolarMutexLocked--; if (nSolarMutexLocked == 0) { - DBG_ASSERT(pSolarMutexGuard, "Solar Mutex is always unlocked"); + OSL_ENSURE(pSolarMutexGuard, "Solar Mutex is always unlocked"); delete pSolarMutexGuard; pSolarMutexGuard = NULL; } diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index b36b2f812d46..3728f5e9b650 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -167,7 +167,7 @@ void ScXMLTableRowContext::EndElement() { for (sal_Int32 i = 0; i < nRepeatedRows - 1; ++i) //one row is always added GetScImport().GetTables().AddRow(); - DBG_ERRORFILE("it seems here is a nonvalid file; possible missing of table:table-cell element"); + OSL_FAIL("it seems here is a nonvalid file; possible missing of table:table-cell element"); } sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet(); sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow()); diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 2474a82c3dfa..d7cfdb245aeb 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -570,7 +570,7 @@ void XMLTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::An if (property) property->mnIndex = -1; // #i46996# remove old property, so it isn't double sal_Int32 nIndex(static_cast<XMLTableStylesContext *>(pStyles)->GetIndex(nContextID)); - DBG_ASSERT(nIndex != -1, "Property not found in Map"); + OSL_ENSURE(nIndex != -1, "Property not found in Map"); XMLPropertyState aPropState(nIndex, rValue); GetProperties().push_back(aPropState); // has to be insertes in a sort order later } @@ -581,7 +581,7 @@ XMLPropertyState* XMLTableStyleContext::FindProperty(const sal_Int16 nContextID) UniReference < XMLPropertySetMapper > xPrMap; UniReference < SvXMLImportPropertyMapper > xImpPrMap = pStyles->GetImportPropertyMapper( GetFamily() ); - DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" ); + OSL_ENSURE( xImpPrMap.is(), "There is the import prop mapper" ); if( xImpPrMap.is() ) xPrMap = xImpPrMap->getPropertySetMapper(); if( xPrMap.is() ) diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 0e7f7b221152..6818327dd336 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -711,7 +711,7 @@ void ScMyTables::AddColCount(sal_Int32 nTempColCount) void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName) { - DBG_ASSERT(maTables.size() == 1, "not possible to use default styles on columns in subtables"); + OSL_ENSURE(maTables.size() == 1, "not possible to use default styles on columns in subtables"); rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColStylePos, nRepeat); nCurrentColStylePos += nRepeat; } @@ -762,8 +762,8 @@ void ScMyTables::AddMatrixRange( sal_Int32 nStartColumn, sal_Int32 nStartRow, sal_Int32 nEndColumn, sal_Int32 nEndRow, const rtl::OUString& rFormula, const rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar) { - DBG_ASSERT(nEndRow >= nStartRow, "wrong row order"); - DBG_ASSERT(nEndColumn >= nStartColumn, "wrong column order"); + OSL_ENSURE(nEndRow >= nStartRow, "wrong row order"); + OSL_ENSURE(nEndColumn >= nStartColumn, "wrong column order"); table::CellRangeAddress aRange; aRange.StartColumn = nStartColumn; aRange.StartRow = nStartRow; diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 2a121a49f065..e10b125a01a4 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -95,7 +95,7 @@ ScXMLImportWrapper::ScXMLImportWrapper(ScDocument& rD, SfxMedium* pM, const uno: pMedium(pM), xStorage(xStor) { - DBG_ASSERT( pMedium || xStorage.is(), "ScXMLImportWrapper: Medium or Storage must be set" ); + OSL_ENSURE( pMedium || xStorage.is(), "ScXMLImportWrapper: Medium or Storage must be set" ); } uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator() @@ -168,7 +168,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe uno::Reference< beans::XPropertySet > xInfoSet; if( aArgs.getLength() > 0 ) aArgs.getConstArray()[0] >>= xInfoSet; - DBG_ASSERT( xInfoSet.is(), "missing property set" ); + OSL_ENSURE( xInfoSet.is(), "missing property set" ); if( xInfoSet.is() ) { rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); @@ -182,7 +182,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe xServiceFactory->createInstanceWithArguments( sComponentName, aArgs ), uno::UNO_QUERY ); - DBG_ASSERT( xDocHandler.is(), "can't get Calc importer" ); + OSL_ENSURE( xDocHandler.is(), "can't get Calc importer" ); uno::Reference<document::XImporter> xImporter( xDocHandler, uno::UNO_QUERY ); uno::Reference<lang::XComponent> xComponent( xModel, uno::UNO_QUERY ); if (xImporter.is()) @@ -240,7 +240,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe } else { - DBG_ASSERT( bMustBeSuccessfull, "Warnings are not supported" ); + OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" ); nReturn = *new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ); } @@ -321,7 +321,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) uno::Reference<lang::XMultiServiceFactory> xServiceFactory = comphelper::getProcessServiceFactory(); - DBG_ASSERT( xServiceFactory.is(), "got no service manager" ); + OSL_ENSURE( xServiceFactory.is(), "got no service manager" ); if( !xServiceFactory.is() ) return false; @@ -336,7 +336,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) uno::Reference<uno::XInterface> xXMLParser( xServiceFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" )) )); - DBG_ASSERT( xXMLParser.is(), "com.sun.star.xml.sax.Parser service missing" ); + OSL_ENSURE( xXMLParser.is(), "com.sun.star.xml.sax.Parser service missing" ); if( !xXMLParser.is() ) return false; @@ -661,7 +661,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic uno::Reference< beans::XPropertySet > xInfoSet; if( aArgs.getLength() > 0 ) aArgs.getConstArray()[0] >>= xInfoSet; - DBG_ASSERT( xInfoSet.is(), "missing property set" ); + OSL_ENSURE( xInfoSet.is(), "missing property set" ); if( xInfoSet.is() ) { rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); @@ -674,7 +674,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic uno::Reference<document::XFilter> xFilter( xServiceFactory->createInstanceWithArguments( sComponentName , aArgs ), uno::UNO_QUERY ); - DBG_ASSERT( xFilter.is(), "can't get exporter" ); + OSL_ENSURE( xFilter.is(), "can't get exporter" ); uno::Reference<document::XExporter> xExporter( xFilter, uno::UNO_QUERY ); uno::Reference<lang::XComponent> xComponent( xModel, uno::UNO_QUERY ); if (xExporter.is()) @@ -744,13 +744,13 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScXMLImportWrapper::Export" ); uno::Reference<lang::XMultiServiceFactory> xServiceFactory(comphelper::getProcessServiceFactory()); - DBG_ASSERT( xServiceFactory.is(), "got no service manager" ); + OSL_ENSURE( xServiceFactory.is(), "got no service manager" ); if( !xServiceFactory.is() ) return false; uno::Reference<uno::XInterface> xWriter(xServiceFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" )) )); - DBG_ASSERT( xWriter.is(), "com.sun.star.xml.sax.Writer service missing" ); + OSL_ENSURE( xWriter.is(), "com.sun.star.xml.sax.Writer service missing" ); if(!xWriter.is()) return false; |