From 384cb5ff7b9227002206422d0bf4e75795d5f5cc Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Tue, 5 Aug 2014 22:30:24 +0200 Subject: Consistently use size_t and SAL_MAX_SIZE Instead of a mix of sal_uIntPtr, sal_uLong, int, and so on. Also change CONTAINER_ENTRY_NOTFOUND=ULONG_MAX to SAL_MAX_SIZE as return value in case of failure and in the related tests. Change-Id: Ie778a849253b4be84fbcdab9557b7c4240233927 --- reportdesign/source/ui/report/ReportSection.cxx | 11 +++++------ reportdesign/source/ui/report/SectionView.cxx | 19 +++++++++---------- reportdesign/source/ui/report/ViewsWindow.cxx | 14 +++++++------- reportdesign/source/ui/report/dlgedfunc.cxx | 4 ++-- reportdesign/source/ui/report/propbrw.cxx | 4 ++-- 5 files changed, 25 insertions(+), 27 deletions(-) (limited to 'reportdesign') 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 > 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(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(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; iGetMarkedSdrObj(); 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 (; iGetMarkedSdrObj(); 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((*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(pMark->GetMarkedSdrObj()) != NULL|| dynamic_cast(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(pMark->GetMarkedSdrObj()) != NULL || dynamic_cast(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(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 > 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;iGetMarkedSdrObj(); -- cgit tion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff