Kaydet (Commit) ba897375 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Let's throw out-of-bound exception on out-of-bound destination position.

üst 2ee55872
......@@ -27,7 +27,7 @@
#include <com/sun/star/sheet/XSpreadsheets.idl>
#include <com/sun/star/sheet/XSpreadsheetDocument.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/uno/RuntimeException.idl>
#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
//=============================================================================
......@@ -64,7 +64,7 @@ interface XSpreadsheets2: com::sun::star::sheet::XSpreadsheets
[in] string srcName,
[in] long nDestPosition)
raises (com::sun::star::lang::IllegalArgumentException,
com::sun::star::uno::RuntimeException);
com::sun::star::lang::IndexOutOfBoundsException);
};
//=============================================================================
......
......@@ -406,7 +406,9 @@ public:
::com::sun::star::sheet::XSpreadsheetDocument > & xDocSrc,
const rtl::OUString& srcName,
const sal_Int32 nDestPosition)
throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
// XCellRangesAccess
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment