tdf#121263 Calc crashes when hide multiple sheets

regression from
	commit 87c06415cebd707ae359cb2f1b06d468cb6afb08
    clang-tidy performance-unnecessary-copy-init in sc

Change-Id: I49a7099c0a5e9e684008d2e799f9ee94f867d786
Reviewed-on: https://gerrit.libreoffice.org/63239
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index ab51350..565fa98 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3045,7 +3045,8 @@
        ScMarkData::MarkedTabsType::const_iterator it;
        std::vector<SCTAB> undoTabs;

        const ScMarkData::MarkedTabsType& selectedTabs = rMark.GetSelectedTabs();
        // need to take a copy of selectedtabs since it is modified in the loop
        const ScMarkData::MarkedTabsType selectedTabs = rMark.GetSelectedTabs();
        for (it=selectedTabs.begin(); it!=selectedTabs.end(); ++it)
        {
            nTab = *it;