summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-23 20:44:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-25 13:08:21 +0000
commit60d9ffd6b6d1507aca3839cf2bfbd7e1f94354f2 (patch)
treea6fcd9239e7d805b4b8009d724a01e9c6be76870
parentdebc1a25704830de92a088f8ed13a90d2a326cc2 (diff)
Resolves: tdf#105466 crash when changing conditional formatting condition
Change-Id: Id219a7935f83acf3924e60cb1bf02311dc5c4372 (cherry picked from commit 0b7c1dcd149cd98136e5ed3e8e0e70255d87cd16) Reviewed-on: https://gerrit.libreoffice.org/33483 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index b6e21914f5f2..8e952d7c35de 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();
}
}