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

Noel Grandin noel.grandin at collabora.co.uk
Thu Nov 9 06:30:33 UTC 2017


 sfx2/source/appl/appuno.cxx  |    4 +++-
 sfx2/source/view/viewfrm.cxx |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit ea4a47d7d442d5d897cfa3a6e9f09ce3f1f233c5
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Nov 8 14:48:31 2017 +0200

    fix bugs in StateView_Impl and TransformItems
    
    where it was only incrementing the pointer once, meaning it was not
    iterating in pairs
    
    Change-Id: I26cc9b4262bc869c72231ef9eabca2d29da0a724
    Reviewed-on: https://gerrit.libreoffice.org/44462
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index c1088d275d33..56ad256aa335 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1085,7 +1085,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
         const sal_uInt16 *pRanges = rSet.GetRanges();
         while ( *pRanges )
         {
-            for(sal_uInt16 nId = *pRanges++; nId <= *pRanges; ++nId)
+            sal_uInt16 nStartWhich = *pRanges++;
+            sal_uInt16 nEndWhich = *pRanges++;
+            for(sal_uInt16 nId = nStartWhich; nId <= nEndWhich; ++nId)
             {
                 if ( rSet.GetItemState(nId) < SfxItemState::SET ) //???
                     // not really set
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index be33d0c97d62..de1bee06d486 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2158,7 +2158,9 @@ void SfxViewFrame::StateView_Impl
     assert(pRanges && "Set with no Range");
     while ( *pRanges )
     {
-        for ( sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich )
+        sal_uInt16 nStartWhich = *pRanges++;
+        sal_uInt16 nEndWhich = *pRanges++;
+        for ( sal_uInt16 nWhich = nStartWhich; nWhich <= nEndWhich; ++nWhich )
         {
             switch(nWhich)
             {


More information about the Libreoffice-commits mailing list