diff options
100 files changed, 687 insertions, 730 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index b4f0d27bb8f1..c34a3b7e2602 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -704,8 +704,8 @@ void DlgEditor::Copy() } // insert control models of marked objects into clipboard dialog model - sal_uLong nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount(); - for( sal_uLong i = 0; i < nMark; i++ ) + const size_t nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount(); + for( size_t i = 0; i < nMark; ++i ) { SdrObject* pObj = pDlgEdView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj(); DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj); @@ -1017,9 +1017,9 @@ void DlgEditor::Delete() return; // remove control models of marked objects from dialog model - sal_uLong nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount(); + const size_t nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount(); - for( sal_uLong i = 0; i < nMark; i++ ) + for( size_t i = 0; i < nMark; ++i ) { SdrObject* pObj = pDlgEdView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj(); DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj); diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx index e68f7ebd0a44..c7346c8f3dbf 100644 --- a/basctl/source/dlged/propbrw.cxx +++ b/basctl/source/dlged/propbrw.cxx @@ -236,8 +236,8 @@ Sequence< Reference< XInterface > > Sequence< Reference< XInterface > > aSeq; InterfaceArray aInterfaces; - sal_uInt32 nMarkCount = _rMarkList.GetMarkCount(); - for( sal_uInt32 i = 0 ; i < nMarkCount ; i++ ) + const size_t nMarkCount = _rMarkList.GetMarkCount(); + for( size_t i = 0 ; i < nMarkCount ; ++i ) { SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj(); @@ -471,7 +471,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView } const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uInt32 nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if ( nMarkCount == 0 ) { diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index b4710781ceb2..ca0cff406751 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1862,14 +1862,14 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView ) // consider anchor position (for Writer) const SdrMarkList& rMarkList = m_pSdrView->GetMarkedObjectList(); - if( rMarkList.GetMarkCount() >= 1 ) + if( rMarkList.GetMarkCount() > 0 ) { const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); m_aAnchorPos = pObj->GetAnchorPos(); if( m_aAnchorPos != Point(0,0) ) // -> Writer { - for( sal_uLong i = 1; i < rMarkList.GetMarkCount(); i++ ) + for( size_t i = 1; i < rMarkList.GetMarkCount(); ++i ) { pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( m_aAnchorPos != pObj->GetAnchorPos() ) diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 722d38bfee25..54485a8be001 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -715,7 +715,7 @@ void SvxPositionSizeTabPage::Construct() if(!maAnchor.equalZero()) // -> Writer { - for(sal_uInt16 i(1); i < rMarkList.GetMarkCount(); i++) + for(size_t i = 1; i < rMarkList.GetMarkCount(); ++i) { pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx index 88a71e219cc8..d4e2f2fae33f 100644 --- a/include/svx/svdhdl.hxx +++ b/include/svx/svdhdl.hxx @@ -441,7 +441,7 @@ public: class SVX_DLLPUBLIC SdrHdlList { protected: - sal_uIntPtr mnFocusIndex; + size_t mnFocusIndex; SdrMarkView* pView; std::deque<SdrHdl*> aList; sal_uInt16 nHdlSize; @@ -474,9 +474,9 @@ public: // 2.Level PageView (Pointer) // 3.Level Position (x+y) void Sort(); - sal_uIntPtr GetHdlCount() const { return aList.size(); } - SdrHdl* GetHdl(sal_uIntPtr nNum) const { return nNum != CONTAINER_ENTRY_NOTFOUND ? aList[nNum] : NULL; } - sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const; + size_t GetHdlCount() const { return aList.size(); } + SdrHdl* GetHdl(size_t nNum) const { return nNum<aList.size() ? aList[nNum] : NULL; } + size_t GetHdlNum(const SdrHdl* pHdl) const; void SetHdlSize(sal_uInt16 nSiz); sal_uInt16 GetHdlSize() const { return nHdlSize; } void SetMoveOutside(bool bOn); @@ -489,7 +489,7 @@ public: // AddHdl uebernimmt das Handle in sein Eigentum. Es muss // also auf dem Heap stehen, da Clear() ein delete macht. void AddHdl(SdrHdl* pHdl, bool bAtBegin=false); - SdrHdl* RemoveHdl(sal_uIntPtr nNum); + SdrHdl* RemoveHdl(size_t nNum); void RemoveAllByKind(SdrHdlKind eKind); // Zuletzt eingefuegte Handles werden am ehesten getroffen diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx index 97f5b8d4b08b..7c5181f8845e 100644 --- a/include/svx/svdmark.hxx +++ b/include/svx/svdmark.hxx @@ -212,16 +212,17 @@ public: mbSorted = false; } - sal_uLong GetMarkCount() const + size_t GetMarkCount() const { return maList.size(); } - SdrMark* GetMark(sal_uLong nNum) const; - sal_uLong FindObject(const SdrObject* pObj) const; + SdrMark* GetMark(size_t nNum) const; + // returns SAL_MAX_SIZE if not found + size_t FindObject(const SdrObject* pObj) const; void InsertEntry(const SdrMark& rMark, bool bChkSort = true); - void DeleteMark(sal_uLong nNum); - void ReplaceMark(const SdrMark& rNewMark, sal_uLong nNum); + void DeleteMark(size_t nNum); + void ReplaceMark(const SdrMark& rNewMark, size_t nNum); void Merge(const SdrMarkList& rSrcList, bool bReverse = false); bool DeletePageView(const SdrPageView& rPV); bool InsertPageView(const SdrPageView& rPV); diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index 02e695ce4785..1401b919b517 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -241,13 +241,14 @@ protected: public: // all available const methods for read access to selection const SdrMarkList& GetMarkedObjectList() const { return mpSdrViewSelection->GetMarkedObjectList(); } - sal_uIntPtr TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); } - SdrPageView* GetSdrPageViewOfMarkedByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); } - SdrMark* GetSdrMarkByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum); } - SdrObject* GetMarkedObjectByIndex(sal_uIntPtr nNum) const { return (GetMarkedObjectList().GetMark(nNum))->GetMarkedSdrObj(); } - sal_uIntPtr GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); } + // returns SAL_MAX_SIZE if not found + size_t TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); } + SdrPageView* GetSdrPageViewOfMarkedByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); } + SdrMark* GetSdrMarkByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum); } + SdrObject* GetMarkedObjectByIndex(size_t nNum) const { return (GetMarkedObjectList().GetMark(nNum))->GetMarkedSdrObj(); } + size_t GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); } void SortMarkedObjects() const { GetMarkedObjectList().ForceSort(); } - bool AreObjectsMarked() const { return (0L != GetMarkedObjectList().GetMarkCount()); } + bool AreObjectsMarked() const { return 0 != GetMarkedObjectList().GetMarkCount(); } OUString GetDescriptionOfMarkedObjects() const { return GetMarkedObjectList().GetMarkDescription(); } OUString GetDescriptionOfMarkedPoints() const { return GetMarkedObjectList().GetPointMarkDescription(); } OUString GetDescriptionOfMarkedGluePoints() const { return GetMarkedObjectList().GetGluePointMarkDescription(); } @@ -279,13 +280,13 @@ public: // SDRSEARCH_DEEP SDRSEARCH_ALSOONMASTER SDRSEARCH_TESTMARKABLE SDRSEARCH_TESTTEXTEDIT // SDRSEARCH_WITHTEXT SDRSEARCH_TESTTEXTAREA SDRSEARCH_BACKWARD SDRSEARCH_MARKED // SDRSEARCH_WHOLEPAGE - virtual bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, sal_uIntPtr* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const; + virtual bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, size_t* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const; virtual bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const; // bool PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); } bool MarkObj(const Point& rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false); // Pick: Supported options for nOptions are SDRSEARCH_PASS2BOUND und SDRSEARCH_PASS3NEAREST - bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr* pnMarkNum=NULL, sal_uIntPtr nOptions=0) const; + bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, size_t* pnMarkNum=NULL, sal_uIntPtr nOptions=0) const; // Selects the most upper of the marked objects (O1) and scans from there // towards bottom direction, selecting the first non-marked object (O2). @@ -349,9 +350,9 @@ public: bool MarkNextPoint(const Point& rPnt, bool bPrev=false); // Search for the number of the suitable handle. In case of empty search result, - // CONTAINER_ENTRY_NOTFOUND is returned. - sal_uIntPtr GetHdlNum(SdrHdl* pHdl) const { return aHdl.GetHdlNum(pHdl); } - SdrHdl* GetHdl(sal_uIntPtr nHdlNum) const { return aHdl.GetHdl(nHdlNum); } + // SAL_MAX_SIZE is returned. + size_t GetHdlNum(SdrHdl* pHdl) const { return aHdl.GetHdlNum(pHdl); } + SdrHdl* GetHdl(size_t nHdlNum) const { return aHdl.GetHdl(nHdlNum); } const SdrHdlList& GetHdlList() const { return aHdl; } // Draw a selection frame for marking of points. diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 3c560569345c..b26e6bf0b21b 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -341,14 +341,14 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb // insert control models of marked objects into clipboard dialog model const SdrMarkList& rMarkedList = m_pView->GetMarkedObjectList(); - const sal_uLong nMark = rMarkedList.GetMarkCount(); + const size_t nMark = rMarkedList.GetMarkCount(); ::std::vector< uno::Reference<report::XReportComponent> > aCopies; aCopies.reserve(nMark); SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory(); - for( sal_uLong i = nMark; i > 0; ) + for( size_t i = nMark; i > 0; ) { --i; SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj(); @@ -690,9 +690,8 @@ uno::Reference< report::XReportComponent > OReportSection::getCurrentControlMode if ( m_pView ) { const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList(); - sal_uInt32 nMarkCount = rMarkList.GetMarkCount(); - if ( nMarkCount == 1 ) + if ( rMarkList.GetMarkCount() == 1 ) { SdrObject* pDlgEdObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj); @@ -708,9 +707,9 @@ void OReportSection::fillControlModelSelection(::std::vector< uno::Reference< un if ( m_pView ) { const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList(); - const sal_uInt32 nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); - for (sal_uInt32 i=0; i < nMarkCount; ++i) + for (size_t i=0; i < nMarkCount; ++i) { const SdrObject* pDlgEdObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); const OObjectBase* pObj = dynamic_cast<const OObjectBase*>(pDlgEdObj); diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index 78df59de958e..3aa7c372a6f6 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -146,9 +146,9 @@ void OSectionView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject ) { const SdrMarkList& rMarkedList = GetMarkedObjectList(); - const sal_uLong nMark = rMarkedList.GetMarkCount(); + const size_t nMark = rMarkedList.GetMarkCount(); - for( sal_uLong i = 0; i < nMark; i++ ) + for( size_t i = 0; i < nMark; ++i ) { SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj(); if (_pObject == pSdrObj) @@ -171,8 +171,8 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) BegUndo( ); const SdrMarkList& rMark = GetMarkedObjectList(); - sal_uLong nCount = rMark.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMark.GetMarkCount(); + for (size_t i = 0; i<nCount; ++i) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( pObj->ISA(OCustomShape) ) @@ -202,19 +202,18 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) bool OSectionView::OnlyShapesMarked() const { const SdrMarkList& rMark = GetMarkedObjectList(); - const sal_uLong nCount = rMark.GetMarkCount(); + const size_t nCount = rMark.GetMarkCount(); if ( !nCount ) return false; - sal_uLong i=0; - for (; i<nCount; i++) + for (size_t i = 0; i<nCount; ++i) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( !pObj->ISA(OCustomShape) ) { - break; + return false; } } - return i == nCount; + return true; } bool OSectionView::IsDragResize() const @@ -237,7 +236,7 @@ short OSectionView::GetLayerIdOfMarkedObjects() const { short nRet = SHRT_MAX; const SdrMarkList &rMrkList = GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( nRet == SHRT_MAX ) diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index e30b797ad74e..154eaf9c1b18 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -651,8 +651,8 @@ void OViewsWindow::collectRectangles(TRectangleMap& _rSortRectangles, bool _bBo if ( rView.AreObjectsMarked() ) { rView.SortMarkedObjects(); - const sal_uInt32 nCount = rView.GetMarkedObjectCount(); - for (sal_uInt32 i=0; i < nCount; ++i) + const size_t nCount = rView.GetMarkedObjectCount(); + for (size_t i=0; i < nCount; ++i) { const SdrMark* pM = rView.GetSdrMarkByIndex(i); SdrObject* pObj = pM->GetMarkedSdrObj(); @@ -1074,8 +1074,8 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi if ( rView.AreObjectsMarked() ) { - const sal_uInt32 nCount = rView.GetMarkedObjectCount(); - for (sal_uInt32 i=0; i < nCount; ++i) + const size_t nCount = rView.GetMarkedObjectCount(); + for (size_t i=0; i < nCount; ++i) { const SdrMark* pM = rView.GetSdrMarkByIndex(i); SdrObject* pObj = pM->GetMarkedSdrObj(); @@ -1433,7 +1433,7 @@ sal_uInt32 OViewsWindow::getMarkedObjectCount() const TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); for (; aIter != aEnd; ++aIter) - nCount += (*aIter)->getReportSection().getSectionView().GetMarkedObjectCount(); + nCount += static_cast<sal_uInt32>((*aIter)->getReportSection().getSectionView().GetMarkedObjectCount()); return nCount; } @@ -1518,7 +1518,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) } bool bCheck = false; const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i ) + for (size_t i = 0; !bCheck && i < rMarkList.GetMarkCount(); ++i ) { SdrMark* pMark = rMarkList.GetMark(i); bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL|| dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()); @@ -1606,7 +1606,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) Rectangle aNewRect; bool bCheck = false; const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i ) + for (size_t i = 0; !bCheck && i < rMarkList.GetMarkCount(); ++i ) { SdrMark* pMark = rMarkList.GetMark(i); bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL || dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()) != NULL; diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index ffc1a6b84dd8..087ad6e3fd3d 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -557,7 +557,7 @@ bool DlgEdFunc::isOnlyCustomShapeMarked() { bool bReturn = true; const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList(); - for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i ) + for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i ) { SdrMark* pMark = rMarkList.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -738,7 +738,7 @@ bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) { OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController(); const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList(); - for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i ) + for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i ) { SdrMark* pMark = rMarkList.GetMark(i); OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()); diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 5534b5143cf9..bd7be0fe74c2 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -280,11 +280,11 @@ bool PropBrw::Close() uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const SdrMarkList& _rMarkList) { - sal_uInt32 nMarkCount = _rMarkList.GetMarkCount(); + const size_t nMarkCount = _rMarkList.GetMarkCount(); ::std::vector< uno::Reference< uno::XInterface> > aSets; aSets.reserve(nMarkCount); - for(sal_uInt32 i=0;i<nMarkCount;++i) + for(size_t i=0; i<nMarkCount; ++i) { SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj(); diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 4195ff60c850..83b67b22d1ba 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -634,8 +634,8 @@ static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB OSL_ENSURE(pDestPV,"PageView ?"); const SdrMarkList& rMarkList = rSource.GetMarkedObjectList(); - sal_uLong nCount = rMarkList.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMarkList.GetMarkCount(); + for (size_t i=0; i<nCount; ++i) { SdrMark* pMark = rMarkList.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 813935134cdc..0ad7efe45a09 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -82,7 +82,7 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView { // handle selection on drawing layer const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if ( nMarkCount ) { if ( nMarkCount == 1 ) diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 6994a2463171..a63cd3f37bed 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -106,7 +106,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SdrModel* pDoc = pViewData->GetDocument()->GetDrawLayer(); const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); SdrObject* pSingleSelectedObj = NULL; if ( nMarkCount > 0 ) pSingleSelectedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 54a6ee8ddea5..294e630e0d90 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -96,8 +96,7 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Zustaende / Toggles // Notes always default to Page anchor. bool bDisableAnchor = false; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); - if ( nMarkCount == 1 ) + if ( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); if( ScDrawLayer::IsNoteCaption( pObj ) ) @@ -145,7 +144,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl } const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if ( nMarkCount <= 1 || !pView->IsGroupPossible() ) rSet.DisableItem( SID_GROUP ); @@ -363,8 +362,8 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet) bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark) { bool bResult=true; - sal_uLong nCount = rMark.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMark.GetMarkCount(); + for (size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( !pObj->ISA(SdrUnoObj) ) diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 8294f683225f..614d49ff3cb4 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -66,13 +66,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink { ScDrawView* pView = pViewData->GetScDrawView(); const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); // Hyperlink SvxHyperlinkItem aHLinkItem; - if ( nMarkCount == 1 ) // URL-Button markiert ? + if ( rMarkList.GetMarkCount() == 1 ) // URL-Button markiert ? { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); @@ -476,10 +475,10 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) case SID_RENAME_OBJECT: { - if(1L == pView->GetMarkedObjectCount()) + if(1 == pView->GetMarkedObjectCount()) { // #i68101# - SdrObject* pSelected = pView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = pView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)"); if(SC_LAYER_INTERN != pSelected->GetLayer()) @@ -545,9 +544,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) // #i68101# case SID_TITLE_DESCRIPTION_OBJECT: { - if(1L == pView->GetMarkedObjectCount()) + if(1 == pView->GetMarkedObjectCount()) { - SdrObject* pSelected = pView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = pView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)"); if(SC_LAYER_INTERN != pSelected->GetLayer()) diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 59a9a5e1ab6b..aef82de665ea 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -619,7 +619,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) // restore point with focus SdrHdl* pNewOne = 0L; - for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++) + for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a) { SdrHdl* pAct = rHdlList.GetHdl(a); @@ -783,8 +783,8 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) bool FuDraw::IsEditingANote() const { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_Int32 backval=rMarkList.GetMarkCount(); - for (sal_Int32 nlv1=0;nlv1<backval;nlv1++) + const size_t backval=rMarkList.GetMarkCount(); + for (size_t nlv1=0; nlv1<backval; ++nlv1) { SdrObject* pObj = rMarkList.GetMark( nlv1 )->GetMarkedSdrObj(); if ( ScDrawLayer::IsNoteCaption( pObj ) ) diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 415e5a436b4e..75fea9f31369 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -413,8 +413,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if ( pView && pDocument ) { const SdrMarkList& rSdrMarkList = pView->GetMarkedObjectList(); - sal_uLong nMarkCount = rSdrMarkList.GetMarkCount(); - for ( sal_uLong i = 0; i < nMarkCount; ++i ) + const size_t nMarkCount = rSdrMarkList.GetMarkCount(); + for ( size_t i = 0; i < nMarkCount; ++i ) { SdrMark* pMark = rSdrMarkList.GetMark( i ); pObj = ( pMark ? pMark->GetMarkedSdrObj() : NULL ); @@ -468,11 +468,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) /* if multi-selection contains a note caption object, remove all other objects from selection. */ const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uLong nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); if( nCount > 1 ) { bool bFound = false; - for( sal_uLong nIdx = 0; !bFound && (nIdx < nCount); ++nIdx ) + for( size_t nIdx = 0; !bFound && (nIdx < nCount); ++nIdx ) { pObj = rMarkList.GetMark( nIdx )->GetMarkedSdrObj(); bFound = ScDrawLayer::IsNoteCaption( pObj ); diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 911b1a69c059..ec407b1fe328 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -164,7 +164,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) { SdrHdl* pHdl = pView->PickHandle(aMDPos); - sal_uLong nHdlNum = pView->GetHdlNum(pHdl); + const size_t nHdlNum = pView->GetHdlNum(pHdl); if (pHdl != NULL) { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 604a714b30a4..10292a991eb0 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -873,7 +873,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() if (pDrawView) { const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if (nMarkCount) { // ShapeCollection erzeugen (wie in SdXImpressView::getSelection im Draw) @@ -884,7 +884,7 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() uno::Reference<uno::XInterface> xRet(xShapes); - for (sal_uLong i=0; i<nMarkCount; i++) + for (size_t i=0; i<nMarkCount; ++i) { SdrObject* pDrawObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if (pDrawObj) diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx index cfdc4f9f4087..f4a702525df3 100644 --- a/sc/source/ui/view/drawvie3.cxx +++ b/sc/source/ui/view/drawvie3.cxx @@ -59,8 +59,8 @@ void ScDrawView::SetPageAnchored() { SdrObject* pObj = NULL; const SdrMarkList* pMark = &GetMarkedObjectList(); - sal_uLong nCount = pMark->GetMarkCount(); - for( sal_uLong i=0; i<nCount; i++ ) + const size_t nCount = pMark->GetMarkCount(); + for( size_t i=0; i<nCount; ++i ) { pObj = pMark->GetMark(i)->GetMarkedSdrObj(); ScDrawLayer::SetPageAnchored( *pObj ); @@ -84,8 +84,8 @@ void ScDrawView::SetCellAnchored() { SdrObject* pObj = NULL; const SdrMarkList* pMark = &GetMarkedObjectList(); - sal_uLong nCount = pMark->GetMarkCount(); - for( sal_uLong i=0; i<nCount; i++ ) + const size_t nCount = pMark->GetMarkCount(); + for( size_t i=0; i<nCount; ++i ) { pObj = pMark->GetMark(i)->GetMarkedSdrObj(); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab); @@ -106,9 +106,9 @@ ScAnchorType ScDrawView::GetAnchorType() const if( AreObjectsMarked() ) { const SdrMarkList* pMark = &GetMarkedObjectList(); - sal_uLong nCount = pMark->GetMarkCount(); + const size_t nCount = pMark->GetMarkCount(); const SdrObject* pObj = NULL; - for( sal_uLong i=0; i<nCount; i++ ) + for( size_t i=0; i<nCount; ++i ) { pObj = pMark->GetMark(i)->GetMarkedSdrObj(); if( ScDrawLayer::GetAnchorType( *pObj ) == SCA_CELL ) diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 841d23863e17..d9c0a691ce6d 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -58,8 +58,8 @@ Point aDragStartDiff; void ScDrawView::CheckOle( const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneOle ) { rAnyOle = rOneOle = false; - sal_uLong nCount = rMarkList.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMarkList.GetMarkCount(); + for (size_t i=0; i<nCount; ++i) { SdrMark* pMark = rMarkList.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -464,8 +464,8 @@ void ScDrawView::SetMarkedOriginalSize() const SdrMarkList& rMarkList = GetMarkedObjectList(); long nDone = 0; - sal_uLong nCount = rMarkList.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMarkList.GetMarkCount(); + for (size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); sal_uInt16 nIdent = pObj->GetObjIdentifier(); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 2dc101875926..24a8c5a2d77e 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -135,8 +135,8 @@ ScDrawView::~ScDrawView() void ScDrawView::AddCustomHdl() { const SdrMarkList &rMrkList = GetMarkedObjectList(); - sal_uInt32 nCount = rMrkList.GetMarkCount(); - for(sal_uInt32 nPos=0; nPos<nCount; nPos++ ) + const size_t nCount = rMrkList.GetMarkCount(); + for(size_t nPos=0; nPos<nCount; ++nPos ) { SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj(); if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab)) @@ -214,8 +214,8 @@ void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo ) BegUndo( ScGlobal::GetRscString( STR_UNDO_SELATTR ) ); const SdrMarkList& rMark = GetMarkedObjectList(); - sal_uLong nCount = rMark.GetMarkCount(); - for (sal_uLong i=0; i<nCount; i++) + const size_t nCount = rMark.GetMarkCount(); + for (size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( !pObj->ISA(SdrUnoObj) && (pObj->GetLayer() != SC_LAYER_INTERN) ) @@ -383,7 +383,7 @@ void ScDrawView::MarkListHasChanged() SdrGrafObj* pGrafObj = NULL; const SdrMarkList& rMarkList = GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if ( nMarkCount == 0 && !pViewData->GetViewShell()->IsDrawSelMode() && !bInConstruct ) { @@ -427,7 +427,7 @@ void ScDrawView::MarkListHasChanged() { bool bOnlyControls = true; bool bOnlyGraf = true; - for (sal_uLong i=0; i<nMarkCount; i++) + for (size_t i=0; i<nMarkCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if ( pObj->ISA( SdrObjGroup ) ) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index bf777ae03a20..7055bef0f397 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4481,8 +4481,8 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel ) SdrView* pDrawView = pViewData->GetViewShell()->GetSdrView(); if (pDrawView) { - sal_uLong nCount = pDrawView->GetMarkedObjectCount(); - for (sal_uLong i = 0; i < nCount; ++i) + const size_t nCount = pDrawView->GetMarkedObjectCount(); + for (size_t i = 0; i < nCount; ++i) { SdrObject* pObj = pDrawView->GetMarkedObjectByIndex(i); if (pObj && pObj->GetLogicRect().IsInside(aLogicPos)) diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 47004061ec3d..fef41354be2b 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -150,8 +150,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, SdrMarkList aMark = pDragEditView->GetMarkedObjectList(); aMark.ForceSort(); - sal_uLong nMarkAnz=aMark.GetMarkCount(); - for (sal_uLong nm=0; nm<nMarkAnz; nm++) { + const size_t nMarkAnz=aMark.GetMarkCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { const SdrMark* pM=aMark.GetMark(nm); const SdrObject* pObj=pM->GetMarkedSdrObj(); diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 19b3f5ac0716..e5676c4d105f 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -679,7 +679,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt ) // restore point with focus SdrHdl* pNewOne = 0L; - for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++) + for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a) { SdrHdl* pAct = rHdlList.GetHdl(a); @@ -833,10 +833,13 @@ bool MotionPathTag::MarkPoints(const Rectangle* pRect, bool bUnmark ) if( mpPathObj && isSelected() ) { - sal_Int32 nHdlNum = mrView.GetHdlList().GetHdlCount() - 1; - while( nHdlNum > 0 ) + size_t nHdlNum = mrView.GetHdlList().GetHdlCount(); + if ( nHdlNum <= 1 ) + return false; + + while( --nHdlNum > 0 ) { - SmartHdl* pHdl = dynamic_cast< SmartHdl* >( mrView.GetHdl( sal::static_int_cast< sal_uLong >( nHdlNum-- ) ) ); + SmartHdl* pHdl = dynamic_cast< SmartHdl* >( mrView.GetHdl( nHdlNum ) ); if( pHdl && (pHdl->getTag().get() == this) && mrView.IsPointMarkable(*pHdl) && pHdl->IsSelected() == bUnmark) { @@ -930,13 +933,12 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) mpPathObj->AddToHdlList( aTemp ); const SdrUShortCont* pMrkPnts=mpMark->GetMarkedPoints(); - sal_uInt32 nHandle; - for( nHandle = 0; nHandle < aTemp.GetHdlCount(); ++nHandle ) + for( size_t nHandle = 0; nHandle < aTemp.GetHdlCount(); ++nHandle ) { SdrHdl* pTempHdl = aTemp.GetHdl( nHandle ); SmartHdl* pSmartHdl = new SmartHdl( xThis, mpPathObj, pTempHdl->GetPos(), pTempHdl->GetKind() ); - pSmartHdl->SetObjHdlNum( nHandle ); + pSmartHdl->SetObjHdlNum( static_cast<sal_uInt32>(nHandle) ); pSmartHdl->SetPolyNum( pTempHdl->GetPolyNum() ); pSmartHdl->SetPointNum( pTempHdl->GetPointNum() ); pSmartHdl->SetPlusHdl( pTempHdl->IsPlusHdl() ); @@ -971,7 +973,7 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) if(!aRect.IsEmpty()) { - sal_uLong nCount = rHandlerList.GetHdlCount(); + size_t nCount = rHandlerList.GetHdlCount(); bool bWdt0=aRect.Left()==aRect.Right(); bool bHgt0=aRect.Top()==aRect.Bottom(); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 434cac4886a6..a1049582d5f1 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -797,7 +797,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) // clone object(s) and insert the clone(s) into the list const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD); sal_uLong nCloneCount = pPage->GetObjCount(); @@ -916,7 +916,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) // take objects separately if( bAllObjects ) { - for( sal_uLong nObject= 0; nObject < nMarkCount; nObject++ ) + for( size_t nObject= 0; nObject < nMarkCount; ++nObject ) { // Clone SdrObject* pObject = rMarkList.GetMark( nObject )->GetMarkedSdrObj(); @@ -943,7 +943,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) SdrObjGroup* pCloneGroup = new SdrObjGroup; SdrObjList* pObjList = pCloneGroup->GetSubList(); - for (sal_uLong nObject= 0; nObject < nMarkCount; nObject++) + for (size_t nObject= 0; nObject < nMarkCount; ++nObject) pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone(), CONTAINER_APPEND); pPage->InsertObject(pCloneGroup, m_nCurrentFrame + 1); diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index 1b1757b286ad..2c7fe94e93f9 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -69,8 +69,8 @@ OutlineBulletDlg::OutlineBulletDlg( if( pView ) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - const sal_uLong nCount = rMarkList.GetMarkCount(); - for(sal_uLong nNum = 0; nNum < nCount; nNum++) + const size_t nCount = rMarkList.GetMarkCount(); + for(size_t nNum = 0; nNum < nCount; ++nNum) { SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor ) diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index 8a16803424af..50e5c9bee598 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -187,9 +187,8 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) { // toggle between selection and rotation SdrObject* pSingleObj = NULL; - sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount(); - if (nMarkCount==1) + if (mpView->GetMarkedObjectList().GetMarkCount()==1) { pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index e237f82e21f4..c4bc3d791c1f 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -183,7 +183,7 @@ void FuCopy::DoExecute( SfxRequest& rReq ) } const SdrMarkList aMarkList( mpView->GetMarkedObjectList() ); - const sal_uLong nMarkCount = aMarkList.GetMarkCount(); + const size_t nMarkCount = aMarkList.GetMarkCount(); SdrObject* pObj = NULL; // calculate number of possible copies @@ -221,10 +221,10 @@ void FuCopy::DoExecute( SfxRequest& rReq ) // get newly selected objects SdrMarkList aCopyMarkList( mpView->GetMarkedObjectList() ); - sal_uLong j, nCopyMarkCount = aMarkList.GetMarkCount(); + const size_t nCopyMarkCount = aMarkList.GetMarkCount(); // set protection flags at marked copies to null - for( j = 0; j < nCopyMarkCount; j++ ) + for( size_t j = 0; j < nCopyMarkCount; ++j ) { pObj = aCopyMarkList.GetMark( j )->GetMarkedSdrObj(); @@ -250,7 +250,7 @@ void FuCopy::DoExecute( SfxRequest& rReq ) // set protection flags at marked copies to original values if( nMarkCount == nCopyMarkCount ) { - for( j = 0; j < nMarkCount; j++ ) + for( size_t j = 0; j < nMarkCount; ++j ) { SdrObject* pSrcObj = aMarkList.GetMark( j )->GetMarkedSdrObj(); SdrObject* pDstObj = aCopyMarkList.GetMark( j )->GetMarkedSdrObj(); diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index 137923f6bbb0..dcf5ad77ecd5 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -109,7 +109,7 @@ bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt) { // if we text hit another shape than the one currently selected, unselect the old one now const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - if( rMarkList.GetMarkCount() >= 1 ) + if( rMarkList.GetMarkCount() > 0 ) { if( rMarkList.GetMarkCount() == 1 ) { @@ -272,9 +272,8 @@ void FuFormatPaintBrush::Paste( bool bNoCharacterFormats, bool bNoParagraphForma /* static */ void FuFormatPaintBrush::GetMenuState( DrawViewShell& rDrawViewShell, SfxItemSet &rSet ) { const SdrMarkList& rMarkList = rDrawViewShell.GetDrawView()->GetMarkedObjectList(); - const sal_uLong nMarkCount = rMarkList.GetMarkCount(); - if( nMarkCount == 1 ) + if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if( pObj && rDrawViewShell.GetDrawView()->SupportsFormatPaintbrush(pObj->GetObjInventor(),pObj->GetObjIdentifier()) ) diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 7af1159e8c01..0f1e27d7185d 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -78,8 +78,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) ::svl::IUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager(); const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - sal_uLong nCount = rMarkList.GetMarkCount(); - sal_uLong nObject = 0; + const size_t nCount = rMarkList.GetMarkCount(); short nAnimationSet = ATTR_MISSING; short nEffectSet = ATTR_MISSING; @@ -176,7 +175,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) } // if necessary, inspect more objects - for( nObject = 1; nObject < nCount; nObject++ ) + for( size_t nObject = 1; nObject < nCount; ++nObject ) { pMark = rMarkList.GetMark( nObject ); SdrObject* pObject = pMark->GetMarkedSdrObj(); @@ -672,7 +671,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoMoveObject( *pRunningObj, aDistance)); } - for (nObject = 0; nObject < nCount; nObject++) + for (size_t nObject = 0; nObject < nCount; ++nObject) { SdrObject* pObject = rMarkList.GetMark(nObject)->GetMarkedSdrObj(); diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 19b80cf0270a..790ac72413a5 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -319,9 +319,9 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u if( mpView ) { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - const sal_uInt32 nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); - for(sal_uInt32 nNum = 0; nNum < nCount; nNum++) + for(size_t nNum = 0; nNum < nCount; ++nNum) { SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor ) diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index a7cee8354098..d91aa0527915 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -556,7 +556,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) // restore point with focus SdrHdl* pNewOne = 0L; - for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++) + for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a) { SdrHdl* pAct = rHdlList.GetHdl(a); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 6347f5189778..0b0c1d41eb47 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -675,9 +675,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) * Toggle between selection and rotation **************************************************************/ SdrObject* pSingleObj = NULL; - sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount(); - if (nMarkCount==1) + if (mpView->GetMarkedObjectList().GetMarkCount()==1) { pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } @@ -803,7 +802,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) pHdl = NULL; mpWindow->ReleaseMouse(); SdrObject* pSingleObj = NULL; - sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount(); + const size_t nMarkCount = mpView->GetMarkedObjectList().GetMarkCount(); if (nMarkCount==1) { diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index b13949d3785a..cafa2da771b7 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1361,7 +1361,7 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFo { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - for( sal_uInt32 nMark = 0; nMark < rMarkList.GetMarkCount(); nMark++ ) + for( size_t nMark = 0; nMark < rMarkList.GetMarkCount(); ++nMark ) { SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( rMarkList.GetMark(nMark)->GetMarkedSdrObj() ); if( pTextObj ) diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx index 6ae27149da96..29085e674c23 100644 --- a/sd/source/ui/unoidl/SdUnoDrawView.cxx +++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx @@ -257,12 +257,12 @@ Any SAL_CALL SdUnoDrawView::getSelection() if( !aAny.hasValue() ) { const SdrMarkList& rMarkList = mrView.GetMarkedObjectList(); - sal_uInt32 nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); if( nCount ) { Reference< drawing::XShapes > xShapes( drawing::ShapeCollection::create( comphelper::getProcessComponentContext()), UNO_QUERY ); - for( sal_uInt32 nNum = 0; nNum < nCount; nNum++) + for( size_t nNum = 0; nNum < nCount; ++nNum) { SdrMark *pMark = rMarkList.GetMark(nNum); if(pMark==NULL) diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index f1ff82f842de..bcbef49ff39b 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -786,11 +786,12 @@ void Outliner::DetectChange (void) bool Outliner::DetectSelectionChange() { bool bSelectionHasChanged = false; - sal_uLong nMarkCount = mpView ? mpView->GetMarkedObjectList().GetMarkCount() : 0; // If mpObj is NULL then we have not yet found our first match. // Detecting a change makes no sense. if (mpObj != NULL) + { + const size_t nMarkCount = mpView ? mpView->GetMarkedObjectList().GetMarkCount() : 0; switch (nMarkCount) { case 0: @@ -813,6 +814,7 @@ bool Outliner::DetectSelectionChange() bSelectionHasChanged = true; break; } + } return bSelectionHasChanged; } @@ -1437,12 +1439,12 @@ void Outliner::HandleChangedSelection (void) { // Make a copy of the current mark list. const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - sal_uLong nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); if (nCount > 0) { maMarkListCopy.clear(); maMarkListCopy.reserve (nCount); - for (sal_uLong i=0; i<nCount; i++) + for (size_t i=0; i<nCount; ++i) maMarkListCopy.push_back (rMarkList.GetMark(i)->GetMarkedSdrObj ()); } else diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 54208aa8cb00..3a0a2b88cf99 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -267,8 +267,8 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, { // Selection const SdrMarkList& rList = GetMarkedObjectList(); - sal_uLong nMarkCount = rList.GetMarkCount(); - for (sal_uLong nMark = 0; nMark < nMarkCount; nMark++) + const size_t nMarkCount = rList.GetMarkCount(); + for (size_t nMark = 0; nMark < nMarkCount; ++nMark) { SdrObject* pObject = rList.GetMark(nMark)->GetMarkedSdrObj(); sal_uInt32 nInv = pObject->GetObjInventor(); @@ -554,11 +554,11 @@ void DrawView::DeleteMarked() SdPage* pPage = 0; bool bResetLayout = false; - const sal_uLong nMarkCount = GetMarkedObjectList().GetMarkCount(); + const size_t nMarkCount = GetMarkedObjectList().GetMarkCount(); if( nMarkCount ) { SdrMarkList aList( GetMarkedObjectList() ); - for (sal_uLong nMark = 0; nMark < nMarkCount; nMark++) + for (size_t nMark = 0; nMark < nMarkCount; ++nMark) { SdrObject* pObj = aList.GetMark(nMark)->GetMarkedSdrObj(); if( pObj && !pObj->IsEmptyPresObj() && pObj->GetUserCall() ) diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 3371a41f2dc7..8ce78f10baf7 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -785,7 +785,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // get some necessary info and ensure it const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList()); - const sal_uInt32 nMarkCount(rMarkList.GetMarkCount()); + const size_t nMarkCount(rMarkList.GetMarkCount()); SdrPageView* pPageView = mpDrawView->GetSdrPageView(); OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)"); OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)"); @@ -798,10 +798,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // #i71540# to keep the order, it is necessary to replace the lowest object // of the selection with the new object. This also means that with multi // selection, all other objects need to be deleted first - SdrMark* pFirstMark = rMarkList.GetMark(0L); + SdrMark* pFirstMark = rMarkList.GetMark(0); SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj(); - if(nMarkCount > 1L) + if(nMarkCount > 1) { // take first object out of selection mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true); @@ -844,7 +844,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) else { const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); // For every presentation object a SfxItemSet of hard attributes // and the UserCall is stored in this list. This is because @@ -852,9 +852,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // they get lost and have to be restored. std::vector<std::pair<SfxItemSet*,SdrObjUserCall*> > aAttrList; SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage(); - sal_uLong i; - for ( i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); @@ -871,7 +870,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) sal_uLong j = 0; - for ( i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; ++i ) { SfxStyleSheet* pSheet = NULL; SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); @@ -2113,10 +2112,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { // only allow for single object selection since the name of an object needs // to be unique - if(1L == mpDrawView->GetMarkedObjectCount()) + if(1 == mpDrawView->GetMarkedObjectCount()) { // #i68101# - SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); OUString aName(pSelected->GetName()); @@ -2146,9 +2145,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // #i68101# case SID_OBJECT_TITLE_DESCRIPTION: { - if(1L == mpDrawView->GetMarkedObjectCount()) + if(1 == mpDrawView->GetMarkedObjectCount()) { - SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); OUString aTitle(pSelected->GetTitle()); OUString aDescription(pSelected->GetDescription()); @@ -2350,11 +2349,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { WaitObject aWait( (Window*)GetActiveWindow() ); const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nAnz=rMarkList.GetMarkCount(); + const size_t nAnz=rMarkList.GetMarkCount(); // determine the sum of meta objects of all selected meta files sal_uLong nCount = 0; - for(sal_uLong nm=0; nm<nAnz; nm++) + for(size_t nm=0; nm<nAnz; ++nm) { SdrMark* pM=rMarkList.GetMark(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -2390,7 +2389,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); if( pFact ) { - boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, nAnz )); + boost::scoped_ptr<VclAbstractDialog> pDlg(pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, static_cast<sal_uLong>(nAnz) )); if( pDlg ) { pDlg->Execute(); diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index a84dbe36c7df..19e141367553 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -185,7 +185,7 @@ void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet ) sal_uInt16 nValue; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if( nMarkCount == 0 ) nValue = 0; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 005991c00a00..6c179c8b8ac6 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -266,7 +266,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) bool bConvertToPathPossible = mpDrawView->IsConvertToPathObjPossible(false); const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - const sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); //format paintbrush FuFormatPaintBrush::GetMenuState( *this, rSet ); @@ -961,7 +961,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) // kinds of NumBullets are marked bool bHasOutliner = false; bool bHasOther = false; - for(sal_uLong nNum = 0; nNum < nMarkCount; nNum++) + for(size_t nNum = 0; nNum < nMarkCount; ++nNum) { SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor ) @@ -1431,8 +1431,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) bool bFoundAny = false; bool bFoundTable = false; -// const int nMarkCount = (int) aMarkList.GetMarkCount(); - for (sal_uLong i=0; i < nMarkCount && !bFoundAny; i++) +// const size_t nMarkCount = aMarkList.GetMarkCount(); + for (size_t i=0; i < nMarkCount && !bFoundAny; ++i) { SdrObject* pObj= aMarkList.GetMark(i)->GetMarkedSdrObj(); sal_uInt16 nId = pObj->GetObjIdentifier(); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 9779ed22abb4..110289a158bb 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -722,13 +722,13 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) SdrLayerID nLayer = 0, nOldLayer = 0; SdrObject* pObj = NULL; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); bool bOneLayer = true; // Use the first ten selected shapes as a (hopefully // representative) sample of all shapes of the current page. // Detect whether they belong to the same layer. - for( sal_uLong j = 0; j < nMarkCount && bOneLayer && j < 10; j++ ) + for( size_t j = 0; j < nMarkCount && bOneLayer && j < 10; ++j ) { pObj = rMarkList.GetMark( j )->GetMarkedSdrObj(); if( pObj ) diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 6015d8ca95be..f9340b08ea56 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -344,9 +344,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) } else if (nSlotId == SID_OBJECT_SHEAR) { - sal_uLong i = 0; + size_t i = 0; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nMarkCnt = rMarkList.GetMarkCount(); + const size_t nMarkCnt = rMarkList.GetMarkCount(); bool b3DObjMarked = false; while (i < nMarkCnt && !b3DObjMarked) @@ -1359,7 +1359,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) mpDrawView->BegUndo(SD_RESSTR(STR_UNDO_COLORRESOLUTION)); const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - for (sal_uLong i=0; i<rMarkList.GetMarkCount(); i++) + for (size_t i=0; i<rMarkList.GetMarkCount(); ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 6e0f791ad3bd..0391bd31e6a3 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -647,8 +647,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { bool bEnable = false; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - const sal_uInt32 nMarkCount = rMarkList.GetMarkCount(); - for (sal_uInt32 nIndex = 0; nIndex < nMarkCount; nIndex++) + const size_t nMarkCount = rMarkList.GetMarkCount(); + for (size_t nIndex = 0; nIndex < nMarkCount; ++nIndex) { SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(rMarkList.GetMark(nIndex)->GetMarkedSdrObj()); if (pTextObj && pTextObj->GetObjInventor() == SdrInventor) diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index 2ada0a9cbad7..ad5283574b9b 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -79,9 +79,8 @@ void DrawViewShell::GetIMapState( SfxItemSet& rSet ) if( GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) ) { const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); - if ( nMarkCount == 1 ) + if ( rMarkList.GetMarkCount() == 1 ) { const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index d3bec9511d58..99f1d16409ef 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -61,7 +61,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) // Single selection const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - sal_uLong nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if ( nMarkCount == 1 ) { @@ -319,9 +319,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) bool bEdgeObj = false; // Connector bool bE3dCompoundObject = false; - for( sal_uLong i = 0; - i < nMarkCount && !bText && i < 50; - i++ ) + for( size_t i = 0; i < nMarkCount && !bText && i < 50; ++i ) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); sal_uInt32 nInv = pObj->GetObjInventor(); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index ebd7b0fbc21c..ff1267726d03 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -561,11 +561,10 @@ bool View::IsPresObjSelected(bool bOnPage, bool bOnMasterPage, bool bCheckPresOb bool bSelected = false; bool bMasterPage = false; - long nMark; - long nMarkMax = long(pMarkList->GetMarkCount()) - 1; - for (nMark = nMarkMax; (nMark >= 0) && !bSelected; nMark--) + for (size_t nMark = pMarkList->GetMarkCount(); nMark && !bSelected; ) { + --nMark; // Backwards through mark list pMark = pMarkList->GetMark(nMark); pObj = pMark->GetMarkedSdrObj(); @@ -835,10 +834,10 @@ bool View::RestoreDefaultText( SdrTextObj* pTextObj ) void View::SetMarkedOriginalSize() { SdrUndoGroup* pUndoGroup = new SdrUndoGroup(mrDoc); - sal_uLong nCount = GetMarkedObjectCount(); + const size_t nCount = GetMarkedObjectCount(); bool bOK = false; - for( sal_uInt32 i = 0; i < nCount; i++ ) + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = GetMarkedObjectByIndex(i); @@ -1261,8 +1260,8 @@ bool View::ShouldToggleOn( bool bToggleOn = false; boost::scoped_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrModel)); - sal_uInt32 nMarkCount = GetMarkedObjectCount(); - for (sal_uInt32 nIndex = 0; nIndex < nMarkCount && !bToggleOn; nIndex++) + const size_t nMarkCount = GetMarkedObjectCount(); + for (size_t nIndex = 0; nIndex < nMarkCount && !bToggleOn; ++nIndex) { SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(GetMarkedObjectByIndex(nIndex)); if (!pTextObj || pTextObj->IsTextEditActive()) @@ -1335,8 +1334,8 @@ void View::ChangeMarkedObjectsBulletsNumbering( boost::scoped_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrModel)); boost::scoped_ptr<OutlinerView> pOutlinerView(new OutlinerView(pOutliner.get(), pWindow)); - const sal_uInt32 nMarkCount = GetMarkedObjectCount(); - for (sal_uInt32 nIndex = 0; nIndex < nMarkCount; nIndex++) + const size_t nMarkCount = GetMarkedObjectCount(); + for (size_t nIndex = 0; nIndex < nMarkCount; ++nIndex) { SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(GetMarkedObjectByIndex(nIndex)); if (!pTextObj || pTextObj->IsTextEditActive()) diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 8e90a28870db..c60f9e728599 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -404,11 +404,11 @@ void View::DragFinished( sal_Int8 nDropAction ) if( bUndo ) BegUndo(); - sal_uLong nm, nAnz = mpDragSrcMarkList->GetMarkCount(); + const size_t nAnz = mpDragSrcMarkList->GetMarkCount(); - for( nm = nAnz; nm>0; ) + for( size_t nm = nAnz; nm>0; ) { - nm--; + --nm; SdrMark* pM=mpDragSrcMarkList->GetMark(nm); if( bUndo ) AddUndo(mrDoc.GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj())); @@ -416,9 +416,9 @@ void View::DragFinished( sal_Int8 nDropAction ) mpDragSrcMarkList->GetMark(0)->GetMarkedSdrObj()->GetOrdNum(); - for (nm=nAnz; nm>0;) + for (size_t nm = nAnz; nm>0;) { - nm--; + --nm; SdrMark* pM=mpDragSrcMarkList->GetMark(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -524,7 +524,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge { const SdrHdlList& rHdlList = GetHdlList(); - for( sal_uInt32 n = 0; n < rHdlList.GetHdlCount(); n++ ) + for( size_t n = 0; n < rHdlList.GetHdlCount(); ++n ) { SdrHdl* pIAOHandle = rHdlList.GetHdl( n ); @@ -678,7 +678,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar { const SdrHdlList& rHdlList = GetHdlList(); - for( sal_uInt32 n = 0; !nRet && n < rHdlList.GetHdlCount(); n++ ) + for( size_t n = 0; !nRet && n < rHdlList.GetHdlCount(); ++n ) { SdrHdl* pIAOHandle = rHdlList.GetHdl( n ); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 163970e20736..c620601d1d0f 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -381,7 +381,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, pOwnData->SetInternalMove( true ); SortMarkedObjects(); - for( sal_uLong nM = 0; nM < GetMarkedObjectCount(); nM++ ) + for( size_t nM = 0; nM < GetMarkedObjectCount(); ++nM ) { SdrMark* pM = GetSdrMarkByIndex( nM ); SdrObject* pO = pM->GetMarkedSdrObj(); @@ -439,7 +439,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // stuff to remember originals and clones std::vector<ImpRememberOrigAndClone*> aConnectorContainer; - sal_uInt32 a, nConnectorCount(0L); + size_t nConnectorCount = 0; Point aCurPos; // calculate real position of current @@ -458,7 +458,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, const Size aVector( maDropPos.X() - aCurPos.X(), maDropPos.Y() - aCurPos.Y() ); - for(a = 0; a < pMarkList->GetMarkCount(); a++) + for(size_t a = 0; a < pMarkList->GetMarkCount(); ++a) { SdrMark* pM = pMarkList->GetMark(a); SdrObject* pObj = pM->GetMarkedSdrObj()->Clone(); @@ -493,7 +493,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // try to re-establish connections at clones if(nConnectorCount) { - for(a = 0; a < aConnectorContainer.size(); a++) + for(size_t a = 0; a < aConnectorContainer.size(); ++a) { ImpRememberOrigAndClone* pRem = aConnectorContainer[a]; @@ -570,7 +570,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } // cleanup remember classes - for(a = 0; a < aConnectorContainer.size(); a++) + for(size_t a = 0; a < aConnectorContainer.size(); ++a) delete aConnectorContainer[a]; if( pMarkList != mpDragSrcMarkList ) diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 1c72efb9e8c6..440eaf748b77 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -412,7 +412,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) bReturn = GetViewShell()->KeyInput(rKEvt); } - sal_Int32 OriCount = GetView()->GetMarkedObjectList().GetMarkCount(); + const size_t OriCount = GetView()->GetMarkedObjectList().GetMarkCount(); if(!bReturn) { rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) ); @@ -441,7 +441,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) } } } - sal_Int32 EndCount = GetView()->GetMarkedObjectList().GetMarkCount(); + const size_t EndCount = GetView()->GetMarkedObjectList().GetMarkCount(); // Here, oriCount or endCount must have one value=0, another value > 0, then to switch focus between Document and shape objects if(bReturn && (OriCount + EndCount > 0) && (OriCount * EndCount == 0)) { @@ -738,11 +738,11 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& bool bTitle = false; if( mpView ) - { + { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - const sal_uInt32 nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); - for(sal_uInt32 nNum = 0; nNum < nCount; nNum++) + for(size_t nNum = 0; nNum < nCount; ++nNum) { SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor ) diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 74ffcab8b5f9..894de0ebb32e 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -652,7 +652,7 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCoun throw DisposedException(); const SdrMarkList& rList = mpView->GetMarkedObjectList(); - return rList.GetMarkCount(); + return static_cast<sal_Int32>(rList.GetMarkCount()); } @@ -667,7 +667,7 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAcce Reference< XAccessible > xAccessible; const SdrMarkList& rList = mpView->GetMarkedObjectList(); - SdrObject* pObj = rList.GetMark(nIndex)->GetMarkedSdrObj(); + SdrObject* pObj = rList.GetMark(static_cast<size_t>(nIndex))->GetMarkedSdrObj(); if( pObj ) xAccessible = getAccessible( pObj ); @@ -694,9 +694,8 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32 SdrPageView* pPV = mpView->GetSdrPageView(); mpView->UnmarkAllObj( pPV ); - sal_uInt32 nCount = aRefList.GetMarkCount(); - sal_uInt32 nMark; - for( nMark = 0; nMark < nCount; nMark++ ) + const size_t nCount = aRefList.GetMarkCount(); + for( size_t nMark = 0; nMark < nCount; ++nMark ) { if( aRefList.GetMark(nMark)->GetMarkedSdrObj() != pObj ) mpView->MarkObj( aRefList.GetMark(nMark)->GetMarkedSdrObj(), pPV ); diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index bc6d869de696..82153a3a0275 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -145,13 +145,13 @@ void SvxXConnectionPreview::Construct() DBG_ASSERT( pView, "No valid view is passed on! "); const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uIntPtr nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); if( nMarkCount >= 1 ) { bool bFound = false; - for( sal_uInt16 i = 0; i < nMarkCount && !bFound; i++ ) + for( size_t i = 0; i < nMarkCount && !bFound; ++i ) { const SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); sal_uInt32 nInv = pObj->GetObjInventor(); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 65a9538bc3ee..8e6316c37df5 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -580,7 +580,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) // restore point with focus SdrHdl* pNewOne = 0L; - for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++) + for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a) { SdrHdl* pAct = rHdlList.GetHdl(a); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index c076a8c078df..6156dee9a7e8 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -470,7 +470,7 @@ void IMapWindow::Command(const CommandEvent& rCEvt) { PopupMenu aMenu( SVX_RES( RID_SVXMN_IMAP ) ); const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - sal_uIntPtr nMarked = rMarkList.GetMarkCount(); + const size_t nMarked = rMarkList.GetMarkCount(); aMenu.EnableItem( MN_URL, false ); aMenu.EnableItem( MN_ACTIVATE, false ); diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index dd410bbeb231..e1c2fb6f105a 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -48,16 +48,15 @@ E3dDragMethod::E3dDragMethod ( mbMovedAtAll(false) { // Create a unit for all the 3D objects present in the selection - const long nCnt(rMark.GetMarkCount()); + const size_t nCnt(rMark.GetMarkCount()); static bool bDoInvalidate(false); - long nObjs(0); if(mbMoveFull) { // for non-visible 3D objects fallback to wireframe interaction bool bInvisibleObjects(false); - for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++) + for(size_t nObjs = 0; !bInvisibleObjects && nObjs < nCnt; ++nObjs) { E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj()); @@ -76,7 +75,7 @@ E3dDragMethod::E3dDragMethod ( } } - for(nObjs = 0;nObjs < nCnt;nObjs++) + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj()); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index bbbbe553079c..9702cacfdd9c 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -85,7 +85,7 @@ class Impl3DMirrorConstructOverlay const E3dView& mrView; // the object count - sal_uInt32 mnCount; + size_t mnCount; // the unmirrored polygons basegfx::B2DPolyPolygon* mpPolygons; @@ -121,7 +121,7 @@ Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView) // Do not use the last ViewPort set at the OC at the last ProcessDisplay() rOC.resetViewPort(); - for(sal_uInt32 a(0);a < mnCount;a++) + for(size_t a = 0; a < mnCount; ++a) { SdrObject* pObject = mrView.GetMarkedObjectByIndex(a); @@ -140,7 +140,7 @@ Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView) { mpPolygons = new basegfx::B2DPolyPolygon[mnCount]; - for(sal_uInt32 a(0); a < mnCount; a++) + for(size_t a = 0; a < mnCount; ++a) { SdrObject* pObject = mrView.GetMarkedObjectByIndex(a); mpPolygons[mnCount - (a + 1)] = pObject->TakeXorPoly(); @@ -209,7 +209,7 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr } else { - for(sal_uInt32 b(0); b < mnCount; b++) + for(size_t b = 0; b < mnCount; ++b) { // apply to polygon basegfx::B2DPolyPolygon aPolyPolygon(mpPolygons[b]); @@ -240,8 +240,8 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const bool bSpecialHandling = false; E3dScene *pScene = NULL; - long nCnt = GetMarkedObjectCount(); - for(long nObjs = 0;nObjs < nCnt;nObjs++) + const size_t nCnt = GetMarkedObjectCount(); + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) @@ -264,8 +264,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const { // Set selection flag to "not selected" for scenes related to all 3D // objects - long nObjs; - for(nObjs = 0;nObjs < nCnt;nObjs++) + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) @@ -277,7 +276,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const } } - for(nObjs = 0;nObjs < nCnt;nObjs++) + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dObject)) @@ -300,7 +299,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const } // Reset selection flag - for(nObjs = 0;nObjs < nCnt;nObjs++) + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) @@ -326,11 +325,10 @@ SdrModel* E3dView::GetMarkedObjModel() const { // Does 3D objects exist which scenes are not selected? bool bSpecialHandling(false); - const sal_uInt32 nCount(GetMarkedObjectCount()); - sal_uInt32 nObjs(0); + const size_t nCount(GetMarkedObjectCount()); E3dScene *pScene = 0; - for(nObjs = 0; nObjs < nCount; nObjs++) + for(size_t nObjs = 0; nObjs < nCount; ++nObjs) { const SdrObject* pObj = GetMarkedObjectByIndex(nObjs); @@ -369,7 +367,7 @@ SdrModel* E3dView::GetMarkedObjModel() const // set 3d selection flags at all directly selected objects // and collect SnapRect of selected objects - for(nObjs = 0; nObjs < nCount; nObjs++) + for(size_t nObjs = 0; nObjs < nCount; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); @@ -389,7 +387,7 @@ SdrModel* E3dView::GetMarkedObjModel() const SdrMarkList& rCurrentMarkList = ((E3dView*)this)->GetMarkedObjectListWriteAccess(); rCurrentMarkList = aNewML; - for(nObjs = 0; nObjs < nCount; nObjs++) + for(size_t nObjs = 0; nObjs < nCount; ++nObjs) { SdrObject *pObj = aOldML.GetMark(nObjs)->GetMarkedSdrObj(); @@ -612,7 +610,7 @@ bool E3dView::IsConvertTo3DObjPossible() const bool bGroupSelected(false); bool bRetval(true); - for(sal_uInt32 a=0;!bAny3D && a<GetMarkedObjectCount();a++) + for(size_t a=0; !bAny3D && a<GetMarkedObjectCount(); ++a) { SdrObject *pObj = GetMarkedObjectByIndex(a); if(pObj) @@ -902,7 +900,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, basegfx::B2DPoint aPnt1, baseg aInvLatheMat.invert(); // SnapRect extension enables mirroring in the axis of rotation - for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++) + for(size_t a=0; a<GetMarkedObjectCount(); ++a) { SdrMark* pMark = GetSdrMarkByIndex(a); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -942,7 +940,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, basegfx::B2DPoint aPnt1, baseg // Walk through the selection and convert it into 3D, complete with // Conversion to SdrPathObject, also fonts - for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++) + for(size_t a=0; a<GetMarkedObjectCount(); ++a) { SdrMark* pMark = GetSdrMarkByIndex(a); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -1213,13 +1211,13 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, bOwnActionNecessary = false; } - if(bOwnActionNecessary && GetMarkedObjectCount() >= 1) + if(bOwnActionNecessary && GetMarkedObjectCount() > 0) { E3dDragConstraint eConstraint = E3DDRAG_CONSTR_XYZ; bool bThereAreRootScenes = false; bool bThereAre3DObjects = false; - long nCnt = GetMarkedObjectCount(); - for(long nObjs = 0;nObjs < nCnt;nObjs++) + const size_t nCnt = GetMarkedObjectCount(); + for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj) @@ -1380,7 +1378,7 @@ void E3dView::Start3DCreation() // and then attach the marks at the top and bottom of the object basegfx::B2DRange aR; - for(sal_uInt32 nMark(0L); nMark < GetMarkedObjectCount(); nMark++) + for(size_t nMark = 0; nMark < GetMarkedObjectCount(); ++nMark) { SdrObject* pMark = GetMarkedObjectByIndex(nMark); basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly()); @@ -1544,13 +1542,11 @@ void E3dView::InitView () bool E3dView::IsBreak3DObjPossible() const { - sal_uIntPtr nCount = GetMarkedObjectCount(); + const size_t nCount = GetMarkedObjectCount(); if (nCount > 0) { - sal_uIntPtr i = 0; - - while (i < nCount) + for (size_t i = 0; i < nCount; ++i) { SdrObject* pObj = GetMarkedObjectByIndex(i); @@ -1563,8 +1559,6 @@ bool E3dView::IsBreak3DObjPossible() const { return false; } - - i++; } } else @@ -1580,10 +1574,10 @@ void E3dView::Break3DObj() if(IsBreak3DObjPossible()) { // ALL selected objects are changed - sal_uInt32 nCount = GetMarkedObjectCount(); + const size_t nCount = GetMarkedObjectCount(); BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_BREAK_LATHE)); - for(sal_uInt32 a=0;a<nCount;a++) + for(size_t a=0; a<nCount; ++a) { E3dObject* pObj = (E3dObject*)GetMarkedObjectByIndex(a); BreakSingle3DObj(pObj); @@ -1626,10 +1620,10 @@ void E3dView::CheckPossibilities() // Set other flags if(bGroupPossible || bUnGroupPossible || bGrpEnterPossible) { - sal_Int32 nMarkCnt = GetMarkedObjectCount(); + const size_t nMarkCnt = GetMarkedObjectCount(); bool bCoumpound = false; bool b3DObject = false; - for(sal_Int32 nObjs = 0L; (nObjs < nMarkCnt) && !bCoumpound; nObjs++) + for(size_t nObjs = 0; (nObjs < nMarkCnt) && !bCoumpound; ++nObjs) { SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj && pObj->ISA(E3dCompoundObject)) diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 07becc8004f1..8f194a49d56e 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -119,9 +119,9 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, bool /*bOnly3DAttr*/) co // calc flags for SID_ATTR_3D_INTERN const SdrMarkList& rMarkList = GetMarkedObjectList(); - sal_uInt32 nMarkCnt(rMarkList.GetMarkCount()); + const size_t nMarkCnt(rMarkList.GetMarkCount()); - for(sal_uInt32 a(0); a < nMarkCnt; a++) + for(size_t a = 0; a < nMarkCnt; ++a) { SdrObject* pObj = GetMarkedObjectByIndex(a); Imp_E3dView_InorderRun3DObjects(pObj, nSelectedItems); @@ -169,9 +169,9 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, bool // old run const SdrMarkList& rMarkList = GetMarkedObjectList(); - const sal_uInt32 nMarkCnt(rMarkList.GetMarkCount()); + const size_t nMarkCnt(rMarkList.GetMarkCount()); - for(sal_uInt32 a(0); a < nMarkCnt; a++) + for(size_t a = 0; a < nMarkCnt; ++a) { SdrObject* pObj = GetMarkedObjectByIndex(a); Imp_E3dView_InorderRun3DObjects(pObj, nSelectedItems); diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 8d8c5368923a..dab6033698ae 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -281,8 +281,8 @@ namespace { _rInterfaces.clear(); - sal_uInt32 nMarkCount = _rMarkList.GetMarkCount(); - for ( sal_uInt32 i = 0; i < nMarkCount; ++i) + const size_t nMarkCount = _rMarkList.GetMarkCount(); + for ( size_t i = 0; i < nMarkCount; ++i) { SdrObject* pCurrent = _rMarkList.GetMark( i )->GetMarkedSdrObj(); @@ -557,12 +557,12 @@ bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterface> bool isControlList(const SdrMarkList& rMarkList) { // enthaelt die liste nur Controls und mindestens ein control - sal_uInt32 nMarkCount = rMarkList.GetMarkCount(); + const size_t nMarkCount = rMarkList.GetMarkCount(); bool bControlList = nMarkCount != 0; bool bHadAnyLeafs = false; - for (sal_uInt32 i = 0; i < nMarkCount && bControlList; i++) + for (size_t i = 0; i < nMarkCount && bControlList; ++i) { SdrObject *pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); E3dObject* pAs3DObject = PTR_CAST(E3dObject, pObj); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 9dddc6769a42..850eda9f15e3 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1686,8 +1686,8 @@ void FmXFormView::ObjectRemovedInAliveMode( const SdrObject* pObject ) // muss ich es jetzt da rausnehmen, da ich sonst beim Zurueckschalten versuche, die Markierung wieder zu setzen // (interesanterweise geht das nur bei gruppierten Objekten schief (beim Zugriff auf deren ObjList GPF), nicht bei einzelnen) - sal_uIntPtr nCount = m_aMark.GetMarkCount(); - for (sal_uIntPtr i = 0; i < nCount; ++i) + const size_t nCount = m_aMark.GetMarkCount(); + for (size_t i = 0; i < nCount; ++i) { SdrMark* pMark = m_aMark.GetMark(i); SdrObject* pCurrent = pMark->GetMarkedSdrObj(); @@ -1739,8 +1739,8 @@ void FmXFormView::saveMarkList( bool _bSmartUnmark ) m_aMark = m_pView->GetMarkedObjectList(); if ( _bSmartUnmark ) { - sal_uIntPtr nCount = m_aMark.GetMarkCount( ); - for ( sal_uIntPtr i = 0; i < nCount; ++i ) + const size_t nCount = m_aMark.GetMarkCount( ); + for ( size_t i = 0; i < nCount; ++i ) { SdrMark* pMark = m_aMark.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -1806,15 +1806,15 @@ void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList ) bool bMisMatch = false; // loop through all current marks - sal_uIntPtr nCurrentCount = rCurrentList.GetMarkCount(); - for ( sal_uIntPtr i=0; i<nCurrentCount&& !bMisMatch; ++i ) + const size_t nCurrentCount = rCurrentList.GetMarkCount(); + for ( size_t i=0; i<nCurrentCount && !bMisMatch; ++i ) { const SdrObject* pCurrentMarked = rCurrentList.GetMark( i )->GetMarkedSdrObj(); // loop through all saved marks, check for equality bool bFound = false; - sal_uIntPtr nSavedCount = m_aMark.GetMarkCount(); - for ( sal_uIntPtr j=0; j<nSavedCount && !bFound; ++j ) + const size_t nSavedCount = m_aMark.GetMarkCount(); + for ( size_t j=0; j<nSavedCount && !bFound; ++j ) { if ( m_aMark.GetMark( j )->GetMarkedSdrObj() == pCurrentMarked ) bFound = true; @@ -1839,8 +1839,8 @@ void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList ) bool bFound = true; // gibt es noch alle Objecte - sal_uIntPtr nCount = m_aMark.GetMarkCount(); - for (sal_uIntPtr i = 0; i < nCount && bFound; i++) + const size_t nCount = m_aMark.GetMarkCount(); + for (size_t i = 0; i < nCount && bFound; ++i) { SdrMark* pMark = m_aMark.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); @@ -1861,7 +1861,7 @@ void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList ) // Das LastObject auswerten if (nCount) // Objecte jetzt Markieren { - for (sal_uIntPtr i = 0; i < nCount; i++) + for (size_t i = 0; i < nCount; ++i) { SdrMark* pMark = m_aMark.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index 9df5153eb98d..7ae2d7eb8385 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -824,7 +824,7 @@ namespace svxform FmNavRequestSelectHint rshRequestSelection; bool bIsMixedSelection = false; - for (sal_uLong i=0; (i<mlMarked.GetMarkCount()) && !bIsMixedSelection; i++) + for (size_t i=0; (i<mlMarked.GetMarkCount()) && !bIsMixedSelection; ++i) { SdrObject* pobjCurrent = mlMarked.GetMark(i)->GetMarkedSdrObj(); bIsMixedSelection |= !InsertFormComponent(rshRequestSelection, pobjCurrent); diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index 39d85fc73b8c..b994eb014324 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -311,7 +311,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SD ( sal_uInt32 SelectionAnalyzer::GetInventorTypeFromMark (const SdrMarkList& rMarkList) { - const sal_uLong nMarkCount (rMarkList.GetMarkCount()); + const size_t nMarkCount (rMarkList.GetMarkCount()); if (nMarkCount < 1) return 0; @@ -320,7 +320,7 @@ sal_uInt32 SelectionAnalyzer::GetInventorTypeFromMark (const SdrMarkList& rMarkL SdrObject* pObj = pMark->GetMarkedSdrObj(); const sal_uInt32 nFirstInv = pObj->GetObjInventor(); - for (sal_uLong nIndex=1; nIndex<nMarkCount; ++nIndex) + for (size_t nIndex=1; nIndex<nMarkCount; ++nIndex) { pMark = rMarkList.GetMark(nIndex); pObj = pMark->GetMarkedSdrObj(); @@ -393,7 +393,7 @@ sal_uInt16 SelectionAnalyzer::GetObjectTypeFromGroup (const SdrObject* pObj) sal_uInt16 SelectionAnalyzer::GetObjectTypeFromMark (const SdrMarkList& rMarkList) { - const sal_uLong nMarkCount (rMarkList.GetMarkCount()); + const size_t nMarkCount (rMarkList.GetMarkCount()); if (nMarkCount < 1) return 0; @@ -411,7 +411,7 @@ sal_uInt16 SelectionAnalyzer::GetObjectTypeFromMark (const SdrMarkList& rMarkLi if (IsTextObjType(nResultType)) nResultType = OBJ_TEXT; - for (sal_uLong nIndex=1; nIndex<nMarkCount; ++nIndex) + for (size_t nIndex=1; nIndex<nMarkCount; ++nIndex) { pMark = rMarkList.GetMark(nIndex); pObj = pMark->GetMarkedSdrObj(); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index c3d7f9791190..9c92001b56af 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -367,12 +367,12 @@ void SdrDragMethod::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, s void SdrDragMethod::createSdrDragEntries_SolidDrag() { - const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount()); + const size_t nMarkAnz(getSdrDragView().GetMarkedObjectCount()); SdrPageView* pPV = getSdrDragView().GetSdrPageView(); if(pPV) { - for(sal_uInt32 a(0); a < nMarkAnz; a++) + for(size_t a = 0; a < nMarkAnz; ++a) { SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(a); @@ -427,12 +427,12 @@ void SdrDragMethod::createSdrDragEntries_SolidDrag() void SdrDragMethod::createSdrDragEntries_PolygonDrag() { - const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount()); + const size_t nMarkAnz(getSdrDragView().GetMarkedObjectCount()); bool bNoPolygons(getSdrDragView().IsNoDragXorPolys() || nMarkAnz > getSdrDragView().GetDragXorPolyLimit()); basegfx::B2DPolyPolygon aResult; sal_uInt32 nPointCount(0); - for(sal_uInt32 a(0); !bNoPolygons && a < nMarkAnz; a++) + for(size_t a = 0; !bNoPolygons && a < nMarkAnz; ++a) { SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(a); @@ -474,10 +474,10 @@ void SdrDragMethod::createSdrDragEntries_PolygonDrag() void SdrDragMethod::createSdrDragEntries_PointDrag() { - const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount()); + const size_t nMarkAnz(getSdrDragView().GetMarkedObjectCount()); std::vector< basegfx::B2DPoint > aPositions; - for(sal_uInt32 nm(0); nm < nMarkAnz; nm++) + for(size_t nm = 0; nm < nMarkAnz; ++nm) { SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(nm); @@ -520,10 +520,10 @@ void SdrDragMethod::createSdrDragEntries_PointDrag() void SdrDragMethod::createSdrDragEntries_GlueDrag() { - const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount()); + const size_t nMarkAnz(getSdrDragView().GetMarkedObjectCount()); std::vector< basegfx::B2DPoint > aPositions; - for(sal_uInt32 nm(0); nm < nMarkAnz; nm++) + for(size_t nm = 0; nm < nMarkAnz; ++nm) { SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(nm); @@ -888,7 +888,7 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla const bool bDetail(getSdrDragView().IsDetailedEdgeDragging() && getMoveOnly()); const SdrMarkList& rMarkedNodes = getSdrDragView().GetEdgesOfMarkedNodes(); - for(sal_uInt16 a(0); a < rMarkedNodes.GetMarkCount(); a++) + for(size_t a = 0; a < rMarkedNodes.GetMarkCount(); ++a) { SdrMark* pEM = rMarkedNodes.GetMark(a); @@ -1680,13 +1680,13 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_) { // restrict glue points to the BoundRect of the Obj aPt1-=DragStat().GetStart(); const SdrMarkList& rML=GetMarkedObjectList(); - sal_uLong nMarkAnz=rML.GetMarkCount(); + const size_t nMarkAnz=rML.GetMarkCount(); - for (sal_uLong nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { const SdrMark* pM=rML.GetMark(nMarkNum); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); - sal_uLong nPtAnz=pPts==NULL ? 0 : pPts->size(); + const size_t nPtAnz=pPts==NULL ? 0 : pPts->size(); if (nPtAnz!=0) { @@ -3406,9 +3406,9 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy) if (bCopy) getSdrDragView().CopyMarkedObj(); - sal_uLong nMarkAnz=getSdrDragView().GetMarkedObjectList().GetMarkCount(); + const size_t nMarkAnz=getSdrDragView().GetMarkedObjectList().GetMarkCount(); - for (sal_uLong nm=0; nm<nMarkAnz; nm++) + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=getSdrDragView().GetMarkedObjectList().GetMark(nm); SdrObject* pO=pM->GetMarkedSdrObj(); diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 428ab361bd0e..0b047d5af76f 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -269,7 +269,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl { // are 3D objects selected? bool b3DObjSelected = false; - for(sal_uInt32 a=0;!b3DObjSelected && a<GetMarkedObjectCount();a++) + for(size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a) { SdrObject* pObj = GetMarkedObjectByIndex(a); if(pObj && pObj->ISA(E3dObject)) @@ -735,7 +735,7 @@ bool SdrDragView::BegInsGluePoint(const Point& rPnt) bool bRet=false; SdrObject* pObj; SdrPageView* pPV; - sal_uIntPtr nMarkNum; + size_t nMarkNum; if (PickMarkedObj(rPnt,pObj,pPV,&nMarkNum,SDRSEARCH_PASS2BOUND)) { BrkAction(); diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 802e0fafd88c..48a286f45017 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -344,10 +344,9 @@ void SdrEditView::ImpBroadcastEdgesOfMarkedNodes() } } - sal_uIntPtr nMarkedEdgeAnz = GetMarkedEdgesOfMarkedNodes().GetMarkCount(); - sal_uInt16 i; + const size_t nMarkedEdgeAnz = GetMarkedEdgesOfMarkedNodes().GetMarkCount(); - for (i=0; i<nMarkedEdgeAnz; i++) { + for (size_t i=0; i<nMarkedEdgeAnz; ++i) { SdrMark* pEM = GetMarkedEdgesOfMarkedNodes().GetMark(i); SdrObject* pEdgeTmp=pEM->GetMarkedSdrObj(); SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pEdgeTmp); @@ -474,11 +473,11 @@ void SdrEditView::CheckPossibilities() if (bPossibilitiesDirty) { ImpResetPossibilityFlags(); SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); + const size_t nMarkAnz=GetMarkedObjectCount(); if (nMarkAnz!=0) { bReverseOrderPossible=nMarkAnz>=2; - sal_uIntPtr nMovableCount=0; + size_t nMovableCount=0; bGroupPossible=nMarkAnz>=2; bCombinePossible=nMarkAnz>=2; if (nMarkAnz==1) { @@ -536,7 +535,7 @@ void SdrEditView::CheckPossibilities() bool bNoMovRotFound=false; const SdrPageView* pPV0=NULL; - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { + for (size_t nm=0; nm<nMarkAnz; ++nm) { const SdrMark* pM=GetSdrMarkByIndex(nm); const SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrPageView* pPV=pM->GetPageView(); @@ -655,7 +654,7 @@ void SdrEditView::CheckPossibilities() void SdrEditView::ForceMarkedObjToAnotherPage() { bool bFlg=false; - for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) { + for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); Rectangle aObjRect(pObj->GetCurrentBoundRect()); @@ -694,18 +693,17 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) const bool bUndo = IsUndoEnabled(); if( bUndo ) BegUndo(); - const sal_uInt32 nMarkAnz(rMark.GetMarkCount()); + const size_t nMarkAnz(rMark.GetMarkCount()); if(nMarkAnz) { - sal_uInt32 nm(0); std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters; if( bUndo ) { - for(nm = nMarkAnz; nm > 0;) + for(size_t nm = nMarkAnz; nm > 0;) { - nm--; + --nm; SdrMark* pM = rMark.GetMark(nm); SdrObject* pObj = pM->GetMarkedSdrObj(); @@ -722,9 +720,9 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) std::vector< SdrObject* > aRemoved3DObjects; - for(nm = nMarkAnz; nm > 0;) + for(size_t nm = nMarkAnz; nm > 0;) { - nm--; + --nm; SdrMark* pM = rMark.GetMark(nm); SdrObject* pObj = pM->GetMarkedSdrObj(); SdrObjList* pOL = pObj->GetObjList(); @@ -792,10 +790,9 @@ void SdrEditView::DeleteMarkedObj() { const SdrMarkList& rMarkList = GetMarkedObjectList(); - const sal_uInt32 nCount(rMarkList.GetMarkCount()); - sal_uInt32 a(0); + const size_t nCount(rMarkList.GetMarkCount()); - for(a = 0; a < nCount; a++) + for(size_t a = 0; a < nCount; ++a) { // in the first run, add all found parents, but only once SdrMark* pMark = rMarkList.GetMark(a); @@ -826,7 +823,7 @@ void SdrEditView::DeleteMarkedObj() // in a 2nd run, remove all objects which may already be scheduled for // removal. I am not sure if this can happen, but theoretically // a to-be-removed object may already be the group/3DScene itself - for(a = 0; a < nCount; a++) + for(size_t a = 0; a < nCount; ++a) { SdrMark* pMark = rMarkList.GetMark(a); SdrObject* pObject = pMark->GetMarkedSdrObj(); @@ -883,8 +880,8 @@ void SdrEditView::CopyMarkedObj() SdrMarkList aSourceObjectsForCopy(GetMarkedObjectList()); // The following loop is used instead of MarkList::Merge(), to be // able to flag the MarkEntries. - sal_uIntPtr nEdgeAnz = GetEdgesOfMarkedNodes().GetMarkCount(); - for (sal_uIntPtr nEdgeNum=0; nEdgeNum<nEdgeAnz; nEdgeNum++) { + const size_t nEdgeAnz = GetEdgesOfMarkedNodes().GetMarkCount(); + for (size_t nEdgeNum=0; nEdgeNum<nEdgeAnz; ++nEdgeNum) { SdrMark aM(*GetEdgesOfMarkedNodes().GetMark(nEdgeNum)); aM.SetUser(1); aSourceObjectsForCopy.InsertEntry(aM); @@ -898,10 +895,9 @@ void SdrEditView::CopyMarkedObj() const bool bUndo = IsUndoEnabled(); GetMarkedObjectListWriteAccess().Clear(); - sal_uIntPtr nCloneErrCnt=0; - sal_uIntPtr nMarkAnz=aSourceObjectsForCopy.GetMarkCount(); - sal_uIntPtr nm; - for (nm=0; nm<nMarkAnz; nm++) { + size_t nCloneErrCnt=0; + const size_t nMarkAnz=aSourceObjectsForCopy.GetMarkCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=aSourceObjectsForCopy.GetMark(nm); SdrObject* pO=pM->GetMarkedSdrObj()->Clone(); if (pO!=NULL) { @@ -929,7 +925,7 @@ void SdrEditView::CopyMarkedObj() // New mechanism to re-create the connections of cloned connectors aCloneList.CopyConnections(); - if(0L != nCloneErrCnt) + if(nCloneErrCnt) { #ifdef DBG_UTIL OStringBuffer aStr("SdrEditView::CopyMarkedObj(): Error when cloning "); diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index d8a96d92e500..81b056406827 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -71,7 +71,7 @@ void SdrEditView::SetMarkedObjRect(const Rectangle& rRect, bool bCopy) { DBG_ASSERT(!rRect.IsEmpty(),"SetMarkedObjRect() with an empty Rect does not make sense."); if (rRect.IsEmpty()) return; - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz==0) return; Rectangle aR0(GetMarkedObjRect()); DBG_ASSERT(!aR0.IsEmpty(),"SetMarkedObjRect(): GetMarkedObjRect() is empty."); @@ -96,7 +96,7 @@ void SdrEditView::SetMarkedObjRect(const Rectangle& rRect, bool bCopy) if (bCopy) CopyMarkedObj(); - for (sal_uIntPtr nm=0; nm<nAnz; nm++) + for (size_t nm=0; nm<nAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -194,8 +194,8 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy) if (bCopy) CopyMarkedObj(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -227,8 +227,8 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, cons if (bCopy) CopyMarkedObj(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -264,8 +264,8 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef, if (bCopy) CopyMarkedObj(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -333,13 +333,13 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy) double nSin=sin(nWink*nPi180); double nCos=cos(nWink*nPi180); - const sal_uInt32 nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); if(nMarkAnz) { std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters; - for(sal_uInt32 nm(0); nm < nMarkAnz; nm++) + for(size_t nm = 0; nm < nMarkAnz; ++nm) { SdrMark* pM = GetSdrMarkByIndex(nm); SdrObject* pO = pM->GetMarkedSdrObj(); @@ -393,13 +393,13 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b if (bCopy) CopyMarkedObj(); - const sal_uInt32 nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); if(nMarkAnz) { std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters; - for(sal_uInt32 nm(0); nm < nMarkAnz; nm++) + for(size_t nm = 0; nm < nMarkAnz; ++nm) { SdrMark* pM = GetSdrMarkByIndex(nm); SdrObject* pO = pM->GetMarkedSdrObj(); @@ -455,8 +455,8 @@ long SdrEditView::GetMarkedObjShear() const bool b1st=true; bool bOk=true; long nWink=0; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz && bOk; nm++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz && bOk; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); long nWink2=pO->GetShearAngle(); @@ -487,8 +487,8 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nWink, bool bVShear, bo CopyMarkedObj(); double nTan=tan(nWink*nPi180); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -603,8 +603,8 @@ void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookM if (bCopy) CopyMarkedObj(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -677,8 +677,8 @@ void SdrEditView::DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDisto if (bCopy) CopyMarkedObj(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -778,8 +778,8 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bRep const bool bUndo = IsUndoEnabled(); // TODO: check if WhichRange is necessary. - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { const SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -817,8 +817,8 @@ void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, bool /*bOnlyH long nShrAngle=0; bool bShrAngleDC=false; Rectangle aSnapRect; Rectangle aLogicRect; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { const SdrMark* pM=GetSdrMarkByIndex(nm); const SdrObject* pObj=pM->GetMarkedSdrObj(); if (nm==0) { @@ -924,9 +924,9 @@ SfxItemSet SdrEditView::GetAttrFromMarked(bool bOnlyHardAttr) const void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const { - sal_uInt32 nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); - for(sal_uInt32 a(0); a < nMarkAnz; a++) + for(size_t a = 0; a < nMarkAnz; ++a) { // #80277# merging was done wrong in the prev version const SfxItemSet& rSet = GetMarkedObjectByIndex(a)->GetMergedItemSet(); @@ -1031,7 +1031,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) BegUndo(aStr); } - const sal_uInt32 nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters; // create ItemSet without SFX_ITEM_DONTCARE. Put() @@ -1053,7 +1053,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) nNewLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue(); } - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj = pM->GetMarkedSdrObj(); @@ -1187,8 +1187,8 @@ SfxStyleSheet* SdrEditView::GetStyleSheetFromMarked() const { SfxStyleSheet* pRet=NULL; bool b1st=true; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SfxStyleSheet* pSS=pM->GetMarkedSdrObj()->GetStyleSheet(); if (b1st) pRet=pSS; @@ -1214,8 +1214,8 @@ void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRe BegUndo(aStr); } - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); if( bUndo ) @@ -1344,13 +1344,13 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const // check every object whether it is protected const SdrMarkList& rMarkList=GetMarkedObjectList(); - sal_uIntPtr nMarkCount=rMarkList.GetMarkCount(); + const size_t nMarkCount=rMarkList.GetMarkCount(); SdrObject* pObj=rMarkList.GetMark(0)->GetMarkedSdrObj(); bool bPosProt=pObj->IsMoveProtect(); bool bSizProt=pObj->IsResizeProtect(); bool bPosProtDontCare=false; bool bSizProtDontCare=false; - for (sal_uIntPtr i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); i++) + for (size_t i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); ++i) { pObj=rMarkList.GetMark(i)->GetMarkedSdrObj(); if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=true; @@ -1466,7 +1466,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) long nOldRotateAngle=GetMarkedObjRotate(); long nOldShearAngle=GetMarkedObjShear(); const SdrMarkList& rMarkList=GetMarkedObjectList(); - sal_uIntPtr nMarkCount=rMarkList.GetMarkCount(); + const size_t nMarkCount=rMarkList.GetMarkCount(); SdrObject* pObj=NULL; RECT_POINT eSizePoint=RP_MM; @@ -1675,7 +1675,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) const bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue()); bool bChanged(false); - for(sal_uInt32 i(0); i < nMarkCount; i++) + for(size_t i = 0; i < nMarkCount; ++i) { pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); @@ -1716,7 +1716,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) const bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue()); bool bChanged(false); - for(sal_uInt32 i(0); i < nMarkCount; i++) + for(size_t i = 0; i < nMarkCount; ++i) { pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); @@ -1745,7 +1745,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) bool SdrEditView::IsAlignPossible() const { // at least two selected objects, at least one of them movable ForcePossibilities(); - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz==0) return false; // nothing selected! if (nAnz==1) return bMoveAllowed; // align single object to page return bOneOrMoreMovable; // otherwise: MarkCount>=2 @@ -1757,7 +1757,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool return; SortMarkedObjects(); - if (GetMarkedObjectCount()<1) + if (!GetMarkedObjectCount()) return; const bool bUndo = IsUndoEnabled(); @@ -1796,10 +1796,9 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool } Rectangle aBound; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - sal_uIntPtr nm; + const size_t nMarkAnz=GetMarkedObjectCount(); bool bHasFixed=false; - for (nm=0; nm<nMarkAnz; nm++) + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -1816,7 +1815,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool { if (nMarkAnz==1) { // align single object to page - const SdrObject* pObj=GetMarkedObjectByIndex(0L); + const SdrObject* pObj=GetMarkedObjectByIndex(0); const SdrPage* pPage=pObj->GetPage(); const SdrPageGridFrameList* pGFL=pPage->GetGridFrameList(GetSdrPageViewOfMarkedByIndex(0),&(pObj->GetSnapRect())); const SdrPageGridFrame* pFrame=NULL; @@ -1845,7 +1844,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool } } Point aCenter(aBound.Center()); - for (nm=0; nm<nMarkAnz; nm++) + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 1825434d9ea3..ecbfae9baee8 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -63,7 +63,7 @@ void SdrEditView::ObjOrderChanged(SdrObject* /*pObj*/, sal_uIntPtr /*nOldPos*/, void SdrEditView::MovMarkedToTop() { - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz!=0) { const bool bUndo = IsUndoEnabled(); @@ -72,17 +72,16 @@ void SdrEditView::MovMarkedToTop() BegUndo(ImpGetResStr(STR_EditMovToTop),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVTOTOP); SortMarkedObjects(); - sal_uIntPtr nm; - for (nm=0; nm<nAnz; nm++) + for (size_t nm=0; nm<nAnz; ++nm) { // All Ordnums have to be correct! GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=NULL; sal_uIntPtr nNewPos=0; - for (nm=nAnz; nm>0;) + for (size_t nm=nAnz; nm>0;) { - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrObjList* pOL=pObj->GetObjList(); @@ -151,7 +150,7 @@ void SdrEditView::MovMarkedToTop() void SdrEditView::MovMarkedToBtm() { - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz!=0) { const bool bUndo = IsUndoEnabled(); @@ -160,8 +159,7 @@ void SdrEditView::MovMarkedToBtm() BegUndo(ImpGetResStr(STR_EditMovToBtm),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVTOBTM); SortMarkedObjects(); - sal_uIntPtr nm; - for (nm=0; nm<nAnz; nm++) + for (size_t nm=0; nm<nAnz; ++nm) { // All Ordnums have to be correct! GetMarkedObjectByIndex(nm)->GetOrdNum(); } @@ -169,7 +167,7 @@ void SdrEditView::MovMarkedToBtm() bool bChg=false; SdrObjList* pOL0=NULL; sal_uIntPtr nNewPos=0; - for (nm=0; nm<nAnz; nm++) + for (size_t nm=0; nm<nAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -245,7 +243,7 @@ void SdrEditView::PutMarkedToTop() void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) { - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz!=0) { const bool bUndo = IsUndoEnabled(); @@ -258,31 +256,30 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) { // Make "in front of the object" work, even if the // selected objects are already in front of the other object - sal_uIntPtr nRefMark=TryToFindMarkedObject(pRefObj); + const size_t nRefMark=TryToFindMarkedObject(pRefObj); SdrMark aRefMark; - if (nRefMark!=CONTAINER_ENTRY_NOTFOUND) + if (nRefMark!=SAL_MAX_SIZE) { aRefMark=*GetSdrMarkByIndex(nRefMark); GetMarkedObjectListWriteAccess().DeleteMark(nRefMark); } PutMarkedToBtm(); - if (nRefMark!=CONTAINER_ENTRY_NOTFOUND) + if (nRefMark!=SAL_MAX_SIZE) { GetMarkedObjectListWriteAccess().InsertEntry(aRefMark); SortMarkedObjects(); } } - sal_uIntPtr nm; - for (nm=0; nm<nAnz; nm++) + for (size_t nm=0; nm<nAnz; ++nm) { // All Ordnums have to be correct! GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=NULL; sal_uIntPtr nNewPos=0; - for (nm=nAnz; nm>0;) + for (size_t nm=nAnz; nm>0;) { - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); if (pObj!=pRefObj) @@ -347,7 +344,7 @@ void SdrEditView::PutMarkedToBtm() void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) { - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz!=0) { const bool bUndo = IsUndoEnabled(); @@ -360,28 +357,27 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) { // Make "behind the object" work, even if the // selected objects are already behind the other object - sal_uIntPtr nRefMark=TryToFindMarkedObject(pRefObj); + const size_t nRefMark=TryToFindMarkedObject(pRefObj); SdrMark aRefMark; - if (nRefMark!=CONTAINER_ENTRY_NOTFOUND) + if (nRefMark!=SAL_MAX_SIZE) { aRefMark=*GetSdrMarkByIndex(nRefMark); GetMarkedObjectListWriteAccess().DeleteMark(nRefMark); } PutMarkedToTop(); - if (nRefMark!=CONTAINER_ENTRY_NOTFOUND) + if (nRefMark!=SAL_MAX_SIZE) { GetMarkedObjectListWriteAccess().InsertEntry(aRefMark); SortMarkedObjects(); } } - sal_uIntPtr nm; - for (nm=0; nm<nAnz; nm++) { // All Ordnums have to be correct! + for (size_t nm=0; nm<nAnz; ++nm) { // All Ordnums have to be correct! GetMarkedObjectByIndex(nm)->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=NULL; sal_uIntPtr nNewPos=0; - for (nm=0; nm<nAnz; nm++) { + for (size_t nm=0; nm<nAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); if (pObj!=pRefObj) { @@ -428,7 +424,7 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) void SdrEditView::ReverseOrderOfMarked() { SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); + const size_t nMarkAnz=GetMarkedObjectCount(); if (nMarkAnz>0) { bool bChg=false; @@ -437,14 +433,14 @@ void SdrEditView::ReverseOrderOfMarked() if( bUndo ) BegUndo(ImpGetResStr(STR_EditRevOrder),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_REVORDER); - sal_uIntPtr a=0; + size_t a=0; do { // take into account selection across multiple PageViews - sal_uIntPtr b=a+1; - while (b<nMarkAnz && GetSdrPageViewOfMarkedByIndex(b) == GetSdrPageViewOfMarkedByIndex(a)) b++; - b--; + size_t b=a+1; + while (b<nMarkAnz && GetSdrPageViewOfMarkedByIndex(b) == GetSdrPageViewOfMarkedByIndex(a)) ++b; + --b; SdrObjList* pOL=GetSdrPageViewOfMarkedByIndex(a)->GetObjList(); - sal_uIntPtr c=b; + size_t c=b; if (a<c) { // make sure OrdNums aren't dirty GetMarkedObjectByIndex(a)->GetOrdNum(); } @@ -462,7 +458,8 @@ void SdrEditView::ReverseOrderOfMarked() // Obj 2 has moved forward by one position, so now nOrd2-1 pOL->SetObjectOrdNum(nOrd2-1,nOrd1); // use Replace instead of SetOrdNum for performance reasons (recalculation of Ordnums) - a++; c--; + ++a; + --c; bChg=true; } a=b+1; @@ -478,7 +475,7 @@ void SdrEditView::ReverseOrderOfMarked() void SdrEditView::ImpCheckToTopBtmPossible() { - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); if (nAnz==0) return; if (nAnz==1) @@ -501,10 +498,9 @@ void SdrEditView::ImpCheckToTopBtmPossible() bToTopPossible=nObjNum<sal_uIntPtr(nMax-1); bToBtmPossible=nObjNum>nMin; } else { // multiple selection - sal_uIntPtr nm=0; SdrObjList* pOL0=NULL; long nPos0=-1; - while (!bToBtmPossible && nm<nAnz) { // check 'send to background' + for (size_t nm = 0; !bToBtmPossible && nm<nAnz; ++nm) { // check 'send to background' SdrObject* pObj=GetMarkedObjectByIndex(nm); SdrObjList* pOL=pObj->GetObjList(); if (pOL!=pOL0) { @@ -514,13 +510,12 @@ void SdrEditView::ImpCheckToTopBtmPossible() sal_uIntPtr nPos=pObj->GetOrdNum(); bToBtmPossible=nPos>sal_uIntPtr(nPos0+1); nPos0=long(nPos); - nm++; } - nm=nAnz; + pOL0=NULL; nPos0=0x7FFFFFFF; - while (!bToTopPossible && nm>0) { // check 'bring to front' - nm--; + for (size_t nm=nAnz; !bToTopPossible && nm>0; ) { // check 'bring to front' + --nm; SdrObject* pObj=GetMarkedObjectByIndex(nm); SdrObjList* pOL=pObj->GetObjList(); if (pOL!=pOL0) { @@ -764,7 +759,7 @@ typedef vector< ImpDistributeEntry*> ImpDistributeEntryList; void SdrEditView::DistributeMarkedObjects() { - sal_uInt32 nMark(GetMarkedObjectCount()); + const size_t nMark(GetMarkedObjectCount()); if(nMark > 2) { @@ -795,7 +790,7 @@ void SdrEditView::DistributeMarkedObjects() // build sorted entry list nFullLength = 0L; - for( sal_uInt32 a = 0; a < nMark; a++ ) + for( size_t a = 0; a < nMark; ++a ) { SdrMark* pMark = GetSdrMarkByIndex(a); ImpDistributeEntry* pNew = new ImpDistributeEntry; @@ -890,7 +885,7 @@ void SdrEditView::DistributeMarkedObjects() // build sorted entry list nFullLength = 0L; - for( sal_uInt32 a = 0; a < nMark; a++ ) + for( size_t a = 0; a < nMark; ++a ) { SdrMark* pMark = GetSdrMarkByIndex(a); ImpDistributeEntry* pNew = new ImpDistributeEntry; @@ -1020,7 +1015,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) ConvertMarkedToPathObj(true); OSL_ENSURE(AreObjectsMarked(), "no more objects selected after preparations (!)"); - for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++) + for(size_t a=0; a<GetMarkedObjectCount(); ++a) { SdrMark* pM = GetSdrMarkByIndex(a); SdrObject* pObj = pM->GetMarkedSdrObj(); @@ -1222,12 +1217,11 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) sal_uInt32 nInsPos(0xFFFFFFFF); SdrObjList* pInsOL = 0L; SdrPageView* pInsPV = 0L; - const sal_uInt32 nAnz(GetMarkedObjectCount()); const SdrObject* pAttrObj = 0L; - for(sal_uInt32 a(nAnz); a > 0L; ) + for(size_t a = GetMarkedObjectCount(); a; ) { - a--; + --a; SdrMark* pM = GetSdrMarkByIndex(a); SdrObject* pObj = pM->GetMarkedSdrObj(); SdrObjList* pThisOL = pObj->GetObjList(); @@ -1620,11 +1614,9 @@ void SdrEditView::DismantleMarkedObjects(bool bMakeLines) BegUndo("", "", bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS); } - sal_uIntPtr nm; - sal_uIntPtr nAnz=GetMarkedObjectCount(); SdrObjList* pOL0=NULL; - for (nm=nAnz; nm>0;) { - nm--; + for (size_t nm=GetMarkedObjectCount(); nm>0;) { + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); @@ -1677,11 +1669,10 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp) { BegUndo(ImpGetResStr(STR_EditGroup),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_GROUP); - const sal_uIntPtr nAnz = GetMarkedObjectCount(); - for(sal_uIntPtr nm = nAnz; nm>0; ) + for(size_t nm = GetMarkedObjectCount(); nm>0; ) { // add UndoActions for all affected objects - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj = pM->GetMarkedSdrObj(); std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) ); @@ -1710,9 +1701,9 @@ void SdrEditView::GroupMarked(const SdrObject* pUserGrp) // the group object is the last one in the list. sal_uIntPtr nInsPos=pSrcLst->GetObjCount(); bool bNeedInsPos=true; - for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) + for (size_t nm=GetMarkedObjectCount(); nm>0;) { - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); if (pM->GetPageView()==pPV) { @@ -1794,12 +1785,12 @@ void SdrEditView::UnGroupMarked() if( bUndo ) BegUndo("", "", SDRREPFUNC_OBJ_UNGROUP); - sal_uIntPtr nCount=0; + size_t nCount=0; OUString aName1; OUString aName; bool bNameOk=false; - for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) { - nm--; + for (size_t nm=GetMarkedObjectCount(); nm>0;) { + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pGrp=pM->GetMarkedSdrObj(); SdrObjList* pSrcLst=pGrp->GetSubList(); @@ -1912,7 +1903,7 @@ void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea) { bool bMrkChg=false; if (AreObjectsMarked()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); + const size_t nMarkAnz=GetMarkedObjectCount(); sal_uInt16 nDscrID=0; if(bLineToArea) { @@ -1935,8 +1926,8 @@ void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea) BegUndo(ImpGetResStr(nDscrID),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_CONVERTTOPOLY); } } - for (sal_uIntPtr nm=nMarkAnz; nm>0;) { - nm--; + for (size_t nm=nMarkAnz; nm>0;) { + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); @@ -1985,9 +1976,9 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) SortMarkedObjects(); SdrMarkList aForTheDescription; SdrMarkList aNewMarked; - sal_uIntPtr nAnz=GetMarkedObjectCount(); + const size_t nAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=nAnz; nm>0;) + for (size_t nm=nAnz; nm>0;) { // create Undo objects for all new objects // check for cancellation between the metafiles if( pProgrInfo != NULL ) @@ -1997,7 +1988,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) break; } - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); @@ -2091,7 +2082,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) if(aNewMarked.GetMarkCount()) { // create new selection - for(sal_uIntPtr a(0); a < aNewMarked.GetMarkCount(); a++) + for(size_t a = 0; a < aNewMarked.GetMarkCount(); ++a) { GetMarkedObjectListWriteAccess().InsertEntry(*aNewMarked.GetMark(a)); } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 397ebe79b5d7..8210d3ac41b1 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1407,9 +1407,9 @@ sal_uInt16 SdrObjEditView::GetScriptType() const } else { - sal_uInt32 nMarkCount( GetMarkedObjectCount() ); + const size_t nMarkCount( GetMarkedObjectCount() ); - for( sal_uInt32 i = 0; i < nMarkCount; i++ ) + for( size_t i = 0; i < nMarkCount; ++i ) { OutlinerParaObject* pParaObj = GetMarkedObjectByIndex( i )->GetOutlinerParaObject(); @@ -1984,7 +1984,7 @@ bool SdrObjEditView::TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFor return true; const SdrMarkList& rMarkList = GetMarkedObjectList(); - if( rMarkList.GetMarkCount() >= 1 ) + if( rMarkList.GetMarkCount() > 0 ) { OutlinerView* pOLV = GetTextEditOutlinerView(); diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index 0ea7c0b2c985..e6947d92b9f5 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -49,8 +49,8 @@ SdrGlueEditView::~SdrGlueEditView() void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); @@ -232,8 +232,8 @@ void SdrGlueEditView::DeleteMarkedGluePoints() if( bUndo ) BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_DELETE); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -277,8 +277,8 @@ void SdrGlueEditView::ImpCopyMarkedGluePoints() if( bUndo ) BegUndo(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -322,8 +322,8 @@ void SdrGlueEditView::ImpCopyMarkedGluePoints() void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 9830fab3a695..269a22dc9f19 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1842,19 +1842,19 @@ extern "C" int SAL_CALL ImplSortHdlFunc( const void* pVoid1, const void* pVoid2 void SdrHdlList::TravelFocusHdl(bool bForward) { // security correction - if(mnFocusIndex != CONTAINER_ENTRY_NOTFOUND && mnFocusIndex >= GetHdlCount()) - mnFocusIndex = CONTAINER_ENTRY_NOTFOUND; + if (mnFocusIndex >= GetHdlCount()) + mnFocusIndex = SAL_MAX_SIZE; if(!aList.empty()) { // take care of old handle - const sal_uIntPtr nOldHdlNum(mnFocusIndex); + const size_t nOldHdlNum(mnFocusIndex); SdrHdl* pOld = GetHdl(nOldHdlNum); if(pOld) { // switch off old handle - mnFocusIndex = CONTAINER_ENTRY_NOTFOUND; + mnFocusIndex = SAL_MAX_SIZE; pOld->Touch(); } @@ -1862,8 +1862,7 @@ void SdrHdlList::TravelFocusHdl(bool bForward) boost::scoped_array<ImplHdlAndIndex> pHdlAndIndex(new ImplHdlAndIndex[aList.size()]); // build sorted handle list - sal_uInt32 a; - for( a = 0; a < aList.size(); a++) + for( size_t a = 0; a < aList.size(); ++a) { pHdlAndIndex[a].mpHdl = aList[a]; pHdlAndIndex[a].mnIndex = a; @@ -1872,11 +1871,11 @@ void SdrHdlList::TravelFocusHdl(bool bForward) qsort(pHdlAndIndex.get(), aList.size(), sizeof(ImplHdlAndIndex), ImplSortHdlFunc); // look for old num in sorted array - sal_uIntPtr nOldHdl(nOldHdlNum); + size_t nOldHdl(nOldHdlNum); - if(nOldHdlNum != CONTAINER_ENTRY_NOTFOUND) + if(nOldHdlNum != SAL_MAX_SIZE) { - for(a = 0; a < aList.size(); a++) + for(size_t a = 0; a < aList.size(); ++a) { if(pHdlAndIndex[a].mpHdl == pOld) { @@ -1887,17 +1886,17 @@ void SdrHdlList::TravelFocusHdl(bool bForward) } // build new HdlNum - sal_uIntPtr nNewHdl(nOldHdl); + size_t nNewHdl(nOldHdl); // do the focus travel if(bForward) { - if(nOldHdl != CONTAINER_ENTRY_NOTFOUND) + if(nOldHdl != SAL_MAX_SIZE) { if(nOldHdl == aList.size() - 1) { // end forward run - nNewHdl = CONTAINER_ENTRY_NOTFOUND; + nNewHdl = SAL_MAX_SIZE; } else { @@ -1913,7 +1912,7 @@ void SdrHdlList::TravelFocusHdl(bool bForward) } else { - if(nOldHdl == CONTAINER_ENTRY_NOTFOUND) + if(nOldHdl == SAL_MAX_SIZE) { // start backward run at last entry nNewHdl = aList.size() - 1; @@ -1924,7 +1923,7 @@ void SdrHdlList::TravelFocusHdl(bool bForward) if(nOldHdl == 0) { // end backward run - nNewHdl = CONTAINER_ENTRY_NOTFOUND; + nNewHdl = SAL_MAX_SIZE; } else { @@ -1938,11 +1937,11 @@ void SdrHdlList::TravelFocusHdl(bool bForward) sal_uIntPtr nNewHdlNum(nNewHdl); // look for old num in sorted array - if(nNewHdl != CONTAINER_ENTRY_NOTFOUND) + if(nNewHdl != SAL_MAX_SIZE) { SdrHdl* pNew = pHdlAndIndex[nNewHdl].mpHdl; - for(a = 0; a < aList.size(); a++) + for(size_t a = 0; a < aList.size(); ++a) { if(aList[a] == pNew) { @@ -1968,7 +1967,7 @@ void SdrHdlList::TravelFocusHdl(bool bForward) SdrHdl* SdrHdlList::GetFocusHdl() const { - if(mnFocusIndex != CONTAINER_ENTRY_NOTFOUND && mnFocusIndex < GetHdlCount()) + if(mnFocusIndex < GetHdlCount()) return GetHdl(mnFocusIndex); else return 0L; @@ -1982,9 +1981,9 @@ void SdrHdlList::SetFocusHdl(SdrHdl* pNew) if(!pActual || pActual != pNew) { - sal_uIntPtr nNewHdlNum = GetHdlNum(pNew); + const size_t nNewHdlNum = GetHdlNum(pNew); - if(nNewHdlNum != CONTAINER_ENTRY_NOTFOUND) + if(nNewHdlNum != SAL_MAX_SIZE) { mnFocusIndex = nNewHdlNum; @@ -2007,7 +2006,7 @@ void SdrHdlList::ResetFocusHdl() { SdrHdl* pHdl = GetFocusHdl(); - mnFocusIndex = CONTAINER_ENTRY_NOTFOUND; + mnFocusIndex = SAL_MAX_SIZE; if(pHdl) { @@ -2018,7 +2017,7 @@ void SdrHdlList::ResetFocusHdl() SdrHdlList::SdrHdlList(SdrMarkView* pV) -: mnFocusIndex(CONTAINER_ENTRY_NOTFOUND), +: mnFocusIndex(SAL_MAX_SIZE), pView(pV), aList() { @@ -2041,7 +2040,7 @@ void SdrHdlList::SetHdlSize(sal_uInt16 nSiz) nHdlSize = nSiz; // propagate change to IAOs - for(sal_uIntPtr i=0; i<GetHdlCount(); i++) + for(size_t i=0; i<GetHdlCount(); ++i) { SdrHdl* pHdl = GetHdl(i); pHdl->Touch(); @@ -2057,7 +2056,7 @@ void SdrHdlList::SetMoveOutside(bool bOn) bMoveOutside = bOn ? 1 : 0; // propagate change to IAOs - for(sal_uIntPtr i=0; i<GetHdlCount(); i++) + for(size_t i=0; i<GetHdlCount(); ++i) { SdrHdl* pHdl = GetHdl(i); pHdl->Touch(); @@ -2075,7 +2074,7 @@ void SdrHdlList::SetDistortShear(bool bOn) bDistortShear = bOn ? 1 : 0; } -SdrHdl* SdrHdlList::RemoveHdl(sal_uIntPtr nNum) +SdrHdl* SdrHdlList::RemoveHdl(size_t nNum) { SdrHdl* pRetval = aList[nNum]; aList.erase(aList.begin() + nNum); @@ -2100,7 +2099,7 @@ void SdrHdlList::RemoveAllByKind(SdrHdlKind eKind) void SdrHdlList::Clear() { - for (sal_uIntPtr i=0; i<GetHdlCount(); i++) + for (size_t i=0; i<GetHdlCount(); ++i) { SdrHdl* pHdl=GetHdl(i); delete pHdl; @@ -2136,13 +2135,13 @@ void SdrHdlList::Sort() } } -sal_uIntPtr SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const +size_t SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const { if (pHdl==NULL) - return CONTAINER_ENTRY_NOTFOUND; + return SAL_MAX_SIZE; std::deque<SdrHdl*>::const_iterator it = std::find( aList.begin(), aList.end(), pHdl); if( it == aList.end() ) - return CONTAINER_ENTRY_NOTFOUND; + return SAL_MAX_SIZE; return it - aList.begin(); } @@ -2165,8 +2164,8 @@ void SdrHdlList::AddHdl(SdrHdl* pHdl, bool bAtBegin) SdrHdl* SdrHdlList::IsHdlListHit(const Point& rPnt, bool bBack, bool bNext, SdrHdl* pHdl0) const { SdrHdl* pRet=NULL; - sal_uIntPtr nAnz=GetHdlCount(); - sal_uIntPtr nNum=bBack ? 0 : nAnz; + const size_t nAnz=GetHdlCount(); + size_t nNum=bBack ? 0 : nAnz; while ((bBack ? nNum<nAnz : nNum>0) && pRet==NULL) { if (!bBack) @@ -2191,7 +2190,7 @@ SdrHdl* SdrHdlList::IsHdlListHit(const Point& rPnt, bool bBack, bool bNext, SdrH SdrHdl* SdrHdlList::GetHdl(SdrHdlKind eKind1) const { SdrHdl* pRet=NULL; - for (sal_uIntPtr i=0; i<GetHdlCount() && pRet==NULL; i++) + for (size_t i=0; i<GetHdlCount() && pRet==NULL; ++i) { SdrHdl* pHdl=GetHdl(i); if (pHdl->GetKind()==eKind1) diff --git a/svx/source/svdraw/svditer.cxx b/svx/source/svdraw/svditer.cxx index d572a4009d61..6b2b419c80e5 100644 --- a/svx/source/svdraw/svditer.cxx +++ b/svx/source/svdraw/svditer.cxx @@ -73,7 +73,7 @@ void SdrObjListIter::ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMod void SdrObjListIter::ImpProcessMarkList( const SdrMarkList& rMarkList, SdrIterMode eMode ) { - for( sal_uIntPtr nIdx = 0, nCount = rMarkList.GetMarkCount(); nIdx < nCount; ++nIdx ) + for( size_t nIdx = 0, nCount = rMarkList.GetMarkCount(); nIdx < nCount; ++nIdx ) if( SdrObject* pObj = rMarkList.GetMark( nIdx )->GetMarkedSdrObj() ) ImpProcessObj( pObj, eMode, false ); } diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 2908b83070e4..784dfa3395b8 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -254,7 +254,7 @@ void SdrMarkList::ImpForceSort() if(!mbSorted) { mbSorted = true; - sal_uLong nAnz = maList.size(); + size_t nAnz = maList.size(); // remove invalid if(nAnz > 0 ) @@ -281,8 +281,7 @@ void SdrMarkList::ImpForceSort() if(maList.size() > 1) { SdrMark* pAkt = maList.back(); - int i = maList.size() - 2; - while(i) + for (size_t i = maList.size() - 2; i; --i) { SdrMark* pCmp = maList[i]; if(pAkt->GetMarkedSdrObj() == pCmp->GetMarkedSdrObj() && pAkt->GetMarkedSdrObj()) @@ -303,8 +302,6 @@ void SdrMarkList::ImpForceSort() { pAkt = pCmp; } - - --i; } } } @@ -313,7 +310,7 @@ void SdrMarkList::ImpForceSort() void SdrMarkList::Clear() { - for(sal_uLong i(0L); i < GetMarkCount(); i++) + for(size_t i = 0; i < GetMarkCount(); ++i) { SdrMark* pMark = GetMark(i); delete pMark; @@ -327,7 +324,7 @@ void SdrMarkList::operator=(const SdrMarkList& rLst) { Clear(); - for(sal_uLong i(0L); i < rLst.GetMarkCount(); i++) + for(size_t i = 0; i < rLst.GetMarkCount(); ++i) { SdrMark* pMark = rLst.GetMark(i); SdrMark* pNeuMark = new SdrMark(*pMark); @@ -343,12 +340,12 @@ void SdrMarkList::operator=(const SdrMarkList& rLst) mbSorted = rLst.mbSorted; } -SdrMark* SdrMarkList::GetMark(sal_uLong nNum) const +SdrMark* SdrMarkList::GetMark(size_t nNum) const { return (nNum < maList.size()) ? maList[nNum] : NULL; } -sal_uLong SdrMarkList::FindObject(const SdrObject* pObj) const +size_t SdrMarkList::FindObject(const SdrObject* pObj) const { // Since relying on OrdNums is not allowed for the selection because objects in the // selection may not be inserted in a list if they are e.g. modified ATM, i changed @@ -361,7 +358,7 @@ sal_uLong SdrMarkList::FindObject(const SdrObject* pObj) const // less dangerous to change this method then changing SdrObject::GetOrdNum(). if(pObj && !maList.empty()) { - for(sal_uLong a(0L); a < maList.size(); a++) + for(size_t a = 0; a < maList.size(); ++a) { if(maList[a]->GetMarkedSdrObj() == pObj) { @@ -370,13 +367,13 @@ sal_uLong SdrMarkList::FindObject(const SdrObject* pObj) const } } - return CONTAINER_ENTRY_NOTFOUND; + return SAL_MAX_SIZE; } void SdrMarkList::InsertEntry(const SdrMark& rMark, bool bChkSort) { SetNameDirty(); - sal_uLong nAnz(maList.size()); + const size_t nAnz(maList.size()); if(!bChkSort || !mbSorted || nAnz == 0) { @@ -387,7 +384,7 @@ void SdrMarkList::InsertEntry(const SdrMark& rMark, bool bChkSort) } else { - SdrMark* pLast = GetMark(sal_uLong(nAnz - 1)); + SdrMark* pLast = GetMark(nAnz - 1); const SdrObject* pLastObj = pLast->GetMarkedSdrObj(); const SdrObject* pNeuObj = rMark.GetMarkedSdrObj(); @@ -432,7 +429,7 @@ void SdrMarkList::InsertEntry(const SdrMark& rMark, bool bChkSort) return; } -void SdrMarkList::DeleteMark(sal_uLong nNum) +void SdrMarkList::DeleteMark(size_t nNum) { SdrMark* pMark = GetMark(nNum); DBG_ASSERT(pMark!=0L,"DeleteMark: MarkEntry not found."); @@ -445,7 +442,7 @@ void SdrMarkList::DeleteMark(sal_uLong nNum) } } -void SdrMarkList::ReplaceMark(const SdrMark& rNewMark, sal_uLong nNum) +void SdrMarkList::ReplaceMark(const SdrMark& rNewMark, size_t nNum) { SdrMark* pMark = GetMark(nNum); DBG_ASSERT(pMark!=0L,"ReplaceMark: MarkEntry not found."); @@ -462,7 +459,7 @@ void SdrMarkList::ReplaceMark(const SdrMark& rNewMark, sal_uLong nNum) void SdrMarkList::Merge(const SdrMarkList& rSrcList, bool bReverse) { - sal_uLong nAnz(rSrcList.maList.size()); + const size_t nAnz(rSrcList.maList.size()); if(rSrcList.mbSorted) { @@ -472,7 +469,7 @@ void SdrMarkList::Merge(const SdrMarkList& rSrcList, bool bReverse) if(!bReverse) { - for(sal_uLong i(0L); i < nAnz; i++) + for(size_t i = 0; i < nAnz; ++i) { SdrMark* pM = rSrcList.maList[i]; InsertEntry(*pM); @@ -480,9 +477,9 @@ void SdrMarkList::Merge(const SdrMarkList& rSrcList, bool bReverse) } else { - for(sal_uLong i(nAnz); i > 0;) + for(size_t i = nAnz; i > 0;) { - i--; + --i; SdrMark* pM = rSrcList.maList[i]; InsertEntry(*pM); } @@ -538,7 +535,7 @@ bool SdrMarkList::InsertPageView(const SdrPageView& rPV) const OUString& SdrMarkList::GetMarkDescription() const { - sal_uLong nAnz(GetMarkCount()); + const size_t nAnz(GetMarkCount()); if(mbNameOk && 1L == nAnz) { @@ -575,7 +572,7 @@ const OUString& SdrMarkList::GetMarkDescription() const aNam = pMark->GetMarkedSdrObj()->TakeObjNamePlural(); bool bEq(true); - for(sal_uLong i = 1; i < GetMarkCount() && bEq; i++) + for(size_t i = 1; i < GetMarkCount() && bEq; ++i) { SdrMark* pMark2 = GetMark(i); OUString aStr1(pMark2->GetMarkedSdrObj()->TakeObjNamePlural()); @@ -602,20 +599,20 @@ const OUString& SdrMarkList::GetPointMarkDescription(bool bGlue) const { bool& rNameOk = (bool&)(bGlue ? mbGluePointNameOk : mbPointNameOk); OUString& rName = const_cast<OUString&>(bGlue ? maGluePointName : maPointName); - sal_uLong nMarkAnz(GetMarkCount()); - sal_uLong nMarkPtAnz(0L); - sal_uLong nMarkPtObjAnz(0L); - sal_uLong n1stMarkNum(ULONG_MAX); + const size_t nMarkAnz(GetMarkCount()); + size_t nMarkPtAnz(0); + size_t nMarkPtObjAnz(0); + size_t n1stMarkNum(SAL_MAX_SIZE); - for(sal_uLong nMarkNum(0L); nMarkNum < nMarkAnz; nMarkNum++) + for(size_t nMarkNum = 0; nMarkNum < nMarkAnz; ++nMarkNum) { const SdrMark* pMark = GetMark(nMarkNum); const SdrUShortCont* pPts = bGlue ? pMark->GetMarkedGluePoints() : pMark->GetMarkedPoints(); - sal_uLong nAnz(pPts ? pPts->size() : 0); + const size_t nAnz(pPts ? pPts->size() : 0); if(nAnz) { - if(n1stMarkNum == ULONG_MAX) + if(n1stMarkNum == SAL_MAX_SIZE) { n1stMarkNum = nMarkNum; } @@ -631,7 +628,7 @@ const OUString& SdrMarkList::GetPointMarkDescription(bool bGlue) const } } - if(rNameOk && 1L == nMarkPtObjAnz) + if(rNameOk && 1 == nMarkPtObjAnz) { // if it's a single selection, cache only text frame const SdrObject* pObj = GetMark(0)->GetMarkedSdrObj(); @@ -669,7 +666,7 @@ const OUString& SdrMarkList::GetPointMarkDescription(bool bGlue) const bool bEq(true); - for(sal_uLong i(n1stMarkNum + 1L); i < GetMarkCount() && bEq; i++) + for(size_t i = n1stMarkNum + 1; i < GetMarkCount() && bEq; ++i) { const SdrMark* pMark2 = GetMark(i); const SdrUShortCont* pPts = bGlue ? pMark2->GetMarkedGluePoints() : pMark2->GetMarkedPoints(); @@ -714,7 +711,7 @@ bool SdrMarkList::TakeBoundRect(SdrPageView* pPV, Rectangle& rRect) const bool bFnd(false); Rectangle aR; - for(sal_uLong i(0L); i < GetMarkCount(); i++) + for(size_t i = 0; i < GetMarkCount(); ++i) { SdrMark* pMark = GetMark(i); @@ -744,7 +741,7 @@ bool SdrMarkList::TakeSnapRect(SdrPageView* pPV, Rectangle& rRect) const { bool bFnd(false); - for(sal_uLong i(0L); i < GetMarkCount(); i++) + for(size_t i = 0; i < GetMarkCount(); ++i) { SdrMark* pMark = GetMark(i); @@ -855,9 +852,9 @@ namespace sdr maAllMarkedObjects.clear(); // GetMarkCount after ForceSort - const sal_uLong nMarkAnz(maMarkedObjectList.GetMarkCount()); + const size_t nMarkAnz(maMarkedObjectList.GetMarkCount()); - for(sal_uLong a(0L); a < nMarkAnz; a++) + for(size_t a = 0; a < nMarkAnz; ++a) { SdrObject* pCandidate = maMarkedObjectList.GetMark(a)->GetMarkedSdrObj(); @@ -894,7 +891,7 @@ namespace sdr aM.SetCon2(true); } - if(CONTAINER_ENTRY_NOTFOUND == maMarkedObjectList.FindObject(pEdge)) + if(SAL_MAX_SIZE == maMarkedObjectList.FindObject(pEdge)) { // check if it itself is selected maEdgesOfMarkedNodes.InsertEntry(aM); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index acfbcab68ad0..2dff6dc6f9b1 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -559,8 +559,8 @@ void SdrMarkView::showMarkHandles() bool SdrMarkView::ImpIsFrameHandles() const { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - bool bFrmHdl=nMarkAnz>nFrameHandlesLimit || bForceFrameHandles; + const size_t nMarkAnz=GetMarkedObjectCount(); + bool bFrmHdl=nMarkAnz>static_cast<size_t>(nFrameHandlesLimit) || bForceFrameHandles; bool bStdDrag=eDragMode==SDRDRAG_MOVE; if (nMarkAnz==1 && bStdDrag && bFrmHdl) { @@ -579,7 +579,7 @@ bool SdrMarkView::ImpIsFrameHandles() const bFrmHdl=true; if (eDragMode==SDRDRAG_ROTATE) { // when rotating, use ObjOwn drag, if there's at least 1 PolyObj - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && bFrmHdl; nMarkNum++) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && bFrmHdl; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); bFrmHdl=!pObj->IsPolyObj(); @@ -588,7 +588,7 @@ bool SdrMarkView::ImpIsFrameHandles() const } if (!bFrmHdl) { // FrameHandles, if at least 1 Obj can't do SpecialDrag - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bFrmHdl; nMarkNum++) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && !bFrmHdl; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); bFrmHdl=!pObj->hasSpecialDrag(); @@ -635,7 +635,7 @@ void SdrMarkView::SetMarkHandles() // are handles enabled at all? Create only then if(!areMarkHandlesHidden()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); + const size_t nMarkAnz=GetMarkedObjectCount(); bool bStdDrag=eDragMode==SDRDRAG_MOVE; bool bSingleTextObjMark=false; @@ -654,7 +654,7 @@ void SdrMarkView::SetMarkHandles() { pMarkedPV=GetSdrPageViewOfMarkedByIndex(0); - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && (pMarkedPV!=NULL || !bFrmHdl); nMarkNum++) + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && (pMarkedPV!=NULL || !bFrmHdl); ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); @@ -708,10 +708,10 @@ void SdrMarkView::SetMarkHandles() { // otherwise nothing is found if( bSingleTextObjMark ) { - const sal_uIntPtr nSiz0=aHdl.GetHdlCount(); + const size_t nSiz0=aHdl.GetHdlCount(); pMarkedObj->AddToHdlList(aHdl); - const sal_uIntPtr nSiz1=aHdl.GetHdlCount(); - for (sal_uIntPtr i=nSiz0; i<nSiz1; i++) + const size_t nSiz1=aHdl.GetHdlCount(); + for (size_t i=nSiz0; i<nSiz1; ++i) { SdrHdl* pHdl=aHdl.GetHdl(i); pHdl->SetObj(pMarkedObj); @@ -765,17 +765,17 @@ void SdrMarkView::SetMarkHandles() if(!bDone) { - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); - const sal_uIntPtr nSiz0=aHdl.GetHdlCount(); + const size_t nSiz0=aHdl.GetHdlCount(); pObj->AddToHdlList(aHdl); - const sal_uIntPtr nSiz1=aHdl.GetHdlCount(); + const size_t nSiz1=aHdl.GetHdlCount(); bool bPoly=pObj->IsPolyObj(); const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints(); - for (sal_uIntPtr i=nSiz0; i<nSiz1; i++) + for (size_t i=nSiz0; i<nSiz1; ++i) { SdrHdl* pHdl=aHdl.GetHdl(i); pHdl->SetPos( pHdl->GetPos() + aGridOff ); @@ -810,7 +810,7 @@ void SdrMarkView::SetMarkHandles() } // GluePoint handles - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -853,7 +853,7 @@ void SdrMarkView::SetMarkHandles() // try to restore focus handle index from remembered values if(bSaveOldFocus) { - for(sal_uInt32 a(0); a < aHdl.GetHdlCount(); a++) + for(size_t a = 0; a < aHdl.GetHdlCount(); ++a) { SdrHdl* pCandidate = aHdl.GetHdl(a); @@ -923,7 +923,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) case SDRDRAG_TRANSPARENCE: { // add interactive transparency handle - sal_uIntPtr nMarkAnz = GetMarkedObjectCount(); + const size_t nMarkAnz = GetMarkedObjectCount(); if(nMarkAnz == 1) { SdrObject* pObj = GetMarkedObjectByIndex(0); @@ -987,7 +987,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) case SDRDRAG_GRADIENT: { // add interactive gradient handle - sal_uIntPtr nMarkAnz = GetMarkedObjectCount(); + const size_t nMarkAnz = GetMarkedObjectCount(); if(nMarkAnz == 1) { SdrObject* pObj = GetMarkedObjectByIndex(0); @@ -1049,9 +1049,9 @@ bool SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin) } // notify last mouse over handle that he lost the mouse - const sal_uIntPtr nHdlCount = aHdl.GetHdlCount(); + const size_t nHdlCount = aHdl.GetHdlCount(); - for(sal_uIntPtr nHdl = 0; nHdl < nHdlCount; nHdl++ ) + for(size_t nHdl = 0; nHdl < nHdlCount; ++nHdl) { SdrHdl* pCurrentHdl = GetHdl(nHdl); if( pCurrentHdl->mbMouseOver ) @@ -1188,8 +1188,8 @@ void SdrMarkView::SetRef2(const Point& rPt) void SdrMarkView::CheckMarked() { - for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) { - nm--; + for (size_t nm=GetMarkedObjectCount(); nm>0;) { + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); SdrPageView* pPV=pM->GetPageView(); @@ -1299,7 +1299,7 @@ bool SdrMarkView::IsMarkedObjHit(const Point& rPnt, short nTol) const bool bRet=false; nTol=ImpGetHitTolLogic(nTol,NULL); Point aPt(rPnt); - for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount() && !bRet; nm++) { + for (size_t nm=0; nm<GetMarkedObjectCount() && !bRet; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); bRet = 0 != CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0); } @@ -1342,11 +1342,11 @@ bool SdrMarkView::MarkNextObj(bool bPrev) } SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - sal_uIntPtr nChgMarkNum = ULONG_MAX; // number of the MarkEntry we want to replace + const size_t nMarkAnz=GetMarkedObjectCount(); + size_t nChgMarkNum = SAL_MAX_SIZE; // number of the MarkEntry we want to replace sal_uIntPtr nSearchObjNum = bPrev ? 0 : ULONG_MAX; if (nMarkAnz!=0) { - nChgMarkNum=bPrev ? 0 : sal_uIntPtr(nMarkAnz-1); + nChgMarkNum=bPrev ? 0 : nMarkAnz-1; SdrMark* pM=GetSdrMarkByIndex(nChgMarkNum); OSL_ASSERT(pM!=NULL); if (pM->GetMarkedSdrObj() != NULL) @@ -1365,7 +1365,7 @@ bool SdrMarkView::MarkNextObj(bool bPrev) SdrObject* pSearchObj = pSearchObjList->GetObjectForNavigationPosition(nSearchObjNum); if (IsObjMarkable(pSearchObj,pPageView)) { - if (TryToFindMarkedObject(pSearchObj)==CONTAINER_ENTRY_NOTFOUND) + if (TryToFindMarkedObject(pSearchObj)==SAL_MAX_SIZE) { pMarkObj=pSearchObj; } @@ -1379,7 +1379,7 @@ bool SdrMarkView::MarkNextObj(bool bPrev) return false; } - if (nChgMarkNum!=ULONG_MAX) + if (nChgMarkNum!=SAL_MAX_SIZE) { GetMarkedObjectListWriteAccess().DeleteMark(nChgMarkNum); } @@ -1394,13 +1394,12 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev) Point aPt(rPnt); SdrMark* pTopMarkHit=NULL; SdrMark* pBtmMarkHit=NULL; - sal_uIntPtr nTopMarkHit=0; - sal_uIntPtr nBtmMarkHit=0; + size_t nTopMarkHit=0; + size_t nBtmMarkHit=0; // find topmost of the selected objects that is hit by rPnt - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - sal_uIntPtr nm=0; - for (nm=nMarkAnz; nm>0 && pTopMarkHit==NULL;) { - nm--; + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=nMarkAnz; nm>0 && pTopMarkHit==NULL;) { + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); if(CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0)) { @@ -1416,7 +1415,7 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev) SdrPageView* pPV=pTopMarkHit->GetPageView(); // find lowermost of the selected objects that is hit by rPnt // and is placed on the same PageView as pTopMarkHit - for (nm=0; nm<nMarkAnz && pBtmMarkHit==NULL; nm++) { + for (size_t nm=0; nm<nMarkAnz && pBtmMarkHit==NULL; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrPageView* pPV2=pM->GetPageView(); if (pPV2==pPV && CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pPV2,0,0)) @@ -1476,7 +1475,7 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev) if (CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE,0)) { - if (TryToFindMarkedObject(pObj)==CONTAINER_ENTRY_NOTFOUND) { + if (TryToFindMarkedObject(pObj)==SAL_MAX_SIZE) { pFndObj=pObj; } else { // TODO: for performance reasons set on to Top or Btm, if necessary @@ -1519,8 +1518,8 @@ bool SdrMarkView::MarkObj(const Rectangle& rRect, bool bUnmark) bFnd=true; } } else { - sal_uIntPtr nPos=TryToFindMarkedObject(pObj); - if (nPos!=CONTAINER_ENTRY_NOTFOUND) + const size_t nPos=TryToFindMarkedObject(pObj); + if (nPos!=SAL_MAX_SIZE) { GetMarkedObjectListWriteAccess().DeleteMark(nPos); bFnd=true; @@ -1547,8 +1546,8 @@ void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool } else { - sal_uIntPtr nPos=TryToFindMarkedObject(pObj); - if (nPos!=CONTAINER_ENTRY_NOTFOUND) + const size_t nPos=TryToFindMarkedObject(pObj); + if (nPos!=SAL_MAX_SIZE) { GetMarkedObjectListWriteAccess().DeleteMark(nPos); } @@ -1562,10 +1561,7 @@ void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool bool SdrMarkView::IsObjMarked(SdrObject* pObj) const { - // Hack: Because FindObject() is not const, - // I have to cast myself to non-const. - sal_uIntPtr nPos=((SdrMarkView*)this)->TryToFindMarkedObject(pObj); - return nPos!=CONTAINER_ENTRY_NOTFOUND; + return TryToFindMarkedObject(pObj)!=SAL_MAX_SIZE; } sal_uInt16 SdrMarkView::GetMarkHdlSizePixel() const @@ -1683,7 +1679,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT { if ((pMarkList)!=NULL) { - if ((*pMarkList).FindObject(pObj)!=CONTAINER_ENTRY_NOTFOUND) + if ((*pMarkList).FindObject(pObj)!=SAL_MAX_SIZE) { return NULL; } @@ -1702,7 +1698,7 @@ bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP return PickObj(rPnt,nTol,rpObj,rpPV,nOptions,NULL,NULL,NULL); } -bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, sal_uIntPtr* pnMarkNum, sal_uInt16* pnPassNum) const +bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, size_t* pnMarkNum, sal_uInt16* pnPassNum) const { // TODO: lacks a Pass2,Pass3 SortMarkedObjects(); if (ppRootObj!=NULL) *ppRootObj=NULL; @@ -1730,8 +1726,8 @@ bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP pPV=((SdrObjEditView*)this)->GetTextEditPageView(); } if (bMarked) { - sal_uIntPtr nMrkAnz=GetMarkedObjectCount(); - sal_uIntPtr nMrkNum=bBack ? 0 : nMrkAnz; + const size_t nMrkAnz=GetMarkedObjectCount(); + size_t nMrkNum=bBack ? 0 : nMrkAnz; while (pHitObj==NULL && (bBack ? nMrkNum<nMrkAnz : nMrkNum>0)) { if (!bBack) nMrkNum--; SdrMark* pM=GetSdrMarkByIndex(nMrkNum); @@ -1821,7 +1817,7 @@ bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP return rpObj!=NULL; } -bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr* pnMarkNum, sal_uIntPtr nOptions) const +bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, size_t* pnMarkNum, sal_uIntPtr nOptions) const { SortMarkedObjects(); bool bBoundCheckOn2ndPass=(nOptions & SDRSEARCH_PASS2BOUND) !=0; @@ -1832,10 +1828,9 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie Point aPt(rPnt); sal_uInt16 nTol=(sal_uInt16)nHitTolLog; bool bFnd=false; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - sal_uIntPtr nMarkNum; - for (nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) { - nMarkNum--; + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) { + --nMarkNum; SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrPageView* pPV=pM->GetPageView(); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -1849,10 +1844,10 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie if ((bBoundCheckOn2ndPass || bCheckNearestOn3rdPass) && !bFnd) { SdrObject* pBestObj=NULL; SdrPageView* pBestPV=NULL; - sal_uIntPtr nBestMarkNum=0; + size_t nBestMarkNum=0; sal_uIntPtr nBestDist=ULONG_MAX; - for (nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) { - nMarkNum--; + for (size_t nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) { + --nMarkNum; SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrPageView* pPV=pM->GetPageView(); SdrObject* pObj=pM->GetMarkedSdrObj(); @@ -1946,7 +1941,7 @@ void SdrMarkView::AdjustMarkHdl() Rectangle SdrMarkView::GetMarkedObjBoundRect() const { Rectangle aRect; - for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) { + for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); Rectangle aR1(pO->GetCurrentBoundRect()); @@ -1976,7 +1971,7 @@ const Rectangle& SdrMarkView::GetMarkedObjRect() const ((SdrMarkView*)this)->bMarkedObjRectDirty=false; Rectangle aRect; Rectangle aRect2; - for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) { + for (size_t nm=0; nm<GetMarkedObjectCount(); ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); Rectangle aR1(pO->GetSnapRect()); @@ -2034,9 +2029,9 @@ bool SdrMarkView::EnterMarkedGroup() if(pPV) { bool bEnter=false; - for (sal_uInt32 nm(GetMarkedObjectCount()); nm > 0 && !bEnter;) + for (size_t nm = GetMarkedObjectCount(); nm > 0 && !bEnter;) { - nm--; + --nm; SdrMark* pM=GetSdrMarkByIndex(nm); if (pM->GetPageView()==pPV) { SdrObject* pObj=pM->GetMarkedSdrObj(); diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx index e024082c218b..06580daa7f2b 100644 --- a/svx/source/svdraw/svdmrkv1.cxx +++ b/svx/source/svdraw/svdmrkv1.cxx @@ -35,9 +35,9 @@ bool SdrMarkView::HasMarkablePoints() const ForceUndirtyMrkPnt(); bool bRet=false; if (!ImpIsFrameHandles()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - if (nMarkAnz<=nFrameHandlesLimit) { - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + if (nMarkAnz<=static_cast<size_t>(nFrameHandlesLimit)) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && !bRet; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); bRet=pObj->IsPolyObj(); @@ -52,9 +52,9 @@ sal_uIntPtr SdrMarkView::GetMarkablePointCount() const ForceUndirtyMrkPnt(); sal_uIntPtr nAnz=0; if (!ImpIsFrameHandles()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - if (nMarkAnz<=nFrameHandlesLimit) { - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + if (nMarkAnz<=static_cast<size_t>(nFrameHandlesLimit)) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); if (pObj->IsPolyObj()) { @@ -71,9 +71,9 @@ bool SdrMarkView::HasMarkedPoints() const ForceUndirtyMrkPnt(); bool bRet=false; if (!ImpIsFrameHandles()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - if (nMarkAnz<=nFrameHandlesLimit) { - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + if (nMarkAnz<=static_cast<size_t>(nFrameHandlesLimit)) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && !bRet; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrUShortCont* pPts=pM->GetMarkedPoints(); bRet=pPts!=NULL && !pPts->empty(); @@ -88,9 +88,9 @@ sal_uIntPtr SdrMarkView::GetMarkedPointCount() const ForceUndirtyMrkPnt(); sal_uIntPtr nAnz=0; if (!ImpIsFrameHandles()) { - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - if (nMarkAnz<=nFrameHandlesLimit) { - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) { + size_t nMarkAnz=GetMarkedObjectCount(); + if (nMarkAnz<=static_cast<size_t>(nFrameHandlesLimit)) { + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrUShortCont* pPts=pM->GetMarkedPoints(); if (pPts!=NULL) nAnz+=pPts->size(); @@ -124,8 +124,8 @@ bool SdrMarkView::ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark) if (pMark==NULL) { - sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj); - if (nMarkNum==CONTAINER_ENTRY_NOTFOUND) + const size_t nMarkNum=TryToFindMarkedObject(pObj); + if (nMarkNum==SAL_MAX_SIZE) return false; pMark=GetSdrMarkByIndex(nMarkNum); } @@ -168,9 +168,9 @@ bool SdrMarkView::ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark) } else { - for (sal_uIntPtr i = aHdl.GetHdlCount(); i>0;) + for (size_t i = aHdl.GetHdlCount(); i>0;) { - i--; + --i; SdrHdl* pPlusHdl=aHdl.GetHdl(i); if (pPlusHdl->IsPlusHdl() && pPlusHdl->GetSourceHdlNum()==nHdlNum) { @@ -193,8 +193,8 @@ bool SdrMarkView::MarkPoint(SdrHdl& rHdl, bool bUnmark) bool bRet=false; const SdrObject* pObj=rHdl.GetObj(); if (IsPointMarkable(rHdl) && rHdl.IsSelected()==bUnmark) { - sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj); - if (nMarkNum!=CONTAINER_ENTRY_NOTFOUND) { + const size_t nMarkNum=TryToFindMarkedObject(pObj); + if (nMarkNum!=SAL_MAX_SIZE) { SdrMark* pM=GetSdrMarkByIndex(nMarkNum); pM->ForceMarkedPoints(); if (ImpMarkPoint(&rHdl,pM,bUnmark)) { @@ -216,16 +216,16 @@ bool SdrMarkView::MarkPoints(const Rectangle* pRect, bool bUnmark) const SdrPageView* pPV0=NULL; SdrMark* pM=NULL; aHdl.Sort(); - sal_uIntPtr nHdlAnz=aHdl.GetHdlCount(); - for (sal_uIntPtr nHdlNum=nHdlAnz; nHdlNum>0;) { - nHdlNum--; + const size_t nHdlAnz=aHdl.GetHdlCount(); + for (size_t nHdlNum=nHdlAnz; nHdlNum>0;) { + --nHdlNum; SdrHdl* pHdl=aHdl.GetHdl(nHdlNum); if (IsPointMarkable(*pHdl) && pHdl->IsSelected()==bUnmark) { const SdrObject* pObj=pHdl->GetObj(); const SdrPageView* pPV=pHdl->GetPageView(); if (pObj!=pObj0 || pPV!=pPV0 || pM==NULL) { // This section is for optimization, - sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj); // so ImpMarkPoint() doesn't always - if (nMarkNum!=CONTAINER_ENTRY_NOTFOUND) { // have to search the object in the MarkList. + const size_t nMarkNum=TryToFindMarkedObject(pObj); // so ImpMarkPoint() doesn't always + if (nMarkNum!=SAL_MAX_SIZE) { // have to search the object in the MarkList. pM=GetSdrMarkByIndex(nMarkNum); pObj0=pObj; pPV0=pPV; @@ -284,8 +284,8 @@ void SdrMarkView::ImpSetPointsRects() const { Rectangle aPnts; Rectangle aGlue; - sal_uIntPtr nHdlAnz=aHdl.GetHdlCount(); - for (sal_uIntPtr nHdlNum=0; nHdlNum<nHdlAnz; nHdlNum++) { + const size_t nHdlAnz=aHdl.GetHdlCount(); + for (size_t nHdlNum=0; nHdlNum<nHdlAnz; ++nHdlNum) { const SdrHdl* pHdl=aHdl.GetHdl(nHdlNum); SdrHdlKind eKind=pHdl->GetKind(); if ((eKind==HDL_POLY && pHdl->IsSelected()) || eKind==HDL_GLUE) { @@ -313,8 +313,8 @@ void SdrMarkView::ImpSetPointsRects() const void SdrMarkView::UndirtyMrkPnt() const { bool bChg=false; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); // PolyPoints @@ -380,8 +380,8 @@ bool SdrMarkView::HasMarkableGluePoints() const bool bRet=false; if (IsGluePointEditMode()) { ForceUndirtyMrkPnt(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && !bRet; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrGluePointList* pGPL=pObj->GetGluePointList(); @@ -406,8 +406,8 @@ bool SdrMarkView::HasMarkedGluePoints() const { ForceUndirtyMrkPnt(); bool bRet=false; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nMarkNum=0; nMarkNum<nMarkAnz && !bRet; ++nMarkNum) { const SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); bRet=pPts!=NULL && !pPts->empty(); @@ -421,8 +421,8 @@ bool SdrMarkView::MarkGluePoints(const Rectangle* pRect, bool bUnmark) ForceUndirtyMrkPnt(); bool bChgd=false; SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) { + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nMarkNum=0; nMarkNum<nMarkAnz; ++nMarkNum) { SdrMark* pM=GetSdrMarkByIndex(nMarkNum); const SdrObject* pObj=pM->GetMarkedSdrObj(); const SdrGluePointList* pGPL=pObj->GetGluePointList(); @@ -479,11 +479,11 @@ bool SdrMarkView::PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16 if (pOut==NULL) pOut=GetFirstOutputDevice(); if (pOut==NULL) return false; SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - sal_uIntPtr nMarkNum=bBack ? 0 : nMarkAnz; + const size_t nMarkAnz=GetMarkedObjectCount(); + size_t nMarkNum=bBack ? 0 : nMarkAnz; if (bNext) { nMarkNum=((SdrMarkView*)this)->TryToFindMarkedObject(pObj0); - if (nMarkNum==CONTAINER_ENTRY_NOTFOUND) return false; + if (nMarkNum==SAL_MAX_SIZE) return false; if (!bBack) nMarkNum++; } while (bBack ? nMarkNum<nMarkAnz : nMarkNum>0) { @@ -520,8 +520,8 @@ bool SdrMarkView::MarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const Sdr ForceUndirtyMrkPnt(); bool bChgd=false; if (pObj!=NULL) { - sal_uIntPtr nMarkPos=TryToFindMarkedObject(pObj); - if (nMarkPos!=CONTAINER_ENTRY_NOTFOUND) { + const size_t nMarkPos=TryToFindMarkedObject(pObj); + if (nMarkPos!=SAL_MAX_SIZE) { SdrMark* pM=GetSdrMarkByIndex(nMarkPos); SdrUShortCont* pPts=bUnmark ? pM->GetMarkedGluePoints() : pM->ForceMarkedGluePoints(); if (pPts!=NULL) { @@ -550,8 +550,8 @@ bool SdrMarkView::IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const { ForceUndirtyMrkPnt(); bool bRet=false; - sal_uIntPtr nPos=((SdrMarkView*)this)->TryToFindMarkedObject(pObj); // casting to NonConst - if (nPos!=CONTAINER_ENTRY_NOTFOUND) { + const size_t nPos=((SdrMarkView*)this)->TryToFindMarkedObject(pObj); // casting to NonConst + if (nPos!=SAL_MAX_SIZE) { const SdrMark* pM=GetSdrMarkByIndex(nPos); const SdrUShortCont* pPts=pM->GetMarkedGluePoints(); if (pPts!=NULL) { @@ -564,8 +564,8 @@ bool SdrMarkView::IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const SdrHdl* SdrMarkView::GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const { ForceUndirtyMrkPnt(); - sal_uIntPtr nHdlAnz=aHdl.GetHdlCount(); - for (sal_uIntPtr nHdlNum=0; nHdlNum<nHdlAnz; nHdlNum++) { + const size_t nHdlAnz=aHdl.GetHdlCount(); + for (size_t nHdlNum=0; nHdlNum<nHdlAnz; ++nHdlNum) { SdrHdl* pHdl=aHdl.GetHdl(nHdlNum); if (pHdl->GetObj()==pObj && pHdl->GetKind()==HDL_GLUE && diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 9a2e18fc1e2a..4a1e9502f8e7 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -148,10 +148,10 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl { const SdrMarkView& rMarkView = *rDrag.GetView(); const SdrHdlList& rHdlList = rMarkView.GetHdlList(); - const sal_uInt32 nHdlCount = rHdlList.GetHdlCount(); + const size_t nHdlCount = rHdlList.GetHdlCount(); const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdl(0) ? rHdlList.GetHdl(0)->GetObj() : 0); - for(sal_uInt32 a(0); a < nHdlCount; a++) + for(size_t a = 0; a < nHdlCount; ++a) { SdrHdl* pTestHdl = rHdlList.GetHdl(a); @@ -576,11 +576,11 @@ bool ImpPathForDragAndCreate::beginPathDrag( SdrDragStat& rDrag ) const { const SdrMarkView& rMarkView = *rDrag.GetView(); const SdrHdlList& rHdlList = rMarkView.GetHdlList(); - const sal_uInt32 nHdlCount = rHdlList.GetHdlCount(); + const size_t nHdlCount = rHdlList.GetHdlCount(); const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdl(0) ? rHdlList.GetHdl(0)->GetObj() : 0); sal_uInt32 nSelectedPoints(0); - for(sal_uInt32 a(0); a < nHdlCount; a++) + for(size_t a = 0; a < nHdlCount; ++a) { SdrHdl* pTestHdl = rHdlList.GetHdl(a); diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 83cac52987a6..122e8a59477c 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -235,7 +235,7 @@ void SdrVirtObj::AddToHdlList(SdrHdlList& rHdlList) const // get handles using AddToHdlList from ref object SdrHdlList aLocalList(0); rRefObj.AddToHdlList(aLocalList); - const sal_uInt32 nHdlCount(aLocalList.GetHdlCount()); + const size_t nHdlCount(aLocalList.GetHdlCount()); if(nHdlCount) { @@ -243,7 +243,7 @@ void SdrVirtObj::AddToHdlList(SdrHdlList& rHdlList) const // two lists then const Point aOffset(GetOffset()); - for(sal_uInt32 a(0L); a < nHdlCount; a++) + for(size_t a = 0; a < nHdlCount; ++a) { SdrHdl* pCandidate = aLocalList.GetHdl(a); pCandidate->SetPos(pCandidate->GetPos() + aOffset); @@ -254,7 +254,7 @@ void SdrVirtObj::AddToHdlList(SdrHdlList& rHdlList) const // source list is deleted while(aLocalList.GetHdlCount()) { - aLocalList.RemoveHdl(aLocalList.GetHdlCount() - 1L); + aLocalList.RemoveHdl(aLocalList.GetHdlCount() - 1); } } } diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index ec74e3cbd4dc..fcd5b0a5a7d6 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -63,7 +63,7 @@ SdrPolyEditView::~SdrPolyEditView() void SdrPolyEditView::ImpCheckPolyPossibilities() { ImpResetPolyPossibilityFlags(); - const sal_uIntPtr nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); if(nMarkAnz && !ImpIsFrameHandles()) { @@ -74,7 +74,7 @@ void SdrPolyEditView::ImpCheckPolyPossibilities() bool bSegmFuz(false); basegfx::B2VectorContinuity eSmooth = basegfx::CONTINUITY_NONE; - for(sal_uIntPtr nMarkNum(0L); nMarkNum < nMarkAnz; nMarkNum++) + for(size_t nMarkNum = 0; nMarkNum < nMarkAnz; ++nMarkNum) { SdrMark* pM = GetSdrMarkByIndex(nMarkNum); CheckPolyPossibilitiesHelper( pM, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth ); @@ -204,11 +204,11 @@ void SdrPolyEditView::SetMarkedPointsSmooth(SdrPathSmoothKind eKind) const bool bUndo = IsUndoEnabled(); if( bUndo ) BegUndo(ImpGetResStr(STR_EditSetPointsSmooth), GetDescriptionOfMarkedPoints()); - sal_uIntPtr nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); - for(sal_uIntPtr nMarkNum(nMarkAnz); nMarkNum > 0L;) + for(size_t nMarkNum(nMarkAnz); nMarkNum > 0;) { - nMarkNum--; + --nMarkNum; SdrMark* pM = GetSdrMarkByIndex(nMarkNum); SdrUShortCont* pPts = pM->GetMarkedPoints(); SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() ); @@ -239,11 +239,11 @@ void SdrPolyEditView::SetMarkedSegmentsKind(SdrPathSegmentKind eKind) const bool bUndo = IsUndoEnabled(); if( bUndo ) BegUndo(ImpGetResStr(STR_EditSetSegmentsKind), GetDescriptionOfMarkedPoints()); - sal_uIntPtr nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); - for(sal_uIntPtr nMarkNum(nMarkAnz); nMarkNum > 0L;) + for(size_t nMarkNum=nMarkAnz; nMarkNum > 0;) { - nMarkNum--; + --nMarkNum; SdrMark* pM = GetSdrMarkByIndex(nMarkNum); SdrUShortCont* pPts = pM->GetMarkedPoints(); SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() ); @@ -300,7 +300,7 @@ void SdrPolyEditView::DeleteMarkedPoints() { BrkAction(); SortMarkedObjects(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); + const size_t nMarkAnz=GetMarkedObjectCount(); const bool bUndo = IsUndoEnabled(); if( bUndo ) @@ -309,9 +309,9 @@ void SdrPolyEditView::DeleteMarkedPoints() BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE); } - for (sal_uIntPtr nMarkNum=nMarkAnz; nMarkNum>0;) + for (size_t nMarkNum=nMarkAnz; nMarkNum>0;) { - nMarkNum--; + --nMarkNum; SdrMark* pM=GetSdrMarkByIndex(nMarkNum); SdrUShortCont* pPts=pM->GetMarkedPoints(); SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() ); @@ -354,15 +354,15 @@ void SdrPolyEditView::RipUpAtMarkedPoints() if(HasMarkedPoints()) { SortMarkedObjects(); - sal_uInt32 nMarkAnz(GetMarkedObjectCount()); + const size_t nMarkAnz(GetMarkedObjectCount()); const bool bUndo = IsUndoEnabled(); if( bUndo ) BegUndo(ImpGetResStr(STR_EditRipUp), GetDescriptionOfMarkedPoints()); - for(sal_uInt32 nMarkNum(nMarkAnz); nMarkNum > 0L;) + for(size_t nMarkNum = nMarkAnz; nMarkNum > 0;) { - nMarkNum--; + --nMarkNum; SdrMark* pM = GetSdrMarkByIndex(nMarkNum); SdrUShortCont* pPts = pM->GetMarkedPoints(); SdrPathObj* pObj = PTR_CAST(SdrPathObj, pM->GetMarkedSdrObj()); @@ -428,9 +428,9 @@ void SdrPolyEditView::RipUpAtMarkedPoints() bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const { bool bRetval(false); - const sal_uInt32 nMarkCount(GetMarkedObjectCount()); + const size_t nMarkCount(GetMarkedObjectCount()); - for(sal_uInt32 a(0); a < nMarkCount; a++) + for(size_t a = 0; a < nMarkCount; ++a) { const SdrMark* pMark = GetSdrMarkByIndex(a); const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj()); @@ -473,9 +473,9 @@ bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const bool SdrPolyEditView::IsOpenCloseMarkedObjectsPossible() const { bool bRetval(false); - const sal_uInt32 nMarkCount(GetMarkedObjectCount()); + const size_t nMarkCount(GetMarkedObjectCount()); - for(sal_uInt32 a(0); a < nMarkCount; a++) + for(size_t a = 0; a < nMarkCount; ++a) { const SdrMark* pMark = GetSdrMarkByIndex(a); const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj()); @@ -504,9 +504,9 @@ SdrObjClosedKind SdrPolyEditView::GetMarkedObjectsClosedState() const { bool bOpen(false); bool bClosed(false); - const sal_uInt32 nMarkCount(GetMarkedObjectCount()); + const size_t nMarkCount(GetMarkedObjectCount()); - for(sal_uInt32 a(0); !(bOpen && bClosed) && a < nMarkCount; a++) + for(size_t a = 0; !(bOpen && bClosed) && a < nMarkCount; ++a) { const SdrMark* pMark = GetSdrMarkByIndex(a); const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj()); @@ -547,8 +547,8 @@ void SdrPolyEditView::CloseMarkedObjects(bool bToggle, bool bOpen) BegUndo(ImpGetResStr(STR_EditShut),GetDescriptionOfMarkedPoints()); bool bChg=false; - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pO=pM->GetMarkedSdrObj(); @@ -582,8 +582,8 @@ void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* { const bool bUndo = IsUndoEnabled(); - sal_uIntPtr nMarkAnz=GetMarkedObjectCount(); - for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) + const size_t nMarkAnz=GetMarkedObjectCount(); + for (size_t nm=0; nm<nMarkAnz; ++nm) { SdrMark* pM=GetSdrMarkByIndex(nm); SdrObject* pObj=pM->GetMarkedSdrObj(); diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 9da38fbcac02..430965a5690c 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1298,8 +1298,8 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView) rView.BegUndo(aStr); } - sal_uIntPtr nAnz=rML.GetMarkCount(); - for (sal_uIntPtr nm=0; nm<nAnz; nm++) + const size_t nAnz=rML.GetMarkCount(); + for (size_t nm=0; nm<nAnz; ++nm) { SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj(); SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj2); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 9edcaf8186f8..a446cb75b3e7 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -851,10 +851,10 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) bRet=MarkNextObj(aLogicPos,nHitTolLog,rVEvt.bMarkPrev); } else { SortMarkedObjects(); - sal_uIntPtr nAnz0=GetMarkedObjectCount(); + const size_t nAnz0=GetMarkedObjectCount(); bRet=MarkObj(aLogicPos,nHitTolLog,rVEvt.bAddMark); SortMarkedObjects(); - sal_uIntPtr nAnz1=GetMarkedObjectCount(); + const size_t nAnz1=GetMarkedObjectCount(); bUnmark=nAnz1<nAnz0; } if (!bUnmark) { @@ -1073,7 +1073,7 @@ Pointer SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDevice* // are 3D objects selected? bool b3DObjSelected = false; - for (sal_uInt32 a=0; !b3DObjSelected && a<GetMarkedObjectCount(); a++) { + for (size_t a=0; !b3DObjSelected && a<GetMarkedObjectCount(); ++a) { SdrObject* pObj = GetMarkedObjectByIndex(a); if(pObj && pObj->ISA(E3dObject)) b3DObjSelected = true; @@ -1298,12 +1298,12 @@ SdrViewContext SdrView::GetContext() const if( IsGluePointEditMode() ) return SDRCONTEXT_GLUEPOINTEDIT; - const sal_uIntPtr nMarkAnz = GetMarkedObjectCount(); + const size_t nMarkAnz = GetMarkedObjectCount(); if( HasMarkablePoints() && !IsFrameHandles() ) { bool bPath=true; - for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && bPath; nMarkNum++ ) + for( size_t nMarkNum = 0; nMarkNum < nMarkAnz && bPath; ++nMarkNum ) if (!GetMarkedObjectByIndex(nMarkNum)->ISA(SdrPathObj)) bPath=false; @@ -1315,7 +1315,7 @@ SdrViewContext SdrView::GetContext() const { bool bGraf = true, bMedia = true, bTable = true; - for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && ( bGraf || bMedia ); nMarkNum++ ) + for( size_t nMarkNum = 0; nMarkNum < nMarkAnz && ( bGraf || bMedia ); ++nMarkNum ) { const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum ); DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" ); diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index e6f179f1c24f..2c3bee7e14e4 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -684,9 +684,8 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ]; const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin(); const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), false ); - sal_uInt32 n, nCount; - for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ ) + for( size_t n = 0, nCount = GetMarkedObjectCount(); n < nCount; ++n ) { SdrMark* pMark = GetSdrMarkByIndex( n ); @@ -697,11 +696,11 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* rObjVector1.push_back( pMark ); } - for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ ) + for( size_t n = 0, nCount = aObjVectors.size(); n < nCount; ++n ) { ::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ]; - for( sal_uInt32 i = 0; i < rObjVector.size(); i++ ) + for( size_t i = 0; i < rObjVector.size(); ++i ) { SdrMark* pMark = rObjVector[ i ]; aRetval.push_back(pMark->GetMarkedSdrObj()); diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 57b507c54d6b..9009414e1821 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2225,8 +2225,8 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const rHdlList.AddHdl( pH = new SdrHdl(aRect.BottomCenter(),HDL_LOWER) ); pH->SetMoveOutside( true ); rHdlList.AddHdl( pH = new SdrHdl(aRect.BottomRight(),HDL_LWRGT) ); pH->SetMoveOutside( true ); - sal_uIntPtr nHdlCount = rHdlList.GetHdlCount(); - for( sal_uIntPtr nHdl = 0; nHdl < nHdlCount; nHdl++ ) + const size_t nHdlCount = rHdlList.GetHdlCount(); + for( size_t nHdl = 0; nHdl < nHdlCount; ++nHdl ) rHdlList.GetHdl(nHdl)->SetObj((SdrObject*)this); } @@ -2242,9 +2242,9 @@ SdrHdl* SdrTableObj::GetHdl(sal_uInt32 nHdlNum) const SdrHdl* pRetval = 0; SdrHdlList aLocalList(0); AddToHdlList(aLocalList); - const sal_uInt32 nHdlCount(aLocalList.GetHdlCount()); + const size_t nHdlCount(aLocalList.GetHdlCount()); - if(nHdlCount && nHdlNum < nHdlCount) + if(nHdlCount && static_cast<size_t>(nHdlNum) < nHdlCount) { // remove and remember. The other created handles will be deleted again with the // destruction of the local list diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index eea2995837f0..9ff2bb2cc502 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -871,7 +871,7 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) bool bEnableTransparency = true; bool bEnableCrop = ( 1 == rMarkList.GetMarkCount() ); - for( int i = 0, nCount = rMarkList.GetMarkCount(); i < nCount; ++i ) + for( size_t i = 0, nCount = rMarkList.GetMarkCount(); i < nCount; ++i ) { SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( i )->GetMarkedSdrObj() ); diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 191e91dcb05e..eb37bc6e892f 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -546,9 +546,9 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB if (pSdrView) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); - for(i=0; i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -625,7 +625,7 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sViewPoint( "ViewPoint" ); @@ -638,7 +638,7 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) double fFinalSkewAngle = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -776,7 +776,7 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sProjectionMode( "ProjectionMode" ); @@ -786,7 +786,7 @@ void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet ) sal_Int32 nFinalProjection = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -832,7 +832,7 @@ void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet ) void getExtrusionSurfaceState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sShadeMode( "ShadeMode" ); @@ -844,7 +844,7 @@ void getExtrusionSurfaceState( SdrView* pSdrView, SfxItemSet& rSet ) sal_Int32 nFinalSurface = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -920,7 +920,7 @@ void getExtrusionSurfaceState( SdrView* pSdrView, SfxItemSet& rSet ) void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sDepth( "Depth" ); @@ -930,7 +930,7 @@ void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet ) double fFinalDepth = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -1000,7 +1000,7 @@ static bool compare_direction( const Direction3D& d1, const Direction3D& d2 ) void getExtrusionLightingDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sFirstLightDirection( "FirstLightDirection" ); @@ -1016,7 +1016,7 @@ void getExtrusionLightingDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) int nFinalDirection = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -1081,7 +1081,7 @@ void getExtrusionLightingDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sBrightness( "Brightness" ); @@ -1091,7 +1091,7 @@ void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet ) int nFinalLevel = -1; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -1149,7 +1149,7 @@ void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet ) void getExtrusionColorState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); static const OUString sExtrusion( "Extrusion" ); static const OUString sExtrusionColor( "Color" ); @@ -1161,7 +1161,7 @@ void getExtrusionColorState( SdrView* pSdrView, SfxItemSet& rSet ) Color aFinalColor; bool bHasCustomShape = false; - for(i=0;i<nCount; i++) + for(size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -1224,10 +1224,10 @@ bool checkForSelectedCustomShapes( SdrView* pSdrView, bool bOnlyExtruded ) static const OUString sExtrusion( "Extrusion" ); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); bool bFound = false; - for(i=0;(i<nCount) && !bFound ; i++) + for(size_t i=0;(i<nCount) && !bFound ; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index 24a1c25b927c..8bf103061ddc 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -51,10 +51,10 @@ using namespace ::com::sun::star::uno; void SetAlignmentState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); sal_Int32 nAlignment = -1; - for( i = 0; i < nCount; i++ ) + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -88,10 +88,10 @@ void SetAlignmentState( SdrView* pSdrView, SfxItemSet& rSet ) void SetCharacterSpacingState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); sal_Int32 nCharacterSpacing = -1; - for( i = 0; i < nCount; i++ ) + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -113,10 +113,10 @@ void SetCharacterSpacingState( SdrView* pSdrView, SfxItemSet& rSet ) void SetKernCharacterPairsState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); bool bChecked = false; - for( i = 0; i < nCount; i++ ) + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -132,11 +132,11 @@ void SetKernCharacterPairsState( SdrView* pSdrView, SfxItemSet& rSet ) void SetFontWorkShapeTypeState( SdrView* pSdrView, SfxItemSet& rSet ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); OUString aFontWorkShapeType; - for( i = 0; i < nCount; i++ ) + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA( SdrObjCustomShape ) ) @@ -225,9 +225,9 @@ bool checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nCheckStatus ) static const OUString sTextPath( "TextPath" ); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; + const size_t nCount = rMarkList.GetMarkCount(); bool bFound = false; - for(i=0;(i<nCount) && !bFound ; i++) + for(size_t i=0; (i<nCount) && !bFound ; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -449,8 +449,8 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi if ( !aCustomShape.isEmpty() ) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uInt32 nCount = rMarkList.GetMarkCount(), i; - for( i = 0; i < nCount; i++ ) + const size_t nCount = rMarkList.GetMarkCount(); + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) @@ -525,8 +525,8 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT; const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; - for( i = 0; i < nCount; i++ ) + const size_t nCount = rMarkList.GetMarkCount(); + for( size_t i = 0; i < nCount; ++i ) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if( pObj->ISA(SdrObjCustomShape) ) diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index faeeebc87847..13a38104a3a6 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -273,7 +273,7 @@ void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xS for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() ) { - if(CONTAINER_ENTRY_NOTFOUND != pView->TryToFindMarkedObject(pSdrShape)) + if(SAL_MAX_SIZE != pView->TryToFindMarkedObject(pSdrShape)) { pView->MarkObj(pSdrShape, pView->GetSdrPageView(), true, false); } diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 7c089b26958a..07e1c8fd6fb2 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -668,7 +668,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() if(pCrsrShell->Imp()->GetDrawView()) { const SdrMarkList &rMrkList = pCrsrShell->Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark(i)->GetMarkedSdrObj(); SwFrmFmt* pFmt = ((SwDrawContact*)pObj->GetUserCall())->GetFmt(); diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 25bcb900adc6..767fec89f256 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -221,7 +221,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView ) bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned(); } // Destroy ContactObjects and formats. - for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); @@ -309,7 +309,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList(); std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L ); - const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() ); + const size_t nMarkCount( rMrkList.GetMarkCount() ); if ( nMarkCount ) { pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount]; @@ -317,7 +317,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) if( !pMyObj->GetUpGroup() ) { OUString sDrwFmtNm("DrawObject"); - for ( sal_uInt16 i = 0; i < nMarkCount; ++i ) + for ( size_t i = 0; i < nMarkCount; ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( pObj->IsA( TYPE(SdrObjGroup) ) ) @@ -354,7 +354,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) rDrawView.UnGroupMarked(); // creation of <SwDrawContact> instances for the former group members and // its connection to the Writer layout. - for ( sal_uInt32 i = 0; i < nMarkCount; ++i ) + for ( size_t i = 0; i < nMarkCount; ++i ) { SwUndoDrawUnGroupConnectToLayout* pUndo = 0; if( bUndo ) @@ -390,7 +390,6 @@ bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) if( rMrkList.GetMarkCount() ) { GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); - sal_uInt16 i; bool bDelMarked = true; if( 1 == rMrkList.GetMarkCount() ) @@ -408,7 +407,7 @@ bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) } } - for( i = 0; i < rMrkList.GetMarkCount(); ++i ) + for( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if( !pObj->ISA(SwVirtFlyDrawObj) ) @@ -436,7 +435,7 @@ bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) : new SwUndoDrawDelete( (sal_uInt16)rMrkList.GetMarkCount() ); // Destroy ContactObjects, save formats. - for( i = 0; i < rMrkList.GetMarkCount(); ++i ) + for( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrMark& rMark = *rMrkList.GetMark( i ); pObj = rMark.GetMarkedSdrObj(); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index ff8e0ffe4955..2283ac43d837 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -695,7 +695,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL ); bool bUnmark = false; - for ( sal_uInt16 i = 0; i < _rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < _rMrkList.GetMarkCount(); ++i ) { SdrObject* pObj = _rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( !pObj->ISA(SwVirtFlyDrawObj) ) diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 19609f6543d1..b8f834b89f7d 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -153,10 +153,10 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt else { // check if the object is selected in this view - const sal_uInt32 nMarkCount(rMrkList.GetMarkCount()); + const size_t nMarkCount(rMrkList.GetMarkCount()); bool bSelected(false); - for(sal_uInt32 a(0); !bSelected && a < nMarkCount; a++) + for(size_t a = 0; !bSelected && a < nMarkCount; ++a) { if(pSwVirtFlyDrawObj == rMrkList.GetMark(a)->GetMarkedSdrObj()) { @@ -818,7 +818,7 @@ void SwDrawView::CheckPossibilities() const SdrMarkList &rMrkList = GetMarkedObjectList(); bool bProtect = false; bool bSzProtect = false; - for ( sal_uInt16 i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); const SwFrm *pFrm = NULL; @@ -890,7 +890,7 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView ) { // collect marked objects in a local data structure std::vector<SdrObject*> aMarkedObjs; - for( sal_uInt32 i = 0; i < rMarkList.GetMarkCount(); ++i ) + for( size_t i = 0; i < rMarkList.GetMarkCount(); ++i ) { SdrObject* pMarkedObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); aMarkedObjs.push_back( pMarkedObj ); @@ -945,7 +945,7 @@ void SwDrawView::DeleteMarked() // Check what textboxes have to be deleted afterwards. const SdrMarkList& rMarkList = GetMarkedObjectList(); std::vector<SwFrmFmt*> aTextBoxesToDelete; - for (sal_uInt16 i = 0; i < rMarkList.GetMarkCount(); ++i) + for (size_t i = 0; i < rMarkList.GetMarkCount(); ++i) { SdrObject *pObject = rMarkList.GetMark(i)->GetMarkedSdrObj(); SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall(pObject)); diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index 73c98c53482f..e3a928d4c66f 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -239,7 +239,7 @@ static void lcl_SelectSdrMarkList( SwEditShell* pShell, { SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell ); bool bFirst = true; - for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) + for( size_t i = 0; i < pSdrMarkList->GetMarkCount(); ++i ) { SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj(); if( pObj ) diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 6bdf41fc9f6e..f4fcbb6044f8 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -178,7 +178,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt ) { SwPosition aPos( aSttIdx, SwIndex( pTxtNd, 0 )); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); @@ -283,7 +283,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, // The list should be copied, because below new objects will be selected const SdrMarkList aMrkList( Imp()->GetDrawView()->GetMarkedObjectList() ); - sal_uLong nMarkCount = aMrkList.GetMarkCount(); + const size_t nMarkCount = aMrkList.GetMarkCount(); if( !pDestShell->Imp()->GetDrawView() ) // should create it now pDestShell->MakeDrawView(); @@ -297,7 +297,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, SwDoc* pDestDoc = pDestShell->GetDoc(); Size aSiz( rInsPt.X() - rSttPt.X(), rInsPt.Y() - rSttPt.Y() ); - for( sal_uInt16 i = 0; i < nMarkCount; ++i ) + for( size_t i = 0; i < nMarkCount; ++i ) { SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj(); @@ -418,16 +418,13 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, const SdrMarkList aList( pSrcDrwView->GetMarkedObjectList() ); pSrcDrwView->UnmarkAll(); - sal_uLong nMrkCnt = aMrkList.GetMarkCount(); - sal_uInt16 i; - for ( i = 0; i < nMrkCnt; ++i ) + for ( size_t i = 0, nMrkCnt = aMrkList.GetMarkCount(); i < nMrkCnt; ++i ) { SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj(); pSrcDrwView->MarkObj( pObj, pSrcPgView ); } DelSelectedObj(); - nMrkCnt = aList.GetMarkCount(); - for ( i = 0; i < nMrkCnt; ++i ) + for ( size_t i = 0, nMrkCnt = aList.GetMarkCount(); i < nMrkCnt; ++i ) { SdrObject *pObj = aList.GetMark( i )->GetMarkedSdrObj(); pSrcDrwView->MarkObj( pObj, pSrcPgView ); @@ -1518,11 +1515,11 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt ) lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel ); pView->Paste(*pModel, aPos, NULL, 0, OUString(), OUString()); - sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount(); + const size_t nCnt = pView->GetMarkedObjectList().GetMarkCount(); if( nCnt ) { const Point aNull( 0, 0 ); - for( sal_uLong i=0; i < nCnt; ++i ) + for( size_t i=0; i < nCnt; ++i ) { SdrObject *pObj = pView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj(); pObj->ImpSetAnchorPos( aNull ); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index ce7b32d42581..a542f43f9d67 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1719,7 +1719,7 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const if( Imp()->HasDrawView() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for( sal_uInt32 i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i ) + for( size_t i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i ) { SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if( !pObj ) diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 6bbb858baa75..402a0e8ce3e0 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -212,7 +212,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) { // It sucks if Drawing objects were selected and now // additionally a fly is selected. - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pTmpObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); bool bForget = pTmpObj->ISA(SwVirtFlyDrawObj); @@ -227,7 +227,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) // If the fly frame is a textbox of a shape, then select the shape instead. std::map<SwFrmFmt*, SwFrmFmt*> aTextBoxShapes = SwTextBoxHelper::findShapes(mpDoc); - for (sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i) + for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i) { SdrObject* pObject = rMrkList.GetMark(i)->GetMarkedSdrObj(); SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall(pObject)); @@ -725,7 +725,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) // 2. The content of the frame itself has to be notified // 3. Frames displaced by the frame have to be notified // 4. Also Drawing objects can displace frames - for( sal_uInt16 j = 0; j < pLst->GetMarkCount(); ++j ) + for( size_t j = 0; j < pLst->GetMarkCount(); ++j ) { SwPageFrm *pPage; bool bCheckNeighbours = false; @@ -844,7 +844,7 @@ short SwFEShell::GetLayerId() const if ( Imp()->HasDrawView() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if( !pObj ) @@ -874,7 +874,7 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId ) const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess(); // correct type of <nControls> - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if( !pObj ) @@ -997,7 +997,7 @@ void SwFEShell::EndTextEdit() DelSelectedObj(); if ( aSave.GetMarkCount() ) { - for ( sal_uInt16 i = 0; i < aSave.GetMarkCount(); ++i ) + for ( size_t i = 0; i < aSave.GetMarkCount(); ++i ) pView->MarkObj( aSave.GetMark( i )->GetMarkedSdrObj(), Imp()->GetPageView() ); } @@ -1898,7 +1898,7 @@ bool SwFEShell::EndMark() SwFlyFrm* pOldSelFly = ::GetFlyFromMarked( &rMrkList, this ); if ( rMrkList.GetMarkCount() > 1 ) - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if( pObj->ISA(SwVirtFlyDrawObj) ) @@ -1948,7 +1948,7 @@ short SwFEShell::GetAnchorId() const if ( Imp()->HasDrawView() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( pObj->ISA(SwVirtFlyDrawObj) ) @@ -2056,7 +2056,7 @@ bool SwFEShell::IsGroupSelected() if ( IsObjSelected() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); // consider 'virtual' drawing objects. @@ -2087,7 +2087,7 @@ bool SwFEShell::IsGroupAllowed() const const SdrObject* pUpGroup = 0L; const SwFrm* pHeaderFooterFrm = 0L; const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i ) { const SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( i ) @@ -2274,7 +2274,7 @@ sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const if( Imp()->HasDrawView() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for( sal_uLong i = rMrkList.GetMarkCount(); i; ) + for( size_t i = rMrkList.GetMarkCount(); i; ) { SdrObject *pObj = rMrkList.GetMark( --i )->GetMarkedSdrObj(); if( !bParent ) @@ -2336,7 +2336,7 @@ bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const return false; const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); @@ -2366,7 +2366,7 @@ bool SwFEShell::SetObjAttr( const SfxItemSet& rSet ) StartUndo( UNDO_INSATTR ); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); @@ -2405,7 +2405,7 @@ void SwFEShell::CheckUnboundObjects() SET_CURR_SHELL( this ); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( !GetUserCall(pObj) ) diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 4bc36f4ea934..45547311a881 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -429,7 +429,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rTxt, cons // local list to perform the corresponding action for each object std::vector<SdrObject*> aDrawObjs; { - for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj(); if( pDrawObj ) diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index ede0e46043f6..570c4606a860 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -506,7 +506,7 @@ SwUndoDrawDelete::~SwUndoDrawDelete() if( bDelFmt ) { SwUndoGroupObjImpl* pTmp = pObjArr; - for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp ) + for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp ) delete pTmp->pFmt; } delete [] pObjArr; @@ -517,7 +517,7 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext) { bDelFmt = false; SwFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts(); - for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n ) + for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); ::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx ); @@ -542,7 +542,7 @@ void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext) { bDelFmt = true; SwFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts(); - for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n ) + for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); SdrObject *pObj = rSave.pObj; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index df20923ea4ad..d05805814c51 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -763,7 +763,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< if ( rMarkList.GetMarkCount() > 1 ) { bool bFlyInCnt = false; - for ( sal_uLong i = 0; !bFlyInCnt && i < rMarkList.GetMarkCount(); ++i ) + for ( size_t i = 0; !bFlyInCnt && i < rMarkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); if (FLY_AS_CHAR == ::FindFrmFmt(const_cast<SdrObject*>( diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 2aefdedb63c6..8fdac9743acb 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -520,7 +520,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if(1L == pSdrView->GetMarkedObjectCount()) { // #i68101# - SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); OUString aName(pSelected->GetName()); @@ -549,7 +549,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if(1L == pSdrView->GetMarkedObjectCount()) { - SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L); + SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0); OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); OUString aTitle(pSelected->GetTitle()); OUString aDescription(pSelected->GetDescription()); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 5c895ae64028..f5eb9aa1895d 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -659,11 +659,11 @@ bool SwView::AreOnlyFormsSelected() const SdrView* pSdrView = GetWrtShell().GetDrawView(); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - sal_uInt32 nCount = rMarkList.GetMarkCount(); + const size_t nCount = rMarkList.GetMarkCount(); if (nCount) { - for (sal_uInt32 i = 0; i < nCount; i++) + for (size_t i = 0; i < nCount; ++i) { // Except controls, are still normal draw objects selected? SdrObject *pSdrObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 05fd21692b3d..1f15014dfc9b 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -407,7 +407,7 @@ uno::Any SwXTextView::getSelection() comphelper::getProcessComponentContext()); const SdrMarkList& rMarkList = rSh.GetDrawView()->GetMarkedObjectList(); - for(sal_uLong i = 0; i < rMarkList.GetMarkCount(); ++i) + for(size_t i = 0; i < rMarkList.GetMarkCount(); ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); uno::Reference< uno::XInterface > xInt = pSvxDrawPage->GetInterface( pObj ); |