summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx15
-rw-r--r--svx/source/svdraw/svddrgmt.cxx9
-rw-r--r--svx/source/svdraw/svdedtv2.cxx12
-rw-r--r--svx/source/svdraw/svdglev.cxx16
-rw-r--r--svx/source/svdraw/svdhdl.cxx10
-rw-r--r--svx/source/svdraw/svdmark.cxx12
-rw-r--r--svx/source/svdraw/svdmrkv.cxx3
-rw-r--r--svx/source/svdraw/svdoashp.cxx82
-rw-r--r--svx/source/svdraw/svdobj.cxx3
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx4
-rw-r--r--svx/source/svdraw/svdotxat.cxx8
-rw-r--r--svx/source/svdraw/svdouno.cxx15
-rw-r--r--svx/source/svdraw/svdpage.cxx12
-rw-r--r--svx/source/svdraw/svdpagv.cxx14
-rw-r--r--svx/source/svdraw/svdpntv.cxx15
-rw-r--r--svx/source/svdraw/svdpoev.cxx26
16 files changed, 104 insertions, 152 deletions
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 0eb8e5c0db29..e6ee0bf0f289 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -53,9 +53,8 @@ IMPL_LINK(CandidateMgr, WindowEventListener, VclWindowEvent&, rEvent, void)
CandidateMgr::~CandidateMgr()
{
- for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
+ for (VclPtr<vcl::Window>& pCandidate : m_aCandidates)
{
- VclPtr<vcl::Window> pCandidate = *aI;
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
continue;
pCandidate->RemoveEventListener(LINK(this, CandidateMgr, WindowEventListener));
@@ -91,9 +90,9 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window const & rWindow, tools::
pCandidate = pCandidate->GetWindow( GetWindowType::Next );
}
- for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
+ for (const auto& rpCandidate : m_aCandidates)
{
- pCandidate = aI->get();
+ pCandidate = rpCandidate.get();
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
continue;
//rhbz#1007697 this can cause the window itself to be
@@ -153,11 +152,11 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
RectangleVector aRectangles;
aRegionPixel.GetRegionRectangles(aRectangles);
- for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
+ for(const auto& rRect : aRectangles)
{
// for each rectangle, copy the area
- const Point aTopLeft(aRectIter->TopLeft());
- const Size aSize(aRectIter->GetSize());
+ const Point aTopLeft(rRect.TopLeft());
+ const Size aSize(rRect.GetSize());
mpOutputDevice->DrawOutDev(
aTopLeft, aSize,
@@ -177,7 +176,7 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
mpOutputDevice->SetLineColor(aColor);
mpOutputDevice->SetFillColor();
- mpOutputDevice->DrawRect(*aRectIter);
+ mpOutputDevice->DrawRect(rRect);
}
#endif
}
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index cb0c3d1fa2c5..2c89ca4aabcb 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -476,10 +476,9 @@ void SdrDragMethod::createSdrDragEntries_PointDrag()
if(aPathXPP.count())
{
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(const sal_uInt16 nObjPt : rPts)
{
sal_uInt32 nPolyNum, nPointNum;
- const sal_uInt16 nObjPt = *it;
if(sdr::PolyPolygonEditor::GetRelativePolyPoint(aPathXPP, nObjPt, nPolyNum, nPointNum))
{
@@ -518,9 +517,8 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag()
if (pGPL)
{
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(const sal_uInt16 nObjPt : rPts)
{
- const sal_uInt16 nObjPt = *it;
const sal_uInt16 nGlueNum(pGPL->FindGluePoint(nObjPt));
if(SDRGLUEPOINT_NOTFOUND != nGlueNum)
@@ -1620,9 +1618,8 @@ void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
const SdrGluePointList* pGPL=pObj->GetGluePointList();
tools::Rectangle aBound(pObj->GetCurrentBoundRect());
- for (SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for (sal_uInt16 nId : rPts)
{
- sal_uInt16 nId = *it;
sal_uInt16 nGlueNum=pGPL->FindGluePoint(nId);
if (nGlueNum!=SDRGLUEPOINT_NOTFOUND)
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 4c9dc54612b8..732bd1ce63f8 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -826,10 +826,8 @@ void SdrEditView::DistributeMarkedObjects(weld::Window* pParent)
default: break;
}
- for ( itEntryList = aEntryList.begin();
- itEntryList < aEntryList.end() && (*itEntryList)->mnPos < pNew->mnPos;
- ++itEntryList )
- {};
+ itEntryList = std::find_if(aEntryList.begin(), aEntryList.end(),
+ [&pNew](const ImpDistributeEntry* pEntry) { return pEntry->mnPos >= pNew->mnPos; });
if ( itEntryList < aEntryList.end() )
aEntryList.insert( itEntryList, pNew );
else
@@ -921,10 +919,8 @@ void SdrEditView::DistributeMarkedObjects(weld::Window* pParent)
default: break;
}
- for ( itEntryList = aEntryList.begin();
- itEntryList < aEntryList.end() && (*itEntryList)->mnPos < pNew->mnPos;
- ++itEntryList )
- {};
+ itEntryList = std::find_if(aEntryList.begin(), aEntryList.end(),
+ [&pNew](const ImpDistributeEntry* pEntry) { return pEntry->mnPos >= pNew->mnPos; });
if ( itEntryList < aEntryList.end() )
aEntryList.insert( itEntryList, pNew );
else
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index c3badca8c0c6..a160b4610027 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -61,9 +61,8 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, co
if(!bConst && IsUndoEnabled() )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(sal_uInt16 nPtId : rPts)
{
- sal_uInt16 nPtId=*it;
sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
{
@@ -242,9 +241,8 @@ void SdrGlueEditView::DeleteMarkedGluePoints()
if( bUndo )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(sal_uInt16 nPtId : rPts)
{
- sal_uInt16 nPtId=*it;
sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
{
@@ -285,9 +283,8 @@ void SdrGlueEditView::ImpCopyMarkedGluePoints()
SdrUShortCont aIdsToErase;
SdrUShortCont aIdsToInsert;
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(sal_uInt16 nPtId : rPts)
{
- sal_uInt16 nPtId=*it;
sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
{
@@ -298,8 +295,8 @@ void SdrGlueEditView::ImpCopyMarkedGluePoints()
aIdsToInsert.insert(nNewId);
}
}
- for(SdrUShortCont::const_iterator it = aIdsToErase.begin(); it != aIdsToErase.end(); ++it)
- rPts.erase(*it);
+ for(const auto& rId : aIdsToErase)
+ rPts.erase(rId);
rPts.insert(aIdsToInsert.begin(), aIdsToInsert.end());
}
}
@@ -325,9 +322,8 @@ void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const vo
if( IsUndoEnabled() )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
- for(SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for(sal_uInt16 nPtId : rPts)
{
- sal_uInt16 nPtId=*it;
sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) {
SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index a53725c6ee1e..93621e714802 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2184,13 +2184,9 @@ std::unique_ptr<SdrHdl> SdrHdlList::RemoveHdl(size_t nNum)
void SdrHdlList::RemoveAllByKind(SdrHdlKind eKind)
{
- for(auto it = maList.begin(); it != maList.end(); )
- {
- if ((*it)->GetKind() == eKind)
- it = maList.erase( it );
- else
- ++it;
- }
+ maList.erase(std::remove_if(maList.begin(), maList.end(),
+ [&eKind](std::unique_ptr<SdrHdl>& rItem) { return rItem->GetKind() == eKind; }),
+ maList.end());
}
void SdrHdlList::Clear()
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 5c2760f495d8..c1b591404d3f 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -161,15 +161,9 @@ void SdrMarkList::ImpForceSort()
// remove invalid
if(nCount > 0 )
{
- for(auto it = maList.begin(); it != maList.end(); )
- {
- if(it->get()->GetMarkedSdrObj() == nullptr)
- {
- it = maList.erase( it );
- }
- else
- ++it;
- }
+ maList.erase(std::remove_if(maList.begin(), maList.end(),
+ [](std::unique_ptr<SdrMark>& rItem) { return rItem.get()->GetMarkedSdrObj() == nullptr; }),
+ maList.end());
nCount = maList.size();
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 6123ce0e8a98..00475d96a959 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -947,9 +947,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
SdrPageView* pPV=pM->GetPageView();
const SdrUShortCont& rMrkGlue=pM->GetMarkedGluePoints();
- for (SdrUShortCont::const_iterator it = rMrkGlue.begin(); it != rMrkGlue.end(); ++it)
+ for (sal_uInt16 nId : rMrkGlue)
{
- sal_uInt16 nId=*it;
//nNum changed to nNumGP because already used in for loop
sal_uInt16 nNumGP=pGPL->FindGluePoint(nId);
if (nNumGP!=SDRGLUEPOINT_NOTFOUND)
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 9bacffb665c7..4f04204be823 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1498,27 +1498,26 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
}
}
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
- aIter != aEnd; ++aIter )
+ for (const auto& rInteraction : aInteractionHandles)
{
try
{
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_X )
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_FIXED )
+ rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_X )
{
- sal_Int32 nX = ( aIter->aPosition.X - aOld.Left() ) + maRect.Left();
- aIter->xInteraction->setControllerPosition( css::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
+ sal_Int32 nX = ( rInteraction.aPosition.X - aOld.Left() ) + maRect.Left();
+ rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
}
- else if ( aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX )
+ else if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX )
{
- sal_Int32 nX = maRect.Right() - (aOld.Right() - aIter->aPosition.X);
- aIter->xInteraction->setControllerPosition( css::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
+ sal_Int32 nX = maRect.Right() - (aOld.Right() - rInteraction.aPosition.X);
+ rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
}
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_Y )
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_Y )
{
- sal_Int32 nY = ( aIter->aPosition.Y - aOld.Top() ) + maRect.Top();
- aIter->xInteraction->setControllerPosition( css::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
+ sal_Int32 nY = ( rInteraction.aPosition.Y - aOld.Top() ) + maRect.Top();
+ rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
}
}
catch ( const uno::RuntimeException& )
@@ -1911,23 +1910,22 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
NbcMirror( aLeft, aRight );
}
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
- aIter != aEnd ; ++aIter )
+ for (const auto& rInteraction : aInteractionHandles)
{
try
{
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_X ||
- aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX )
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_FIXED )
+ rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_X ||
+ rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX )
{
- if (aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX)
+ if (rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_NEGX)
bOldMirroredX = !bOldMirroredX;
sal_Int32 nX;
if ( bOldMirroredX )
{
- nX = ( aIter->aPosition.X - aOld.Right() );
+ nX = ( rInteraction.aPosition.X - aOld.Right() );
if ( rNewRect.Left() > rNewRect.Right() )
nX = maRect.Left() - nX;
else
@@ -1935,20 +1933,20 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
}
else
{
- nX = ( aIter->aPosition.X - aOld.Left() );
+ nX = ( rInteraction.aPosition.X - aOld.Left() );
if ( rNewRect.Left() > rNewRect.Right() )
nX = maRect.Right() - nX;
else
nX += maRect.Left();
}
- aIter->xInteraction->setControllerPosition( css::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
+ rInteraction.xInteraction->setControllerPosition( css::awt::Point( nX, rInteraction.xInteraction->getPosition().Y ) );
}
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_Y )
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_ABSOLUTE_Y )
{
sal_Int32 nY;
if ( bOldMirroredY )
{
- nY = ( aIter->aPosition.Y - aOld.Bottom() );
+ nY = ( rInteraction.aPosition.Y - aOld.Bottom() );
if ( rNewRect.Top() > rNewRect.Bottom() )
nY = maRect.Top() - nY;
else
@@ -1956,13 +1954,13 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
}
else
{
- nY = ( aIter->aPosition.Y - aOld.Top() );
+ nY = ( rInteraction.aPosition.Y - aOld.Top() );
if ( rNewRect.Top() > rNewRect.Bottom() )
nY = maRect.Bottom() - nY;
else
nY += maRect.Top();
}
- aIter->xInteraction->setControllerPosition( css::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
+ rInteraction.xInteraction->setControllerPosition( css::awt::Point( rInteraction.xInteraction->getPosition().X, nY ) );
}
}
catch ( const uno::RuntimeException& )
@@ -1995,13 +1993,12 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination,
SetRectsDirty(true);
InvalidateRenderGeometry();
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ;
- aIter != aEnd; ++aIter)
+ for (const auto& rInteraction : aInteractionHandles)
{
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_FIXED )
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_FIXED )
{
- if ( aIter->xInteraction.is() )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
+ if ( rInteraction.xInteraction.is() )
+ rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
}
}
}
@@ -2082,13 +2079,12 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
maRect = aRect1;
SetRectsDirty();
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
- aIter != aEnd ; ++aIter)
+ for (const auto& rInteraction : aInteractionHandles)
{
try
{
- if ( aIter->nMode & CustomShapeHandleModes::CREATE_FIXED )
- aIter->xInteraction->setControllerPosition( awt::Point( rStat.GetStart().X(), rStat.GetStart().Y() ) );
+ if ( rInteraction.nMode & CustomShapeHandleModes::CREATE_FIXED )
+ rInteraction.xInteraction->setControllerPosition( awt::Point( rStat.GetStart().X(), rStat.GetStart().Y() ) );
}
catch ( const uno::RuntimeException& )
{
@@ -2412,13 +2408,12 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
SetRectsDirty();
SetChanged();
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd ( aInteractionHandles.end() );
- aIter != aEnd ; ++aIter)
+ for (const auto& rInteraction : aInteractionHandles)
{
try
{
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_FIXED )
+ rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
}
catch ( const uno::RuntimeException& )
{
@@ -2447,13 +2442,12 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight()
maRect = aNewTextRect;
SetRectsDirty();
- for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ;
- aIter != aEnd ; ++aIter)
+ for (const auto& rInteraction : aInteractionHandles)
{
try
{
- if ( aIter->nMode & CustomShapeHandleModes::RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
+ if ( rInteraction.nMode & CustomShapeHandleModes::RESIZE_FIXED )
+ rInteraction.xInteraction->setControllerPosition( rInteraction.aPosition );
}
catch ( const uno::RuntimeException& )
{
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 4306767a56be..cb104cba5358 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -390,9 +390,8 @@ SdrObject::~SdrObject()
{
// tell all the registered ObjectUsers that the page is in destruction
sdr::ObjectUserVector aListCopy(mpImpl->maObjectUsers.begin(), mpImpl->maObjectUsers.end());
- for(sdr::ObjectUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator)
+ for(sdr::ObjectUser* pObjectUser : aListCopy)
{
- sdr::ObjectUser* pObjectUser = *aIterator;
DBG_ASSERT(pObjectUser, "SdrObject::~SdrObject: corrupt ObjectUser list (!)");
pObjectUser->ObjectInDestruction(*this);
}
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 770bd440a86a..bb70c3e8e9c4 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -567,10 +567,10 @@ namespace
const drawinglayer::attribute::StrokeAttribute& rStrokeAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rTarget)
{
- for(basegfx::B2DPolyPolygonVector::const_iterator aPolygon(rB2DPolyPolyVector.begin()); aPolygon != rB2DPolyPolyVector.end(); ++aPolygon)
+ for(const auto& rB2DPolyPolygon : rB2DPolyPolyVector)
{
// prepare PolyPolygons
- basegfx::B2DPolyPolygon aB2DPolyPolygon = *aPolygon;
+ basegfx::B2DPolyPolygon aB2DPolyPolygon = rB2DPolyPolygon;
aB2DPolyPolygon.transform(rTransform);
for(auto const& rPolygon : aB2DPolyPolygon)
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 7a3490e3722d..b83732f51b30 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -376,8 +376,7 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
}
}
// and finally, merge all stylesheets that are contained in aStyles with previous broadcasters
- for(std::set<SfxStyleSheet*>::const_iterator it = aStyleSheets.begin(); it != aStyleSheets.end(); ++it) {
- SfxStyleSheet* pStyle=*it;
+ for(SfxStyleSheet* pStyle : aStyleSheets) {
// let StartListening see for itself if there's already a listener registered
StartListening(*pStyle, DuplicateHandling::Prevent);
}
@@ -411,10 +410,9 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
}
ESelection aSelAll( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL );
- std::vector<sal_uInt16>::const_iterator aIter( rCharWhichIds.begin() );
- while( aIter != rCharWhichIds.end() )
+ for( const auto& rWhichId : rCharWhichIds )
{
- pOutliner->RemoveAttribs( aSelAll, false, (*aIter++) );
+ pOutliner->RemoveAttribs( aSelAll, false, rWhichId );
}
if(!pEdtOutl || (pText != getActiveText()) )
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 38ea6471ebe4..390baaab60ef 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -384,22 +384,15 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
}
// now aPreviouslyVisible contains all views where we became invisible
- ::std::set< SdrView* >::const_iterator aLoopViews;
- for ( aLoopViews = aPreviouslyVisible.begin();
- aLoopViews != aPreviouslyVisible.end();
- ++aLoopViews
- )
+ for (const auto& rpView : aPreviouslyVisible)
{
- lcl_ensureControlVisibility( *aLoopViews, this, false );
+ lcl_ensureControlVisibility( rpView, this, false );
}
// and aNewlyVisible all views where we became visible
- for ( aLoopViews = aNewlyVisible.begin();
- aLoopViews != aNewlyVisible.end();
- ++aLoopViews
- )
+ for (const auto& rpView : aNewlyVisible)
{
- lcl_ensureControlVisibility( *aLoopViews, this, true );
+ lcl_ensureControlVisibility( rpView, this, true );
}
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index c56b06d6c954..5e38b25e043f 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -786,11 +786,12 @@ bool SdrObjList::RecalcNavigationPositions()
{
mbIsNavigationOrderDirty = false;
- WeakSdrObjectContainerType::iterator iObject;
- WeakSdrObjectContainerType::const_iterator iEnd (mxNavigationOrder->end());
sal_uInt32 nIndex (0);
- for (iObject=mxNavigationOrder->begin(); iObject!=iEnd; ++iObject,++nIndex)
- (*iObject)->SetNavigationPosition(nIndex);
+ for (auto& rpObject : *mxNavigationOrder)
+ {
+ rpObject->SetNavigationPosition(nIndex);
+ ++nIndex;
+ }
}
}
@@ -1132,9 +1133,8 @@ SdrPage::~SdrPage()
// of page users. Therefore we have to use a copy of the list for the
// iteration.
sdr::PageUserVector aListCopy (maPageUsers.begin(), maPageUsers.end());
- for(sdr::PageUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator)
+ for(sdr::PageUser* pPageUser : aListCopy)
{
- sdr::PageUser* pPageUser = *aIterator;
DBG_ASSERT(pPageUser, "SdrPage::~SdrPage: corrupt PageUser list (!)");
pPageUser->PageInDestruction(*this);
}
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 6f2720601d77..ed73fadf7acd 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -146,14 +146,12 @@ void SdrPageView::AddPaintWindowToPageView(SdrPaintWindow& rPaintWindow)
void SdrPageView::RemovePaintWindowFromPageView(SdrPaintWindow& rPaintWindow)
{
- for(auto it = maPageWindows.begin(); it != maPageWindows.end(); ++it)
- {
- if(&((*it)->GetPaintWindow()) == &rPaintWindow)
- {
- maPageWindows.erase(it);
- break;
- }
- }
+ auto it = std::find_if(maPageWindows.begin(), maPageWindows.end(),
+ [&rPaintWindow](const std::unique_ptr<SdrPageWindow>& rpWindow) {
+ return &(rpWindow->GetPaintWindow()) == &rPaintWindow;
+ });
+ if (it != maPageWindows.end())
+ maPageWindows.erase(it);
}
css::uno::Reference< css::awt::XControlContainer > SdrPageView::GetControlContainer( const OutputDevice& _rDevice ) const
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index e40fe93eed7f..e03397d8d285 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -67,13 +67,10 @@ using namespace ::com::sun::star;
SdrPaintWindow* SdrPaintView::FindPaintWindow(const OutputDevice& rOut) const
{
- for(SdrPaintWindowVector::const_iterator a = maPaintWindows.begin(); a != maPaintWindows.end(); ++a)
- {
- if(&((*a)->GetOutputDevice()) == &rOut)
- {
- return *a;
- }
- }
+ auto a = std::find_if(maPaintWindows.begin(), maPaintWindows.end(),
+ [&rOut](const SdrPaintWindow* pWindow) { return &(pWindow->GetOutputDevice()) == &rOut; });
+ if (a != maPaintWindows.end())
+ return *a;
return nullptr;
}
@@ -578,9 +575,9 @@ void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, s
pWindow->SetLineColor(COL_LIGHTGREEN);
pWindow->SetFillColor();
- for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
+ for(const auto& rRect : aRectangles)
{
- pWindow->DrawRect(*aRectIter);
+ pWindow->DrawRect(rRect);
}
//RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects());
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index cc9b8005fe2c..e04f8f8ca13c 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -98,9 +98,9 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot
bSetMarkedSegmentsKindPossible = true;
}
- for (SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for (const auto& rPt : rPts)
{
- sal_uInt32 nNum(*it);
+ sal_uInt32 nNum(rPt);
sal_uInt32 nPolyNum, nPntNum;
if(PolyPolygonEditor::GetRelativePolyPoint(pPath->GetPathPoly(), nNum, nPolyNum, nPntNum))
@@ -384,9 +384,9 @@ void SdrPolyEditView::RipUpAtMarkedPoints()
bCorrectionFlag = true;
SdrUShortCont aReplaceSet;
- for(SdrUShortCont::const_iterator it2 = rPts.begin(); it2 != rPts.end(); ++it2)
+ for(const auto& rPt : rPts)
{
- sal_uInt32 nPntNum(*it2);
+ sal_uInt32 nPntNum(rPt);
nPntNum += nNewPt0Idx;
if(nPntNum >= nMax)
@@ -439,15 +439,11 @@ bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const
if(nPointCount >= 3)
{
- bRetval = pMarkedPathObject->IsClosedObj(); // #i76617#
-
- for(SdrUShortCont::const_iterator it = rSelectedPoints.begin();
- !bRetval && it != rSelectedPoints.end(); ++it)
- {
- const sal_uInt16 nMarkedPointNum(*it);
-
- bRetval = (nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1);
- }
+ bRetval = pMarkedPathObject->IsClosedObj() // #i76617#
+ || std::any_of(rSelectedPoints.begin(), rSelectedPoints.end(),
+ [nPointCount](const sal_uInt16 nMarkedPointNum) {
+ return nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1;
+ });
}
}
}
@@ -545,9 +541,9 @@ void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void*
basegfx::B2DPolyPolygon aXPP(pPath->GetPathPoly());
- for (SdrUShortCont::const_iterator it = rPts.begin(); it != rPts.end(); ++it)
+ for (const auto& rPt : rPts)
{
- sal_uInt32 nPt = *it;
+ sal_uInt32 nPt = rPt;
sal_uInt32 nPolyNum, nPointNum;
if(PolyPolygonEditor::GetRelativePolyPoint(aXPP, nPt, nPolyNum, nPointNum))