sc/source/ui/view/tabvwshf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit ff2f47bd2e08a00bff71803db390b09080f9c728 Author: Eike Rathke <er...@redhat.com> Date: Fri Apr 7 16:20:37 2017 +0200 out-of-bounds tab access when deleting second last sheet Which in a debug build lead to STL assert Error: attempt to subscript container with out-of-bounds index Change-Id: I09fddbc9e4b214b0313c193f85830ed458d20c0e (cherry picked from commit 0c55972d747511dbc711f3c9cbb4db5d8c5dc2ff) Reviewed-on: https://gerrit.libreoffice.org/36273 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 63ba25e160a8..49bed795dd0d 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -624,13 +624,13 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) { TheTabs.push_back(i); bTabFlag = true; - if (nNewTab == i) + if (nNewTab == i && i+1 < nTabCount) nNewTab++; } if (!bTabFlag) nFirstTab = i; } - if (nNewTab >= nTabCount) + if (nNewTab >= nTabCount - static_cast<SCTAB>(TheTabs.size())) nNewTab = nFirstTab; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits