offapi/UnoApi_offapi.mk |1
offapi/com/sun/star/sheet/XSpreadsheets2.idl | 75 +++
sc/inc/docuno.hxx| 13
sc/source/ui/unoobj/docuno.cxx | 59 +
sc/xml/ScTableSheetsObj.xml |1
5 files changed, 137 insertions(+), 12 deletions(-)
New commits:
commit ba897375db27a2b74ead5251516824572260b029
Author: Kohei Yoshida kohei.yosh...@suse.com
Date: Wed Nov 23 15:27:51 2011 -0500
Let's throw out-of-bound exception on out-of-bound destination position.
diff --git a/offapi/com/sun/star/sheet/XSpreadsheets2.idl
b/offapi/com/sun/star/sheet/XSpreadsheets2.idl
index c4f8af1..c3635b9 100644
--- a/offapi/com/sun/star/sheet/XSpreadsheets2.idl
+++ b/offapi/com/sun/star/sheet/XSpreadsheets2.idl
@@ -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);
};
//=
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 1ca0d71..35296da 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -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
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 95632e6..3bc1018 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_castSCTAB(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;
commit 2ee55872ebc5aeb71041c3267d9b3baa9607b85b
Author: Laurent Godard lgodard.li...@laposte.net
Date: Mon Nov 21 17:32:13 2011 +0100
importSheet from an external provided document
define a new interface XSpreadsheets2
clean some String in docuno.cxx while i'm at it.
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 4328206..f63ddd3 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3458,6 +3458,7 @@ $(eval $(call
gb_UnoApiTarget_add_idlfiles,offapi,offapi/com/sun/star/sheet,\
XSpreadsheetDocument \
XSpreadsheetView \
XSpreadsheets \
+ XSpreadsheets2 \
XSubTotalCalculatable \
XSubTotalDescriptor \
XSubTotalField \
diff --git a/offapi/com/sun/star/sheet/XSpreadsheets2.idl
b/offapi/com/sun/star/sheet/XSpreadsheets2.idl
new file mode 100644
index 000..c4f8af1
--- /dev/null
+++ b/offapi/com/sun/star/sheet/XSpreadsheets2.idl
@@ -0,0 +1,75 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under