summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-08-05 22:30:24 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-08-16 21:52:28 +0200
commit384cb5ff7b9227002206422d0bf4e75795d5f5cc (patch)
tree21a15556a592c9bc42893c69d98d23b64c1a9464 /sd
parent7e605f124f78a7f8b97385fcb8b91dce2ec735d8 (diff)
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
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx18
-rw-r--r--sd/source/ui/dlg/animobjs.cxx6
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx4
-rw-r--r--sd/source/ui/func/fuconstr.cxx3
-rw-r--r--sd/source/ui/func/fucopy.cxx8
-rw-r--r--sd/source/ui/func/fuformatpaintbrush.cxx5
-rw-r--r--sd/source/ui/func/fuoaprms.cxx7
-rw-r--r--sd/source/ui/func/fuolbull.cxx4
-rw-r--r--sd/source/ui/func/fupoor.cxx2
-rw-r--r--sd/source/ui/func/fusel.cxx5
-rw-r--r--sd/source/ui/func/futext.cxx2
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx4
-rw-r--r--sd/source/ui/view/Outliner.cxx8
-rw-r--r--sd/source/ui/view/drawview.cxx8
-rw-r--r--sd/source/ui/view/drviews2.cxx27
-rw-r--r--sd/source/ui/view/drviews6.cxx2
-rw-r--r--sd/source/ui/view/drviews7.cxx8
-rw-r--r--sd/source/ui/view/drviewsa.cxx4
-rw-r--r--sd/source/ui/view/drviewse.cxx6
-rw-r--r--sd/source/ui/view/drviewsf.cxx4
-rw-r--r--sd/source/ui/view/drviewsg.cxx3
-rw-r--r--sd/source/ui/view/drviewsj.cxx6
-rw-r--r--sd/source/ui/view/sdview.cxx17
-rw-r--r--sd/source/ui/view/sdview2.cxx14
-rw-r--r--sd/source/ui/view/sdview3.cxx10
-rw-r--r--sd/source/ui/view/viewshel.cxx10
26 files changed, 95 insertions, 100 deletions
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 )