[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - svtools/source

Julien Nabet serval2412 at yahoo.fr
Sat Mar 7 11:16:20 PST 2015


 svtools/source/control/headbar.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a598a553ad98e5bfc5fedf03cc704e09601dab55
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Mar 7 09:04:34 2015 +0100

    tdf#88847: Fields of query design can be moved to the left only
    
    Part of code
       1299             ImplHeadItemList::iterator it = mpItemList->begin();
       1300             ::std::advance( it, nPos );
       1301             ImplHeadItem* pItem = *it;
       1302             mpItemList->erase( it );
       1303             if ( nNewPos < nPos ) <-- case move to left
       1304                 nPos = nNewPos;
       1305             it = mpItemList->begin();
       1306             ::std::advance( it, nPos );
       1307             mpItemList->insert( it, pItem );
    So in move to right case, we erase and insert pItem at the same place
    We just have to use nNewPos in all cases
    
    regression from bd24a310be1459510b760b812838cb87923853c5
    
    Also add back "ImplUpdate" call erroneously removed in merge
    commit 67d2af6fac2d9bad52a6b1f6e0cbd1229eb88a42
    (there is an ImplUpdate call in each parent of that merge commit)
    
    Change-Id: I100b0c6874b366f777c5d38470fcee7a9a7326df
    (cherry picked from commit 63050dccbc50f148cd788730faa53d822d37e54f)
    Reviewed-on: https://gerrit.libreoffice.org/14786
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 8f3c262..3037c02 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -1302,8 +1302,9 @@ void HeaderBar::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos )
             if ( nNewPos < nPos )
                 nPos = nNewPos;
             it = mpItemList->begin();
-            ::std::advance( it, nPos );
+            ::std::advance( it, nNewPos );
             mpItemList->insert( it, pItem );
+            ImplUpdate( nPos, true);
         }
     }
 }


More information about the Libreoffice-commits mailing list