summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-30 20:38:52 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-05-30 20:38:52 +0200
commitcdf832caa70e36febf60cb7a6f4c0553d4f852e5 (patch)
treea311f29eedd17cdd4dcfa69350ecd0bd7e0904da /sc/source
parent4b9c570facedb799130ef6c585055d76f6d26f24 (diff)
fix segv when inserting multiple sheets
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/document.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8fe7452504fd..aaa1585cbd36 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -523,7 +523,8 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector<rtl::OUString>& rName
for (; it != pTab.end(); ++it)
if ( *it )
(*it)->UpdateInsertTab(nPos, nNewSheets);
- pTab.resize(nTabCount + nNewSheets, NULL);
+ it = pTab.begin();
+ pTab.insert(it+nPos,nNewSheets, NULL);
for (SCTAB i = 0; i < nNewSheets; ++i)
{
pTab[nPos + i] = new ScTable(this, nPos + i, rNames.at(i));
@@ -536,8 +537,10 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector<rtl::OUString>& rName
UpdateBroadcastAreas( URM_INSDEL, aRange, 0,0,nNewSheets);
it = pTab.begin();
for (; it != pTab.end(); ++it)
+ {
if ( *it )
(*it)->UpdateCompile();
+ }
it = pTab.begin();
for (; it != pTab.end(); ++it)
if ( *it )