summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-30 09:13:14 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2014-06-30 14:56:13 +0200
commitc41779d2a80bdcc61e051699d445a68edf04d283 (patch)
treeff6fdd983d965bb1fd5a1f39caa8b9e459018a9c
parent2dbffd8160473929e2e7df264a7732a8f5b7e2ba (diff)
Called C++ object pointer is null
Change-Id: I88efc4be6ff869ef97a2b398d43f7b7914debfc6
-rw-r--r--editeng/source/editeng/eertfpar.cxx4
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx2
-rw-r--r--sd/source/ui/app/sdmod1.cxx2
-rw-r--r--sd/source/ui/func/fuinsfil.cxx4
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svx/source/accessibility/ChildrenManager.cxx58
-rw-r--r--svx/source/dialog/charmap.cxx2
-rw-r--r--svx/source/items/numfmtsh.cxx6
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobj.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx4
-rw-r--r--svx/source/svdraw/svdview.cxx2
-rw-r--r--sw/source/core/access/accmap.cxx4
-rw-r--r--sw/source/core/doc/docedt.cxx3
-rw-r--r--sw/source/core/frmedt/feshview.cxx2
-rw-r--r--sw/source/core/layout/layouter.cxx2
-rw-r--r--sw/source/core/table/swtable.cxx2
-rw-r--r--sw/source/core/undo/untbl.cxx2
-rw-r--r--sw/source/core/unocore/unoframe.cxx2
-rw-r--r--sw/source/filter/html/svxcss1.cxx5
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx16
-rw-r--r--sw/source/uibase/app/applab.cxx2
-rw-r--r--sw/source/uibase/config/viewopt.cxx2
-rw-r--r--sw/source/uibase/dialog/wordcountwrapper.cxx4
-rw-r--r--sw/source/uibase/index/toxmgr.cxx2
-rw-r--r--sw/source/uibase/uiview/viewport.cxx2
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx4
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx2
-rw-r--r--vcl/source/edit/texteng.cxx3
-rw-r--r--vcl/source/helper/canvasbitmap.cxx8
30 files changed, 62 insertions, 97 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 3662a4ceac48..006131ce6ce3 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -160,7 +160,7 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r
for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
ContentNode* pNode = mpEditEngine->GetEditDoc().GetObject( nPara );
- DBG_ASSERT( pNode, "AddRTFDefaultValues - No paragraph?!" );
+ assert(pNode && "AddRTFDefaultValues - No paragraph?!");
if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTINFO ) )
pNode->GetContentAttribs().GetItems().Put( aFontItem );
if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTHEIGHT ) )
@@ -280,7 +280,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos,
if ( nCurPara )
nCurPara--;
ContentNode* pPrevNode = mpEditEngine->GetEditDoc().GetObject( nCurPara );
- DBG_ASSERT( pPrevNode, "pPrevNode = 0!" );
+ assert(pPrevNode && "pPrevNode = 0!");
rpNodePos = new EditNodeIdx(mpEditEngine, pPrevNode);
rCntPos = pPrevNode->Len();
}
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 3140c16a22ab..ee1ae9f13857 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -711,7 +711,7 @@ void ImpEditEngine::TextModified()
void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode )
{
- OSL_ENSURE( pNode, "ParaAttribsChanged: Which one?" );
+ assert(pNode && "ParaAttribsChanged: Which one?");
aEditDoc.SetModified( true );
bFormatted = false;
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index cb2393b5279b..86a8090875c2 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4135,7 +4135,7 @@ EditPaM ImpEditEngine::InsertParagraph( sal_Int32 nPara )
ContentNode* pNode = GetEditDoc().GetObject( nPara-1 );
if ( !pNode )
pNode = GetEditDoc().GetObject( GetEditDoc().Count() - 1 );
- DBG_ASSERT( pNode, "Not a single paragraph in InsertParagraph ?" );
+ assert(pNode && "Not a single paragraph in InsertParagraph ?");
aPaM = EditPaM( pNode, pNode->Len() );
}
else
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index b4d725649604..7ba47c463c84 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -664,7 +664,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
::sd::ViewShellBase* pBase =
::sd::ViewShellBase::GetViewShellBase (
pViewFrame);
- OSL_ASSERT (pBase!=NULL);
+ assert(pBase!=NULL);
::boost::shared_ptr<sd::ViewShell> pViewSh = pBase->GetMainViewShell();
SdOptions* pOptions = GetSdOptions(pDoc->GetDocumentType());
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 4d172e02f431..7514812e1442 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -449,7 +449,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
pOutliner->SetPaperSize(pPage->GetSize());
SvStream* pStream = pMedium->GetInStream();
- DBG_ASSERT( pStream, "No InStream!" );
+ assert(pStream && "No InStream!");
pStream->Seek( 0 );
sal_uLong nErr = pOutliner->Read( *pStream, pMedium->GetBaseURL(), nFormat, mpDocSh->GetHeaderAttributes() );
@@ -469,7 +469,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
pPage = (SdPage*)(&(pPage->TRG_GetMasterPage()));
}
- DBG_ASSERT(pPage, "page not found");
+ assert(pPage && "page not found");
// if editing is going on right now, let it flow into this text object
OutlinerView* pOutlinerView = mpView->GetTextEditOutlinerView();
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index f27e41990591..5d0eadfe7627 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3861,7 +3861,7 @@ void SvTreeListBox::EnableList( bool _bEnable )
void SvTreeListBox::FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const
{
- DBG_ASSERT( pEntry, "SvTreeListBox::FillAccessibleEntryStateSet: invalid entry" );
+ assert(pEntry && "SvTreeListBox::FillAccessibleEntryStateSet: invalid entry");
if ( pEntry->HasChildrenOnDemand() || pEntry->HasChildren() )
{
diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx
index 2a1b854e048d..5795f19f83a2 100644
--- a/svx/source/accessibility/ChildrenManager.cxx
+++ b/svx/source/accessibility/ChildrenManager.cxx
@@ -57,30 +57,24 @@ ChildrenManager::~ChildrenManager (void)
OSL_TRACE ("~ChildrenManager");
}
-
-
-
long ChildrenManager::GetChildCount (void) const throw ()
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
return mpImpl->GetChildCount();
}
-
-
-
::com::sun::star::uno::Reference<XAccessible> ChildrenManager::GetChild (long nIndex)
throw (::com::sun::star::uno::RuntimeException,
::com::sun::star::lang::IndexOutOfBoundsException)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
return mpImpl->GetChild (nIndex);
}
Reference<XAccessible> ChildrenManager::GetChild (const Reference<drawing::XShape>& xShape)
throw (::com::sun::star::uno::RuntimeException)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
return mpImpl->GetChild (xShape);
}
@@ -89,93 +83,67 @@ Reference<XAccessible> ChildrenManager::GetChild (const Reference<drawing::XShap
throw (::com::sun::star::uno::RuntimeException,
::com::sun::star::lang::IndexOutOfBoundsException)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
return mpImpl->GetChildShape(nIndex);
}
void ChildrenManager::Update (bool bCreateNewObjectsOnDemand)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->Update (bCreateNewObjectsOnDemand);
}
-
-
-
void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes>& xShapeList)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->SetShapeList (xShapeList);
}
-
-
-
void ChildrenManager::AddAccessibleShape (css::uno::Reference<css::accessibility::XAccessible> const & shape)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->AddAccessibleShape (shape);
}
-
-
-
void ChildrenManager::ClearAccessibleShapeList (void)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->ClearAccessibleShapeList ();
}
-
-
-
void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->SetInfo (rShapeTreeInfo);
}
-
-
-
void ChildrenManager::UpdateSelection (void)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->UpdateSelection ();
}
-
-
-
bool ChildrenManager::HasFocus (void)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
return mpImpl->HasFocus ();
}
-
-
-
void ChildrenManager::RemoveFocus (void)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->RemoveFocus ();
}
-
-
-
//===== IAccessibleViewForwarderListener ====================================
void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
{
- OSL_ASSERT (mpImpl != NULL);
+ assert(mpImpl != NULL);
mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
}
-
-
} // end of namespace accessibility
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index c0d01aacc604..6f68134d5dfa 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -629,7 +629,7 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
else
m_pAccessible->fireEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS, Any(), makeAny(pItem->GetAccessible()) ); // this call asures that m_pItem is set
- OSL_ENSURE(pItem->m_pItem,"No accessible created!");
+ assert(pItem->m_pItem && "No accessible created!");
Any aOldAny, aNewAny;
aNewAny <<= AccessibleStateType::FOCUSED;
// Don't fire the focus event.
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 3d30b76b65c5..80b925599666 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -698,7 +698,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r
{
sal_uInt16 nMyType;
- DBG_ASSERT( pCurFmtTable != NULL, "Unknown number format!" );
+ assert(pCurFmtTable && "Unknown number format!");
const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
sal_uInt32 nNFEntry;
@@ -707,9 +707,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r
short nMyCat = SELPOS_NONE;
- long nIndex;
-
- for(nIndex=NF_DATETIME_START;nIndex<=NF_DATETIME_END;nIndex++)
+ for (long nIndex = NF_DATETIME_START; nIndex <= NF_DATETIME_END; ++nIndex)
{
nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage);
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 663e876a2fa9..946ffaca93f8 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -80,10 +80,10 @@ namespace sdr
ViewContact& ViewContactOfSdrObj::GetViewContact(sal_uInt32 nIndex) const
{
- DBG_ASSERT(GetSdrObject().GetSubList(),
+ assert(GetSdrObject().GetSubList() &&
"ViewContactOfSdrObj::GetViewContact: Access to non-existent Sub-List (!)");
SdrObject* pObj = GetSdrObject().GetSubList()->GetObj(nIndex);
- DBG_ASSERT(pObj, "ViewContactOfSdrObj::GetViewContact: Corrupt SdrObjList (!)");
+ assert(pObj && "ViewContactOfSdrObj::GetViewContact: Corrupt SdrObjList (!)");
return pObj->GetViewContact();
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index ce25218f3354..04ac457f7e8e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -482,14 +482,12 @@ namespace sdr
ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const
{
SdrObject* pObj = getPage().GetObj(nIndex);
- DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
+ assert(pObj && "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
return pObj->GetViewContact();
}
} // end of namespace contact
} // end of namespace sdr
-
-
namespace sdr
{
namespace contact
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 9bb5cfc41da7..9edcaf8186f8 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1450,7 +1450,7 @@ void SdrView::SetMasterPagePaintCaching(bool bOn)
for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
{
SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b);
- DBG_ASSERT(pPageWindow, "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
+ assert(pPageWindow && "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
// force deletion of ObjectContact, so at re-display all VOCs
// will be re-created with updated flag setting
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index ae46e24ecc12..14822d85831d 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2968,8 +2968,8 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PreviewPage*>& _rPreviewP
const SwPageFrm* _pSelectedPageFrm,
const Size& _rPreviewWinSize )
{
- OSL_ENSURE( GetShell()->IsPreview(), "no preview?" );
- OSL_ENSURE( mpPreview != NULL, "no preview data?" );
+ assert(GetShell()->IsPreview() && "no preview?");
+ assert(mpPreview != NULL && "no preview data?");
mpPreview->Update( *this, _rPreviewPages, _rScale, _pSelectedPageFrm, _rPreviewWinSize );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 24c2761873ee..8e357b7ac7ef 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -682,7 +682,8 @@ void _SaveRedlEndPosForRestore::_Restore()
/// The passed Node is located somewhere in the designated Section.
void SwDoc::DeleteSection( SwNode *pNode )
{
- OSL_ENSURE( pNode, "Didn't pass a Node." );
+ assert(pNode && "Didn't pass a Node.");
+
SwStartNode* pSttNd = pNode->IsStartNode() ? (SwStartNode*)pNode
: pNode->StartOfSectionNode();
SwNodeIndex aSttIdx( *pSttNd ), aEndIdx( *pNode->EndOfSectionNode() );
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 1d7ac9baac29..0aca2c689059 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1762,7 +1762,7 @@ bool SwFEShell::ImpEndCreate()
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
do {
pTmp = pTmp->FindMaster();
- OSL_ENSURE( pTmp, "Where's my Master?" );
+ assert(pTmp && "Where's my Master?");
nYOffset += pTmp->IsVertical() ?
pTmp->Prt().Width() : pTmp->Prt().Height();
} while ( pTmp->IsFollow() );
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index b485c84c9094..6dcbc8987b4e 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -280,7 +280,7 @@ void SwLayouter::EndLoopControl()
void SwLayouter::CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect )
{
- OSL_ENSURE( pDoc, "No doc, no fun" );
+ assert(pDoc && "No doc, no fun");
if( !pDoc->GetLayouter() )
pDoc->SetLayouter( new SwLayouter() );
pDoc->GetLayouter()->_CollectEndnotes( pSect );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index b89aed3fd965..fdc5f3e328c7 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1686,7 +1686,7 @@ void SwTableBox::RemoveFromTable()
{
// remove from table
const SwTableNode* pTblNd = pSttNd->FindTableNode();
- OSL_ENSURE( pTblNd, "In which table is that box?" );
+ assert(pTblNd && "In which table is that box?");
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTblNd->GetTable().
GetTabSortBoxes();
SwTableBox *p = this; // error: &this
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 47154c99ec9c..abb253924f3d 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2312,7 +2312,7 @@ void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext)
SwNode * pNd = & pPam->GetPoint()->nNode.GetNode();
SwStartNode* pSttNd = pNd->FindSttNodeByType( SwTableBoxStartNode );
- OSL_ENSURE( pSttNd, "without StartNode no TableBox" );
+ assert(pSttNd && "without StartNode no TableBox");
SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox(
pSttNd->GetIndex() );
OSL_ENSURE( pBox, "found no TableBox" );
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 99ada2c9f2c1..dc3e781d8e4b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2984,7 +2984,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
::svt::EmbeddedObjectRef xObjRef( xIPObj, nAspect );
pFmt2 = pDoc->Insert(aPam, xObjRef, &aFrmSet, NULL, NULL );
- OSL_ENSURE( pFmt2, "Doc->Insert(notxt) failed." );
+ assert(pFmt2 && "Doc->Insert(notxt) failed.");
pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFmt2->Add(this);
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 94376a035ce7..1c1e04091189 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -1266,10 +1266,9 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- OSL_ENSURE( pExpr, "no expression" );
+ assert(pExpr && "no expression");
// normal | small-caps
-
switch( pExpr->GetType() )
{
case CSS1_IDENT:
@@ -2131,7 +2130,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- OSL_ENSURE( pExpr, "no expression" );
+ assert(pExpr && "no expression");
sal_uInt16 nUpper = 0;
bool bSet = false;
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 64968e4ed946..0ac6d704eb23 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -132,7 +132,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
{
OUStringBuffer aOut;
const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
- assert(pSplit); //Wrong Which-ID
+ assert(pSplit && "Wrong Which-ID");
const unsigned int eEnum = (pSplit && pSplit->GetValue()) ? 1 : 0;
SvXMLUnitConverter::convertEnum( aOut, eEnum, aXML_KeepTogetherType );
aValue = aOut.makeStringAndClear();
@@ -493,7 +493,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_SHADOW:
{
const SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
- assert(pShadow); //Wrong Which-ID
+ assert(pShadow && "Wrong Which-ID");
if (pShadow)
{
sal_Int32 nX = 1, nY = 1;
@@ -534,7 +534,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BOX:
{
SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
- assert(pBox); //Wrong WHich-ID
+ assert(pBox && "Wrong Which-ID");
if (pBox)
{
/**
@@ -872,7 +872,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_KEEP:
{
SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
- assert(pFmtKeep); //Wrong Which-ID
+ assert(pFmtKeep && "Wrong Which-ID");
if (pFmtKeep)
{
aOut.append( pFmtKeep->GetValue()
@@ -1024,7 +1024,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_ROW_SPLIT:
{
const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
- assert(pSplit); //Wrong Which-ID
+ assert(pSplit && "Wrong Which-ID");
if (pSplit)
{
::sax::Converter::convertBool( aOut, pSplit->GetValue() );
@@ -1036,7 +1036,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_HORI_ORIENT:
{
SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
- assert(pHoriOrient); //Wrong Which-ID
+ assert(pHoriOrient && "Wrong Which-ID");
if (pHoriOrient)
{
SvXMLUnitConverter::convertEnum( aOut, pHoriOrient->GetHoriOrient(),
@@ -1049,7 +1049,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_VERT_ORIENT:
{
SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
- OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" );
+ assert(pVertOrient && "Wrong Which-ID");
SvXMLUnitConverter::convertEnum( aOut, pVertOrient->GetVertOrient(),
aXMLTableVAlignMap );
@@ -1114,7 +1114,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
case RES_COLLAPSING_BORDERS:
{
const SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
- assert(pBorders); //Wrong RES-ID
+ assert(pBorders && "Wrong RES-ID");
if (pBorders)
{
aOut.append( pBorders->GetValue()
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 59015aeb3f32..7093574fdf16 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -403,7 +403,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
if( rItem.bSynchron )
{
SfxDispatcher* pDisp = pViewFrame->GetDispatcher();
- OSL_ENSURE(pDisp, "No dispatcher in frame?");
+ assert(pDisp && "No dispatcher in frame?");
pDisp->Execute(FN_SYNC_LABELS, SFX_CALLMODE_ASYNCHRON);
}
rReq.SetReturnValue(SfxVoidItem(bLabel ? FN_LABEL : FN_BUSINESS_CARD));
diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index 0b4cec5417ec..ea9ab8f3b286 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -127,7 +127,7 @@ void SwViewOption::DrawRectPrinter( OutputDevice *pOut,
sal_uInt16 SwViewOption::GetPostItsWidth( const OutputDevice *pOut ) const
{
- OSL_ENSURE( pOut, "no Outdev" );
+ assert(pOut && "no Outdev");
return sal_uInt16(pOut->GetTextWidth( OUString(aPostItStr )));
}
diff --git a/sw/source/uibase/dialog/wordcountwrapper.cxx b/sw/source/uibase/dialog/wordcountwrapper.cxx
index 78cf4ee95a5b..ea45d52169c1 100644
--- a/sw/source/uibase/dialog/wordcountwrapper.cxx
+++ b/sw/source/uibase/dialog/wordcountwrapper.cxx
@@ -22,9 +22,9 @@ SwWordCountWrapper::SwWordCountWrapper( Window *pParentWindow,
SfxChildWindow(pParentWindow, nId)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+ assert(pFact && "SwAbstractDialogFactory fail!");
pAbstDlg = pFact->CreateSwWordCountDialog(pBindings, this, pParentWindow, pInfo);
- OSL_ENSURE(pAbstDlg, "Dialog construction failed!");
+ assert(pAbstDlg && "Dialog construction failed!");
pWindow = pAbstDlg->GetWindow();
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
diff --git a/sw/source/uibase/index/toxmgr.cxx b/sw/source/uibase/index/toxmgr.cxx
index 4099b3bde771..e18c4665d2fe 100644
--- a/sw/source/uibase/index/toxmgr.cxx
+++ b/sw/source/uibase/index/toxmgr.cxx
@@ -156,7 +156,7 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
// Update of TOXMarks
void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
{
- OSL_ENSURE(pCurTOXMark, "no current TOXMark");
+ assert(pCurTOXMark && "no current TOXMark");
pSh->StartAllAction();
if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
{
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 6e9ab88a6f72..9961b9902268 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -131,7 +131,7 @@ void SwView::InvalidateRulerPos()
GetViewFrame()->GetBindings().Invalidate(aInval);
- OSL_ENSURE(m_pHRuler, "Why is the ruler not there?");
+ assert(m_pHRuler && "Why is the ruler not there?");
m_pHRuler->ForceUpdate();
m_pVRuler->ForceUpdate();
}
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 12bcf3c7993e..c603cc985602 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -879,14 +879,14 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
0);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "Dialogdiet fail!");
+ assert(pFact && "Dialogdiet fail!");
boost::scoped_ptr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog(
this, aSet,
*pActiveShell,
0,
USHRT_MAX,
true));
- OSL_ENSURE(pDlg, "Dialogdiet fail!");
+ assert(pDlg && "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
SwTOXDescription& rDesc = pDlg->GetTOXDescription(
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 907f7b4d773c..029285702989 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -186,7 +186,7 @@ void VCLXAccessibleComponent::ProcessWindowEvent( const VclWindowEvent& rVclWind
uno::Any aOldValue, aNewValue;
Window* pAccWindow = rVclWindowEvent.GetWindow();
- DBG_ASSERT( pAccWindow, "VCLXAccessibleComponent::ProcessWindowEvent - Window?" );
+ assert(pAccWindow && "VCLXAccessibleComponent::ProcessWindowEvent - Window?");
switch ( rVclWindowEvent.GetId() )
{
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 660df5adeee0..65feb242e8af 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1092,7 +1092,8 @@ sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara
break; // correct Y-Position not needed
}
}
- DBG_ASSERT( pLine, "ImpFindIndex: pLine ?" );
+
+ assert(pLine && "ImpFindIndex: pLine ?");
nCurIndex = GetCharPos( nPortion, nLine, rPosInPara.X(), bSmart );
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index 53762040c4db..6cbfd523a5c6 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -590,7 +590,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer
const long nScanlineLeftOffset( pos.X*m_nBitsPerInputPixel/8 );
if( !m_aBmpEx.IsTransparent() )
{
- OSL_ENSURE(m_pBmpAcc,"Invalid bmp read access");
+ assert(m_pBmpAcc && "Invalid bmp read access");
// can return bitmap data as-is
Scanline pScan = m_pBmpAcc->GetScanline(pos.Y);
@@ -598,12 +598,12 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer
}
else
{
- OSL_ENSURE(m_pBmpAcc,"Invalid bmp read access");
- OSL_ENSURE(m_pAlphaAcc,"Invalid alpha read access");
+ assert(m_pBmpAcc && "Invalid bmp read access");
+ assert(m_pAlphaAcc && "Invalid alpha read access");
// interleave alpha with bitmap data - note, bitcount is
// always integer multiple of 8
- OSL_ENSURE((m_nBitsPerOutputPixel & 0x07) == 0,
+ assert((m_nBitsPerOutputPixel & 0x07) == 0 &&
"Transparent bitmap bitcount not integer multiple of 8" );
if( m_nBitsPerInputPixel < 8 )