[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

Michael Stahl mstahl at redhat.com
Fri Jun 24 15:05:18 UTC 2016


 sw/source/core/layout/pagechg.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c5320ed05f51482a37993420068e754223f08d5c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 23 22:17:49 2016 +0200

    sw: fix STL asserts in lcl_MoveAllLowerObjs *again*
    
    Comment added in cf91483690291272f48ff95c1aebd165da8ae4f0 evidently
    insufficient.
    
    (regression from b415494bf0468b74318b61f114e2ff4ae68c00ee)
    
    Change-Id: I9a017aefc3a77b0760fcdc3b8e43ff7c6ac516ac
    (cherry picked from commit e7d8cb3ec22906d5d45ba65e0a0cfccd68d202e8)
    Reviewed-on: https://gerrit.libreoffice.org/26620
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index c722da9..7ea39752 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1763,8 +1763,10 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const Point& rOffset )
 
     // note: pSortedObj elements may be removed and inserted from
     // MoveObjectIfActive(), invalidating iterators
-    for (SwAnchoredObject* pAnchoredObj : *pSortedObj)
+    // DO NOT CONVERT THIS TO A C++11 FOR LOOP, IT DID NOT WORK THE LAST 2 TIMES
+    for (size_t i = 0; i < pSortedObj->size(); ++i)
     {
+        SwAnchoredObject *const pAnchoredObj = (*pSortedObj)[i];
         const SwFrameFormat& rObjFormat = pAnchoredObj->GetFrameFormat();
         const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
 


More information about the Libreoffice-commits mailing list