summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-23 15:27:51 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-23 15:28:36 -0500
commitba897375db27a2b74ead5251516824572260b029 (patch)
tree63bb9872f28f758ef7ac3362f862be44cef73bf9 /sc/source/ui
parent2ee55872ebc5aeb71041c3267d9b3baa9607b85b (diff)
Let's throw out-of-bound exception on out-of-bound destination position.
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 95632e613611..3bc1018c000c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2632,7 +2632,7 @@ void SAL_CALL ScTableSheetsObj::removeByName( const rtl::OUString& aName )
sal_Int32 ScTableSheetsObj::importSheet(
const uno::Reference < sheet::XSpreadsheetDocument > & xDocSrc,
const rtl::OUString& srcName, const sal_Int32 nDestPosition )
- throw( lang::IllegalArgumentException, uno::RuntimeException )
+ throw( lang::IllegalArgumentException, lang::IndexOutOfBoundsException, uno::RuntimeException )
{
//pDocShell is the destination
ScDocument* pDocDest = pDocShell->GetDocument();
@@ -2655,11 +2655,11 @@ sal_Int32 ScTableSheetsObj::importSheet(
SCTAB nCount = pDocDest->GetTableCount();
nIndexDest = static_cast<SCTAB>(nDestPosition);
if ( nIndexDest > nCount )
- nIndexDest = nCount;
+ throw lang::IndexOutOfBoundsException();
// control nDestPosition > 0
- if ( nIndexDest < 0)
- nIndexDest = 0;
+ if (nIndexDest < 0)
+ throw lang::IndexOutOfBoundsException();
// Transfert Tab
bool bInsertNew = true;