diff options
Diffstat (limited to 'sfx2/source/doc/docfile.cxx')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 1674a41131df..c9631f64cbde 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -4676,12 +4676,15 @@ bool SfxMedium::SwitchDocumentToFile( const OUString& aURL ) { try { - uno::Reference< io::XTruncate > xTruncate( pImpl->xStream, uno::UNO_QUERY_THROW ); - xTruncate->truncate(); - if ( xOptStorage.is() ) - xOptStorage->writeAndAttachToStream( pImpl->xStream ); - pImpl->xStorage = xStorage; - bResult = true; + uno::Reference< io::XTruncate > xTruncate( pImpl->xStream, uno::UNO_QUERY ); + if (xTruncate) + { + xTruncate->truncate(); + if ( xOptStorage.is() ) + xOptStorage->writeAndAttachToStream( pImpl->xStream ); + pImpl->xStorage = xStorage; + bResult = true; + } } catch( const uno::Exception& ) {} |