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 /sc/source/filter/xml | |
parent | 8b569e74d6b671c13a57c5ad72ed360d194b2dda (diff) |
Replace DBG_* with OSL_* in sc/source/filter
Diffstat (limited to 'sc/source/filter/xml')
20 files changed, 109 insertions, 109 deletions
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; |