[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/source

Caolán McNamara caolanm at redhat.com
Mon Jan 23 23:22:34 UTC 2017


 sc/source/ui/condformat/condformatdlg.cxx |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit f3bc969dd5bb4a45946728806159e658056a2bca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 23 20:44:38 2017 +0000

    Resolves: tdf#105466 crash when changing conditional formatting condition
    
    Change-Id: Id219a7935f83acf3924e60cb1bf02311dc5c4372
    (cherry picked from commit 0b7c1dcd149cd98136e5ed3e8e0e70255d87cd16)
    Reviewed-on: https://gerrit.libreoffice.org/33481
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 6cc1d1e..37bf0b2 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -187,10 +187,12 @@ void ScCondFormatList::RecalcAll()
 {
     sal_Int32 nTotalHeight = 0;
     sal_Int32 nIndex = 1;
-    for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
+    for (const auto& item : maEntries)
     {
-        nTotalHeight += (*itr)->GetSizePixel().Height();
-        (*itr)->SetIndex( nIndex );
+        if (!item)
+            continue;
+        nTotalHeight += item->GetSizePixel().Height();
+        item->SetIndex(nIndex);
         ++nIndex;
     }
 
@@ -212,17 +214,19 @@ void ScCondFormatList::RecalcAll()
     }
 
     Point aPoint(0,-1*mpScrollBar->GetThumbPos());
-    for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
+    for (const auto& item : maEntries)
     {
-        (*itr)->SetPosPixel(aPoint);
-        Size aSize = (*itr)->GetSizePixel();
+        if (!item)
+            continue;
+        item->SetPosPixel(aPoint);
+        Size aSize = item->GetSizePixel();
         if(mbHasScrollBar)
             aSize.Width() = aCtrlSize.Width() - nSrcBarSize;
         else
             aSize.Width() = aCtrlSize.Width();
-        (*itr)->SetSizePixel(aSize);
+        item->SetSizePixel(aSize);
 
-        aPoint.Y() += (*itr)->GetSizePixel().Height();
+        aPoint.Y() += item->GetSizePixel().Height();
     }
 }
 


More information about the Libreoffice-commits mailing list