diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:25:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:50 +0100 |
commit | 6cd7bf2043146a630925a2e49336f02c802f707a (patch) | |
tree | 786cecd8ab993e25cda497d45b68007050c30d61 /svx/source/svdraw/svdedtv2.cxx | |
parent | 28f4bee7bd7378141d8569186162e1a3166eb012 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I71682f28c6a54d33da6b0c971f34d0a705ff04f5
Diffstat (limited to 'svx/source/svdraw/svdedtv2.cxx')
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 851d1090d29e..42248be8ecae 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -49,12 +49,12 @@ using namespace com::sun::star; SdrObject* SdrEditView::GetMaxToTopObj(SdrObject* /*pObj*/) const { - return NULL; + return nullptr; } SdrObject* SdrEditView::GetMaxToBtmObj(SdrObject* /*pObj*/) const { - return NULL; + return nullptr; } void SdrEditView::ObjOrderChanged(SdrObject* /*pObj*/, sal_uIntPtr /*nOldPos*/, sal_uIntPtr /*nNewPos*/) @@ -77,7 +77,7 @@ void SdrEditView::MovMarkedToTop() GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; size_t nNewPos=0; for (size_t nm=nAnz; nm>0;) { @@ -94,7 +94,7 @@ void SdrEditView::MovMarkedToTop() const Rectangle& rBR=pObj->GetCurrentBoundRect(); size_t nCmpPos = nNowPos+1; SdrObject* pMaxObj=GetMaxToTopObj(pObj); - if (pMaxObj!=NULL) + if (pMaxObj!=nullptr) { size_t nMaxPos=pMaxObj->GetOrdNum(); if (nMaxPos!=0) @@ -108,7 +108,7 @@ void SdrEditView::MovMarkedToTop() while (nCmpPos<nNewPos && !bEnd) { SdrObject* pCmpObj=pOL->GetObj(nCmpPos); - if (pCmpObj==NULL) + if (pCmpObj==nullptr) { OSL_FAIL("MovMarkedToTop(): Reference object not found."); bEnd=true; @@ -165,7 +165,7 @@ void SdrEditView::MovMarkedToBtm() } bool bChg=false; - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; size_t nNewPos=0; for (size_t nm=0; nm<nAnz; ++nm) { @@ -183,7 +183,7 @@ void SdrEditView::MovMarkedToBtm() if (nCmpPos>0) --nCmpPos; SdrObject* pMaxObj=GetMaxToBtmObj(pObj); - if (pMaxObj!=NULL) + if (pMaxObj!=nullptr) { const size_t nMinPos=pMaxObj->GetOrdNum()+1; if (nNewPos<nMinPos) @@ -198,7 +198,7 @@ void SdrEditView::MovMarkedToBtm() while (nCmpPos>nNewPos && !bEnd) { SdrObject* pCmpObj=pOL->GetObj(nCmpPos); - if (pCmpObj==NULL) + if (pCmpObj==nullptr) { OSL_FAIL("MovMarkedToBtm(): Reference object not found."); bEnd=true; @@ -240,7 +240,7 @@ void SdrEditView::MovMarkedToBtm() void SdrEditView::PutMarkedToTop() { - PutMarkedInFrontOfObj(NULL); + PutMarkedInFrontOfObj(nullptr); } void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) @@ -254,7 +254,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) SortMarkedObjects(); - if (pRefObj!=NULL) + if (pRefObj!=nullptr) { // Make "in front of the object" work, even if the // selected objects are already in front of the other object @@ -277,7 +277,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; size_t nNewPos=0; for (size_t nm=nAnz; nm>0;) { @@ -294,7 +294,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) } const size_t nNowPos=pObj->GetOrdNumDirect(); SdrObject* pMaxObj=GetMaxToTopObj(pObj); - if (pMaxObj!=NULL) + if (pMaxObj!=nullptr) { size_t nMaxOrd=pMaxObj->GetOrdNum(); // sadly doesn't work any other way if (nMaxOrd>0) @@ -304,7 +304,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) if (nNewPos<nNowPos) nNewPos=nNowPos; // nor go into the other direction } - if (pRefObj!=NULL) + if (pRefObj!=nullptr) { if (pRefObj->GetObjList()==pObj->GetObjList()) { @@ -341,7 +341,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) void SdrEditView::PutMarkedToBtm() { - PutMarkedBehindObj(NULL); + PutMarkedBehindObj(nullptr); } void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) @@ -355,7 +355,7 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) BegUndo(ImpGetResStr(STR_EditPutToBtm),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_PUTTOBTM); SortMarkedObjects(); - if (pRefObj!=NULL) + if (pRefObj!=nullptr) { // Make "behind the object" work, even if the // selected objects are already behind the other object @@ -377,7 +377,7 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; size_t nNewPos=0; for (size_t nm=0; nm<nAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); @@ -390,12 +390,12 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) } const size_t nNowPos=pObj->GetOrdNumDirect(); SdrObject* pMinObj=GetMaxToBtmObj(pObj); - if (pMinObj!=NULL) { + if (pMinObj!=nullptr) { const size_t nMinOrd=pMinObj->GetOrdNum()+1; // sadly doesn't work any differently if (nNewPos<nMinOrd) nNewPos=nMinOrd; // neither go faster... if (nNewPos>nNowPos) nNewPos=nNowPos; // nor go into the other direction } - if (pRefObj!=NULL) { + if (pRefObj!=nullptr) { if (pRefObj->GetObjList()==pObj->GetObjList()) { const size_t nMinOrd=pRefObj->GetOrdNum(); // sadly doesn't work any differently if (nNewPos<nMinOrd) nNewPos=nMinOrd; // neither go faster... @@ -488,19 +488,19 @@ void SdrEditView::ImpCheckToTopBtmPossible() size_t nMin=0; const size_t nObjNum=pObj->GetOrdNum(); SdrObject* pRestrict=GetMaxToTopObj(pObj); - if (pRestrict!=NULL) { + if (pRestrict!=nullptr) { const size_t nRestrict=pRestrict->GetOrdNum(); if (nRestrict<nMax) nMax=nRestrict; } pRestrict=GetMaxToBtmObj(pObj); - if (pRestrict!=NULL) { + if (pRestrict!=nullptr) { const size_t nRestrict=pRestrict->GetOrdNum(); if (nRestrict>nMin) nMin=nRestrict; } bToTopPossible=nObjNum<nMax-1; bToBtmPossible=nObjNum>nMin; } else { // multiple selection - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; size_t nPos0 = 0; for (size_t nm = 0; !bToBtmPossible && nm<nAnz; ++nm) { // check 'send to background' SdrObject* pObj=GetMarkedObjectByIndex(nm); @@ -514,7 +514,7 @@ void SdrEditView::ImpCheckToTopBtmPossible() nPos0 = nPos; } - pOL0=NULL; + pOL0=nullptr; nPos0 = SAL_MAX_SIZE; for (size_t nm=nAnz; !bToTopPossible && nm>0; ) { // check 'bring to front' --nm; @@ -537,9 +537,9 @@ void SdrEditView::ImpCheckToTopBtmPossible() void SdrEditView::ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const { - if (pSource!=NULL) { + if (pSource!=nullptr) { SdrObjList* pOL=pSource->GetSubList(); - if (pOL!=NULL && !pSource->Is3DObj()) { // get first non-group object from group + if (pOL!=nullptr && !pSource->Is3DObj()) { // get first non-group object from group SdrObjListIter aIter(*pOL,IM_DEEPNOGROUPS); pSource=aIter.Next(); } @@ -770,7 +770,7 @@ void SdrEditView::DistributeMarkedObjects() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(NULL, aNewAttr)); + std::unique_ptr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(nullptr, aNewAttr)); DBG_ASSERT(pDlg, "Dialog creation failed!"); sal_uInt16 nResult = pDlg->Execute(); @@ -1001,12 +1001,12 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) BegUndo(); size_t nInsPos = SAL_MAX_SIZE; - const SdrObject* pAttrObj = NULL; + const SdrObject* pAttrObj = nullptr; basegfx::B2DPolyPolygon aMergePolyPolygonA; basegfx::B2DPolyPolygon aMergePolyPolygonB; - SdrObjList* pInsOL = NULL; - SdrPageView* pInsPV = NULL; + SdrObjList* pInsOL = nullptr; + SdrPageView* pInsPV = nullptr; bool bFirstObjectComplete(false); // make sure selected objects are contour objects @@ -1266,14 +1266,14 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) // continue as before basegfx::B2DPolyPolygon aPolyPolygon; - SdrObjList* pAktOL = 0L; + SdrObjList* pAktOL = nullptr; SdrMarkList aRemoveMerker; SortMarkedObjects(); size_t nInsPos = SAL_MAX_SIZE; - SdrObjList* pInsOL = 0L; - SdrPageView* pInsPV = 0L; - const SdrObject* pAttrObj = 0L; + SdrObjList* pInsOL = nullptr; + SdrPageView* pInsPV = nullptr; + const SdrObject* pAttrObj = nullptr; for(size_t a = GetMarkedObjectCount(); a; ) { @@ -1514,7 +1514,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, if(pSrcPath) { // #i74631# redesigned due to XpolyPolygon removal and explicit constructors - SdrObject* pLast = 0; // to be able to apply OutlinerParaObject + SdrObject* pLast = nullptr; // to be able to apply OutlinerParaObject const basegfx::B2DPolyPolygon& rPolyPolygon(pSrcPath->GetPathPoly()); const sal_uInt32 nPolyCount(rPolyPolygon.count()); @@ -1609,7 +1609,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, { // #i37011# also create a text object and add at rPos + 1 SdrObject* pTextObj = SdrObjFactory::MakeNewObject( - pCustomShape->GetObjInventor(), OBJ_TEXT, 0L, pCustomShape->GetModel()); + pCustomShape->GetObjInventor(), OBJ_TEXT, nullptr, pCustomShape->GetModel()); // Copy text content OutlinerParaObject* pParaObj = pCustomShape->GetOutlinerParaObject(); @@ -1670,7 +1670,7 @@ void SdrEditView::DismantleMarkedObjects(bool bMakeLines) BegUndo("", "", bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS); } - SdrObjList* pOL0=NULL; + SdrObjList* pOL0=nullptr; for (size_t nm=GetMarkedObjectCount(); nm>0;) { --nm; SdrMark* pM=GetSdrMarkByIndex(nm); @@ -1683,7 +1683,7 @@ void SdrEditView::DismantleMarkedObjects(bool bMakeLines) const size_t nPos0=pObj->GetOrdNumDirect(); size_t nPos=nPos0+1; SdrObjList* pSubList=pObj->GetSubList(); - if (pSubList!=NULL && !pObj->Is3DObj()) { + if (pSubList!=nullptr && !pObj->Is3DObj()) { SdrObjListIter aIter(*pSubList,IM_DEEPNOGROUPS); while (aIter.IsMore()) { const SdrObject* pObj1=aIter.Next(); @@ -1748,8 +1748,8 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp) // make sure OrdNums are correct if (pSrcLst->IsObjOrdNumsDirty()) pSrcLst->RecalcObjOrdNums(); - SdrObject* pGrp=NULL; - SdrObjList* pDstLst=NULL; + SdrObject* pGrp=nullptr; + SdrObjList* pDstLst=nullptr; // if all selected objects come from foreign object lists. // the group object is the last one in the list. size_t nInsPos=pSrcLst->GetObjCount(); @@ -1760,14 +1760,14 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp) SdrMark* pM=GetSdrMarkByIndex(nm); if (pM->GetPageView()==pPV) { - if (pGrp==NULL) + if (pGrp==nullptr) { - if (pUserGrp!=NULL) + if (pUserGrp!=nullptr) pGrp=pUserGrp->Clone(); - if (pGrp==NULL) + if (pGrp==nullptr) pGrp=new SdrObjGroup; pDstLst=pGrp->GetSubList(); - DBG_ASSERT(pDstLst!=NULL,"Alleged group object doesn't return object list."); + DBG_ASSERT(pDstLst!=nullptr,"Alleged group object doesn't return object list."); } SdrObject* pObj=pM->GetMarkedSdrObj(); pSrcLst=pObj->GetObjList(); @@ -1792,7 +1792,7 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp) pSrcLst0=pSrcLst; } } - if (pGrp!=NULL) + if (pGrp!=nullptr) { aNewMark.InsertEntry(SdrMark(pGrp,pPV)); const size_t nAnz=pDstLst->GetObjCount(); @@ -1837,7 +1837,7 @@ void SdrEditView::UnGroupMarked() SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pGrp=pM->GetMarkedSdrObj(); SdrObjList* pSrcLst=pGrp->GetSubList(); - if (pSrcLst!=NULL) { + if (pSrcLst!=nullptr) { nCount++; if (nCount==1) { aName = pGrp->TakeObjNameSingul(); // retrieve name of group @@ -1922,11 +1922,11 @@ void SdrEditView::UnGroupMarked() SdrObject* SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea) { SdrObject* pNewObj = pObj->ConvertToPolyObj(bPath, bLineToArea); - if (pNewObj!=NULL) + if (pNewObj!=nullptr) { SdrObjList* pOL=pObj->GetObjList(); - DBG_ASSERT(pOL!=NULL,"ConvertTo: Object doesn't return object list"); - if (pOL!=NULL) + DBG_ASSERT(pOL!=nullptr,"ConvertTo: Object doesn't return object list"); + if (pOL!=nullptr) { const bool bUndo = IsUndoEnabled(); if( bUndo ) @@ -1982,7 +1982,7 @@ void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea) } } else { SdrObject* pNewObj=ImpConvertOneObj(pObj,bPath,bLineToArea); - if (pNewObj!=NULL) { + if (pNewObj!=nullptr) { bMrkChg=true; GetMarkedObjectListWriteAccess().ReplaceMark(SdrMark(pNewObj,pPV),nm); } @@ -2023,7 +2023,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) for (size_t nm=nAnz; nm>0;) { // create Undo objects for all new objects // check for cancellation between the metafiles - if( pProgrInfo != NULL ) + if( pProgrInfo != nullptr ) { pProgrInfo->SetNextObject(); if(!pProgrInfo->ReportActions(0)) @@ -2061,7 +2061,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo); } } - if ( pOle2!=NULL && pOle2->GetGraphic() ) + if ( pOle2!=nullptr && pOle2->GetGraphic() ) { aLogicRect = pOle2->GetLogicRect(); ImpSdrGDIMetaFileImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect); |