summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewdata.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-06-28 18:54:15 +0200
committerEike Rathke <erack@redhat.com>2017-06-28 18:54:50 +0200
commit0016602d20da3c60fb35dfaf0e6639cadbe64428 (patch)
tree6e6874549103ddfc99572f065f9c2a97fc1b43bf /sc/source/ui/view/viewdata.cxx
parentc9591f3b6153614c9849b8afbdcacbecc99c1f7c (diff)
assert(nTab < static_cast<SCTAB>(maTabData.size())); cause of tdf#108796
Have a dev friendly abort instead of a deep throw in case of the unexpected. Change-Id: Id07135cd7234767480032356636c668d20be3ff3
Diffstat (limited to 'sc/source/ui/view/viewdata.cxx')
-rw-r--r--sc/source/ui/view/viewdata.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index f2d79b8fd4b4..16f8f2c0480f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -543,9 +543,10 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
void ScViewData::DeleteTab( SCTAB nTab )
{
+ assert(nTab < static_cast<SCTAB>(maTabData.size()));
delete maTabData.at(nTab);
-
maTabData.erase(maTabData.begin() + nTab);
+
if (static_cast<size_t>(nTabNo) >= maTabData.size())
{
EnsureTabDataSize(1);