summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-29 11:24:27 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-29 11:52:10 -0500
commit654c4be03c86cf00f0c66f876caa392e9391f8f5 (patch)
tree2a24faf5be7a6ae9ef14058deb0fe518037256a3
parent8bd1636b4da6ff2e5c28971b8c7864a70d935173 (diff)
Let's check the validity of sheet indices. You never know...
-rw-r--r--sc/source/ui/unoobj/docuno.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b5de718c35ee..b9be4933ce9f 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -899,8 +899,13 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
{
uno::Sequence<sal_Int32> aSelected = xSelectedSheets->getSelectedSheets();
ScMarkData::MarkedTabsType aSelectedTabs;
+ SCTAB nMaxTab = pDocShell->GetDocument()->GetTableCount() -1;
for (sal_Int32 i = 0, n = aSelected.getLength(); i < n; ++i)
- aSelectedTabs.insert(static_cast<SCTAB>(aSelected[i]));
+ {
+ SCTAB nSelected = static_cast<SCTAB>(aSelected[i]);
+ if (ValidTab(nSelected, nMaxTab))
+ aSelectedTabs.insert(static_cast<SCTAB>(aSelected[i]));
+ }
rMark.SetSelectedTabs(aSelectedTabs);
}