diff options
author | Kay Ramme <kr@openoffice.org> | 2001-07-30 09:26:37 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-07-30 09:26:37 +0000 |
commit | 70fc00221e458161f5a87222326829ecb34ae9e7 (patch) | |
tree | 4e8bea24f2b37829c77c35ecf7a85661860adbb6 /sj2 | |
parent | a7e209ef5cd5e16d01ca85e2cbf90717c0c092ce (diff) |
handle exception (#90339#)
Diffstat (limited to 'sj2')
-rw-r--r-- | sj2/source/jscpp/sjapplet.cxx | 36 | ||||
-rw-r--r-- | sj2/source/jscpp/sjapplet_impl.cxx | 7 |
2 files changed, 32 insertions, 11 deletions
diff --git a/sj2/source/jscpp/sjapplet.cxx b/sj2/source/jscpp/sjapplet.cxx index e2f2ccd64478..93488c457a18 100644 --- a/sj2/source/jscpp/sjapplet.cxx +++ b/sj2/source/jscpp/sjapplet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sjapplet.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: kr $ $Date: 2001-04-10 13:56:22 $ + * last change: $Author: kr $ $Date: 2001-07-30 10:26:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,38 +98,56 @@ SjApplet2::~SjApplet2() //========================================================================= void SjApplet2::Init(Window * pParentWin, const INetURLObject & rDocBase, const SvCommandList & rCmdList) { - _pImpl->init(pParentWin, getProcessServiceFactory(), rDocBase, rCmdList); + try { + if(_pImpl) + _pImpl->init(pParentWin, getProcessServiceFactory(), rDocBase, rCmdList); + } + catch(RuntimeException & runtimeException) { +#ifdef DEBUG + OString message = OUStringToOString(runtimeException.Message, RTL_TEXTENCODING_ASCII_US); + OSL_TRACE("sjapplet.cxx: SjApplet2::Init - exception occurred: %s\n", message.getStr()); +#endif + + delete _pImpl; + _pImpl = 0; + } } //========================================================================= void SjApplet2::setSizePixel( const Size & rSize ) { - _pImpl->setSize(rSize); + if(_pImpl) + _pImpl->setSize(rSize); } void SjApplet2::appletRestart() { - _pImpl->restart(); + if(_pImpl) + _pImpl->restart(); } void SjApplet2::appletReload() { - _pImpl->reload(); + if(_pImpl) + _pImpl->reload(); } void SjApplet2::appletStart() { - _pImpl->start(); + if(_pImpl) + _pImpl->start(); } void SjApplet2::appletStop() { - _pImpl->stop(); + if(_pImpl) + _pImpl->stop(); } void SjApplet2::appletClose() { - _pImpl->close(); + if(_pImpl) + _pImpl->close(); } // Fuer SO3, Wrapper fuer Applet liefern diff --git a/sj2/source/jscpp/sjapplet_impl.cxx b/sj2/source/jscpp/sjapplet_impl.cxx index e9711bb21455..e89a528bab01 100644 --- a/sj2/source/jscpp/sjapplet_impl.cxx +++ b/sj2/source/jscpp/sjapplet_impl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sjapplet_impl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kr $ $Date: 2001-05-21 15:42:21 $ + * last change: $Author: kr $ $Date: 2001-07-30 10:26:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -148,6 +148,9 @@ void SjApplet2_Impl::init(Window * pParentWin, _pJVM = (JavaVM*)nP; } + if(!_pJVM) // did we get a vm? + throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("sjapplet_impl.cxx: couldn't get a java vm")), Reference<XInterface>()); + TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get()); _jcAppletExecutionContext = jenv.pEnv->FindClass("stardiv/applet/AppletExecutionContext"); testJavaException(jenv.pEnv); |