diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2002-04-11 13:29:37 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2002-04-11 13:29:37 +0000 |
commit | ae33e1a9f7c8f55049bca7b2d2fb46a4b0c66932 (patch) | |
tree | e2a81e3e81d41e261c890521d91657951c0aba6d /package | |
parent | 1296fcdafbcc655a3b69f84d550002469fb50bd0 (diff) |
#97903# now setPropertyValue returns a result
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 26294ba7c48c..11f8241cfeb1 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ZipPackage.cxx,v $ * - * $Revision: 1.78 $ + * $Revision: 1.79 $ * - * last change: $Author: mav $ $Date: 2002-02-27 15:47:38 $ + * last change: $Author: mav $ $Date: 2002-04-11 14:29:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -726,9 +726,13 @@ sal_Bool ZipPackage::writeFileIsTemp() xSink = openOriginalForOutput(); if( xSink.is() ) { - xTempOut = xSink->getStream()->getOutputStream(); - if( xTempOut.is() ) - aUseTemp = sal_False; + Reference< XStream > xStr = xSink->getStream(); + if( xStr.is() ) + { + xTempOut = xStr->getOutputStream(); + if( xTempOut.is() ) + aUseTemp = sal_False; + } } } @@ -900,13 +904,22 @@ Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() { try { + sal_Bool bTruncSuccess = sal_False; + try { + Exception aDetect; sal_Int64 aSize = 0; - aOriginalContent.setPropertyValue( OUString::createFromAscii( "Size" ), makeAny( aSize ) ); + Any aAny = aOriginalContent.setPropertyValue( OUString::createFromAscii( "Size" ), makeAny( aSize ) ); + if( !( aAny >>= aDetect ) ) + bTruncSuccess = sal_True; } catch( Exception& ) { + } + + if( !bTruncSuccess ) + { // the file is not accessible // just try to write an empty stream to it @@ -959,12 +972,16 @@ void SAL_CALL ZipPackage::commitChanges( ) if( xSink.is() ) { - aOrigFileStream = xSink->getStream()->getOutputStream(); - if( aOrigFileStream.is() ) + Reference< XStream > xStr = xSink->getStream(); + if( xStr.is() ) { - copyInputToOutput( xContentStream, aOrigFileStream ); - aOrigFileStream->closeOutput(); - xContentSeek->seek ( 0 ); + aOrigFileStream = xStr->getOutputStream(); + if( aOrigFileStream.is() ) + { + copyInputToOutput( xContentStream, aOrigFileStream ); + aOrigFileStream->closeOutput(); + xContentSeek->seek ( 0 ); + } } } } |