diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-16 14:44:23 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-17 08:26:22 +0200 |
commit | 93056481e85548e1228d3b88e53ee59ed983576e (patch) | |
tree | 9187af96ec8799f883bfefe0667553b2cc3c905a /bean/com/sun/star | |
parent | 03c7c26cbe7d75f103515e62dc39103f11d4637f (diff) |
java: when rethrowing exceptions, store the original
Change-Id: I8a2a264597d0b1ae06b08136fea36003682380b5
Diffstat (limited to 'bean/com/sun/star')
-rw-r--r-- | bean/com/sun/star/comp/beans/OOoBean.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java index 4a82c5ec6310..384ad6027d60 100644 --- a/bean/com/sun/star/comp/beans/OOoBean.java +++ b/bean/com/sun/star/comp/beans/OOoBean.java @@ -894,28 +894,30 @@ public class OOoBean NoDocumentException, java.io.IOException, com.sun.star.lang.IllegalArgumentException - { + { // wrap byte arrray into UNO stream - com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream = - new com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter( - aOutBuffer ); + com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream = new com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter( + aOutBuffer); // add stream to arguments - com.sun.star.beans.PropertyValue[] aExtendedArguments = - addArgument( aArguments, new com.sun.star.beans.PropertyValue( - "OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); + com.sun.star.beans.PropertyValue[] aExtendedArguments = addArgument( + aArguments, new com.sun.star.beans.PropertyValue( + "OutputStream", -1, aStream, + com.sun.star.beans.PropertyState.DIRECT_VALUE)); // call normal store method - storeToURL( "private:stream", aExtendedArguments ); + storeToURL("private:stream", aExtendedArguments); // get byte array from document stream - try { aStream.closeOutput(); } - catch ( com.sun.star.io.NotConnectedException aExc ) - { /* TDB */ } - catch ( com.sun.star.io.BufferSizeExceededException aExc ) - { /* TDB */ } - catch ( com.sun.star.io.IOException aExc ) - { throw new java.io.IOException(); } + try { + aStream.closeOutput(); + } catch (com.sun.star.io.NotConnectedException aExc) { /* TDB */ + } catch (com.sun.star.io.BufferSizeExceededException aExc) { /* TDB */ + } catch (com.sun.star.io.IOException ex1) { + java.io.IOException ex2 = new java.io.IOException(); + ex2.initCause(ex1); + throw ex2; + } return aStream.getBuffer(); } |