diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-03 08:51:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-03 12:49:38 +0100 |
commit | 4228f08d6084d8563b70a26a6398fb0caf017f99 (patch) | |
tree | 2f91cb13231f0de1e514dd545e0910b830589fb4 /sc | |
parent | 6fe1e3af0e812d99e63677d9ead056357b37ecf7 (diff) |
use assert when followed by deref
Change-Id: I8405e4d8f9fa1de3ef6ee474321b4ac2b4ce1624
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xiroot.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob1.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 2 |
7 files changed, 21 insertions, 21 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 766125cec96e..e8719fcffff5 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1818,13 +1818,13 @@ void ScDocument::CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest) const ScDocOptions& ScDocument::GetDocOptions() const { - OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); + assert(pDocOptions && "No DocOptions! :-("); return *pDocOptions; } void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) { - OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); + assert(pDocOptions && "No DocOptions! :-("); *pDocOptions = rOpt; xPoolHelper->SetFormTableOpt(rOpt); @@ -1832,13 +1832,13 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) const ScViewOptions& ScDocument::GetViewOptions() const { - OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); + assert(pViewOptions && "No ViewOptions! :-("); return *pViewOptions; } void ScDocument::SetViewOptions( const ScViewOptions& rOpt ) { - OSL_ENSURE( pViewOptions, "No ViewOptions! :-(" ); + assert(pViewOptions && "No ViewOptions! :-("); *pViewOptions = rOpt; } diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 77db4fbc121c..f6507e4319d2 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -140,7 +140,7 @@ ExcelToSc& XclImpRoot::GetOldFmlaConverter() const XclImpSst& XclImpRoot::GetSst() const { - OSL_ENSURE( mrImpData.mxSst, "XclImpRoot::GetSst - invalid call, wrong BIFF" ); + assert(mrImpData.mxSst && "XclImpRoot::GetSst - invalid call, wrong BIFF"); return *mrImpData.mxSst; } @@ -193,7 +193,7 @@ XclImpNameManager& XclImpRoot::GetNameManager() const XclImpLinkManager& XclImpRoot::GetLinkManager() const { - OSL_ENSURE( mrImpData.mxLinkMgr, "XclImpRoot::GetLinkManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxLinkMgr && "XclImpRoot::GetLinkManager - invalid call, wrong BIFF"); return *mrImpData.mxLinkMgr; } @@ -210,44 +210,44 @@ XclImpSheetDrawing& XclImpRoot::GetCurrSheetDrawing() const XclImpCondFormatManager& XclImpRoot::GetCondFormatManager() const { - OSL_ENSURE( mrImpData.mxCondFmtMgr, "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxCondFmtMgr && "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF"); return *mrImpData.mxCondFmtMgr; } XclImpValidationManager& XclImpRoot::GetValidationManager() const { - OSL_ENSURE( mrImpData.mxValidMgr, "XclImpRoot::GetValidationManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxValidMgr && "XclImpRoot::GetValidationManager - invalid call, wrong BIFF"); return *mrImpData.mxValidMgr; } XclImpAutoFilterBuffer& XclImpRoot::GetFilterManager() const { // TODO still in old RootData - OSL_ENSURE( GetOldRoot().pAutoFilterBuffer, "XclImpRoot::GetFilterManager - invalid call, wrong BIFF" ); + assert(GetOldRoot().pAutoFilterBuffer && "XclImpRoot::GetFilterManager - invalid call, wrong BIFF"); return *GetOldRoot().pAutoFilterBuffer; } XclImpWebQueryBuffer& XclImpRoot::GetWebQueryBuffer() const { - OSL_ENSURE( mrImpData.mxWebQueryBfr, "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxWebQueryBfr && "XclImpRoot::GetWebQueryBuffer - invalid call, wrong BIFF"); return *mrImpData.mxWebQueryBfr; } XclImpPivotTableManager& XclImpRoot::GetPivotTableManager() const { - OSL_ENSURE( mrImpData.mxPTableMgr, "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF" ); + assert(mrImpData.mxPTableMgr && "XclImpRoot::GetPivotTableManager - invalid call, wrong BIFF"); return *mrImpData.mxPTableMgr; } XclImpSheetProtectBuffer& XclImpRoot::GetSheetProtectBuffer() const { - OSL_ENSURE( mrImpData.mxTabProtect, "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxTabProtect && "XclImpRoot::GetSheetProtectBuffer - invalid call, wrong BIFF"); return *mrImpData.mxTabProtect; } XclImpDocProtectBuffer& XclImpRoot::GetDocProtectBuffer() const { - OSL_ENSURE( mrImpData.mxDocProtect, "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF" ); + assert(mrImpData.mxDocProtect && "XclImpRoot::GetDocProtectBuffer - invalid call, wrong BIFF"); return *mrImpData.mxDocProtect; } diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 3aa3fbb818f5..f860224ef900 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -190,7 +190,7 @@ void ScAccessibleCsvControl::ensureAlive() const throw( DisposedException ) ScCsvControl& ScAccessibleCsvControl::implGetControl() const { - OSL_ENSURE( mpControl, "ScAccessibleCsvControl::implGetControl - missing control" ); + assert(mpControl && "ScAccessibleCsvControl::implGetControl - missing control"); return *mpControl; } diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index b88b982fce42..d364ef2f4d4e 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -45,12 +45,12 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, SfxItemSet& rOutSet , sal_uInt16 nSlot) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); + assert(pFact && "ScAbstractFactory create fail!"); boost::scoped_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( pViewData->GetDialogParent(), &rArgs, pViewData->GetSfxDocShell())); - OSL_ENSURE(pDlg, "Dialog create fail!"); + assert(pDlg && "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { pDlg->SetCurPageId(RID_SVXPAGE_CHAR_EFFECTS); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 233a46f6fd60..2797222dd85e 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2795,8 +2795,8 @@ void ScCellShell::ExecuteFillSingleEdit() IMPL_LINK_NOARG(ScCellShell, DialogClosed) { - OSL_ENSURE( pImpl->m_pLinkedDlg, "ScCellShell::DialogClosed(): invalid request" ); - OSL_ENSURE( pImpl->m_pRequest, "ScCellShell::DialogClosed(): invalid request" ); + assert(pImpl->m_pLinkedDlg && "ScCellShell::DialogClosed(): invalid request"); + assert(pImpl->m_pRequest && "ScCellShell::DialogClosed(): invalid request"); OUString sFile, sFilter, sOptions, sSource; sal_uLong nRefresh = 0; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index d79de14e17d5..f0ffb70b76eb 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -1245,11 +1245,11 @@ void ScEditShell::ExecuteTrans( SfxRequest& rReq ) if ( nType ) { ScInputHandler* pHdl = GetMyInputHdl(); - OSL_ENSURE( pHdl, "no ScInputHandler" ); + assert(pHdl && "no ScInputHandler"); EditView* pTopView = pHdl->GetTopView(); EditView* pTableView = pHdl->GetTableView(); - OSL_ENSURE( pTableView, "no EditView" ); + assert(pTableView && "no EditView"); pHdl->DataChanging(); diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 95d00d884e69..1d2d1b072eb0 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -456,7 +456,7 @@ bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const while (pParent) { pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); - OSL_ASSERT(pUserData); + assert(pUserData); if (pUserData->maLinkedPos.IsValid()) { // This parent is already linked. |