[Libreoffice-commits] core.git: svx/source

Julien Nabet serval2412 at yahoo.fr
Sat Mar 30 09:42:27 PDT 2013


 svx/source/svdraw/svdoashp.cxx |   30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

New commits:
commit 9a62bcf53ffc21ebcf7a09ad3be62cc210892168
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Mar 30 17:39:58 2013 +0100

    Prefer prefix ++/-- operators for non-primitive types
    
    + convert while loops into for loops
    
    Change-Id: Icb01b55d2932193f83344bda8c69c9a9954f6de0

diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index c2a6989..7bc80fd 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1578,8 +1578,8 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
         }
     }
 
-    std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-    while ( aIter != aInteractionHandles.end() )
+    for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
+         aIter != aEnd; ++aIter )
     {
         try
         {
@@ -1599,7 +1599,6 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
         catch ( const uno::RuntimeException& )
         {
         }
-        aIter++;
     }
     InvalidateRenderGeometry();
 }
@@ -2008,8 +2007,8 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
             pObj->NbcMirror( aLeft, aRight );
         }
 
-        std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-        while ( aIter != aInteractionHandles.end() )
+        for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
+             aIter != aEnd ; ++aIter )
         {
             try
             {
@@ -2061,7 +2060,6 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
             catch ( const uno::RuntimeException& )
             {
             }
-            aIter++;
         }
     }
 }
@@ -2088,15 +2086,14 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const
                     pObj->SetRectsDirty(sal_True);
                     pObj->InvalidateRenderGeometry();
 
-                    std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-                    while ( aIter != aInteractionHandles.end() )
+                    for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ;
+                      aIter != aEnd; ++aIter)
                     {
                         if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
                         {
                             if ( aIter->xInteraction.is() )
                                 aIter->xInteraction->setControllerPosition( aIter->aPosition );
                         }
-                        aIter++;
                     }
                 }
                 aInteractionHandle.xInteraction->setControllerPosition( aPt );
@@ -2177,8 +2174,8 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
     aRect = aRect1;
     SetRectsDirty();
 
-    std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-    while ( aIter != aInteractionHandles.end() )
+    for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
+        aIter != aEnd ; ++aIter)
     {
         try
         {
@@ -2188,7 +2185,6 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
         catch ( const uno::RuntimeException& )
         {
         }
-        aIter++;
     }
 
     SetBoundRectDirty();
@@ -2513,8 +2509,8 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
         SetRectsDirty();
         SetChanged();
 
-        std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-        while ( aIter != aInteractionHandles.end() )
+        for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd ( aInteractionHandles.end() );
+            aIter != aEnd ; ++aIter)
         {
             try
             {
@@ -2524,7 +2520,6 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
             catch ( const uno::RuntimeException& )
             {
             }
-            aIter++;
         }
         InvalidateRenderGeometry();
     }
@@ -2546,8 +2541,8 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
         aRect = aNewTextRect;
         SetRectsDirty();
 
-        std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
-        while ( aIter != aInteractionHandles.end() )
+        for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ;
+            aIter != aEnd ; ++aIter)
         {
             try
             {
@@ -2557,7 +2552,6 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
             catch ( const uno::RuntimeException& )
             {
             }
-            aIter++;
         }
 
         InvalidateRenderGeometry();


More information about the Libreoffice-commits mailing list