Hi Regina, On Thursday, 2009-07-09 12:17:43 +0200, Regina Henschel wrote:
> (1) How do I "introduce a new exception"?
The attached (hopefully not stripped by the mailing list software) patch
adds the ::com::sun::star::sheet::NoConvergenceException to the offapi
module. After having applied the patch, build and deliver the offapi
module, then build and deliver the offuh module that creates the C++
header files.
In scaddins' bessel.hxx add
#include <com/sun/star/sheet/NoConvergenceException.hpp>
and add ::com::sun::star::sheet::NoConvergenceException to the Bessel*()
functions' throw lists.
As in the analsis.* files the declarations use macros, for consistency
in analysisdefs.hxx add
#define THROWDEF_RTE_IAE_NCE
throw(CSS::uno::RuntimeException,CSS::lang::IllegalArgumentException,CSS::sheet::NoConvergenceException)
and in analysis.hxx change THROWDEF_RTE_IAE to THROWDEF_RTE_IAE_NCE for
all getBessel*() functions, same in analysis.cxx
In bessel.hxx add ::com::sun::star::sheet::NoConvergenceException to the
throw lists of all Bessel*() functions.
In bessel.cxx add
using ::com::sun::star::sheet::NoConvergenceException;
and NoConvergenceException to the Bessel*() functions' throw lists.
If I didn't forget anything that should do.
> (2) ScUnoAddInCall::ExecuteCallWithArgs()
See also Niklas' reply. Adding a condition
else if ( rWrapped.TargetException.getValueType().equals(
getCppuType( (sheet::NoConvergenceException*)0 ) ) )
nErrCode = errNoConvergence;
to the
catch(reflection::InvocationTargetException& rWrapped)
block should do. Of course you'll also need to add
#include <com/sun/star/sheet/NoConvergenceException.hpp>
to the file.
> (3) I have tried to use the Message of the exception. But there I fail
> already in the syntax.
The original exception's Message should be available as
rWrapped.TargetException.Message
Hope that helps,
Eike
--
OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
SunSign 0x87F8D412 : 2F58 5236 DB02 F335 8304 7D6C 65C9 F9B5 87F8 D412
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't send personal mail to the [email protected] account, which I use for
mailing lists only and don't read from outside Sun. Use [email protected] Thanks.
diff -Npu DEV300/offapi/com/sun/star/sheet/makefile.mk
offapi/com/sun/star/sheet/makefile.mk
--- DEV300/offapi/com/sun/star/sheet/makefile.mk 2009-04-28
22:02:10.000000000 +0200
+++ offapi/com/sun/star/sheet/makefile.mk 2009-07-09 13:35:27.000000000
+0200
@@ -166,6 +166,7 @@ IDLFILES=\
NamedRangeFlag.idl\
NamedRanges.idl\
NamedRangesEnumeration.idl\
+ NoConvergenceException.idl\
PasteOperation.idl\
RangeSelectionArguments.idl\
RangeSelectionEvent.idl\
diff -Npu DEV300/offapi/com/sun/star/sheet/NoConvergenceException.idl
offapi/com/sun/star/sheet/NoConvergenceException.idl
--- DEV300/offapi/com/sun/star/sheet/NoConvergenceException.idl 1970-01-01
01:00:00.000000000 +0100
+++ offapi/com/sun/star/sheet/NoConvergenceException.idl 2009-07-09
13:34:35.000000000 +0200
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_sheet_NoConvergenceException_idl__
+#define __com_sun_star_sheet_NoConvergenceException_idl__
+
+#ifndef __com_sun_star_uno_Exception_idl__
+#include <com/sun/star/uno/Exception.idl>
+#endif
+
+//=============================================================================
+
+module com { module sun { module star { module sheet {
+
+//=============================================================================
+
+/** Thrown by a Calc Add-In function this exception indicates the
+ function's algorithm did not converge to a meaningful result.
+
+ @since OOo 3.2
+ */
+exception NoConvergenceException : ::com::sun::star::uno::Exception
+{
+};
+
+//=============================================================================
+}; }; }; };
+//=============================================================================
+
+#endif
pgptJ43HDp7LX.pgp
Description: PGP signature
