drop document_io_logring.txt and use global logging

Change-Id: Ibda0ce925bc76355e636022c955077ac89e66cce
Reviewed-on: https://gerrit.libreoffice.org/36434
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 07cfbe1..c695a12 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -145,9 +145,7 @@ public:
                        { return ERRCODE_TOERROR(GetErrorCode()); }
    sal_uInt32          GetLastStorageCreationState();

    void                SetError( sal_uInt32 nError, const OUString& aLogMessage );

    void                AddLog( const OUString& aMessage );
    void                SetError(sal_uInt32 nError);

    void                CloseInStream();
    bool                CloseOutStream();
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 716da53..654720a 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -303,10 +303,7 @@ public:
    void                        ResetError();
    sal_uInt32                  GetError() const;
    sal_uInt32                  GetErrorCode() const;
    void                        SetError( sal_uInt32 rErr, const OUString& aLogMessage );

    void                        AddLog( const OUString& aMessage );
    void                        StoreLog();
    void                        SetError(sal_uInt32 rErr);

    /**
     * Initialize bare minimum just enough for unit test runs.
diff --git a/package/inc/pch/precompiled_xstor.hxx b/package/inc/pch/precompiled_xstor.hxx
index 941d290..6976db7 100644
--- a/package/inc/pch/precompiled_xstor.hxx
+++ b/package/inc/pch/precompiled_xstor.hxx
@@ -64,7 +64,6 @@
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/uno/Any.h>
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index a2c37e1..725cf81 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -26,7 +26,6 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/io/NotConnectedException.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -333,25 +332,6 @@ void OWriteStream_Impl::CleanCacheStream()
    }
}

void OWriteStream_Impl::AddLog( const OUString& aMessage )
{
    if ( !m_xLogRing.is() )
    {
        try
        {
            uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
            m_xLogRing = logging::DocumentIOLogRing::get(xContext);
        }
        catch( const uno::Exception& )
        {
            // No log
        }
    }

    if ( m_xLogRing.is() )
        m_xLogRing->logString( aMessage );
}

void OWriteStream_Impl::InsertIntoPackageFolder( const OUString& aName,
                                                  const uno::Reference< container::XNameContainer >& xParentPackageFolder )
{
@@ -489,8 +469,7 @@ void OWriteStream_Impl::DisposeWrappers()
        }
        catch ( const uno::RuntimeException& rRuntimeException )
        {
            AddLog( rRuntimeException.Message );
            AddLog( "Quiet exception" );
            SAL_INFO("package.xstor", "Quiet exception: " << rRuntimeException.Message);
        }

        m_pAntiImpl = nullptr;
@@ -538,19 +517,15 @@ OUString const & OWriteStream_Impl::GetFilledTempFileIfNo( const uno::Reference<
        }
        catch( const packages::WrongPasswordException& rWrongPasswordException )
        {
            AddLog( rWrongPasswordException.Message );
            AddLog( "Rethrow" );

            SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
            KillFile( aTempURL, comphelper::getProcessComponentContext() );
            throw;
        }
        catch( const uno::Exception& rException )
        {
            AddLog( rException.Message );
            AddLog( "Rethrow" );

            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
            KillFile( aTempURL, comphelper::getProcessComponentContext() );
        throw;
            throw;
        }

        if ( !aTempURL.isEmpty() )
@@ -661,8 +636,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetTempFileAsStream()
            }
            catch( const uno::Exception& rException )
            {
                AddLog( rException.Message );
                AddLog( "Quiet exception" );
                SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            }
        }
    }
@@ -699,8 +673,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream()
            }
            catch( const uno::Exception& rException )
            {
                AddLog( rException.Message );
                AddLog( "Quiet exception" );
                SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            }
        }
    }
@@ -1038,8 +1011,7 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary()
        }
        catch( const uno::Exception& rException )
        {
            AddLog( rException.Message );
            AddLog( "Quiet exception" );
            SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);

            m_nRelInfoStatus = RELINFO_BROKEN;
            m_bOrigRelInfoBroken = true;
@@ -1104,9 +1076,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper
        }
        catch( const uno::Exception& rException )
        {
            AddLog( rException.Message );
            AddLog( "Quiet exception" );

            SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            SAL_WARN( "package.xstor", "A property can't be retrieved!" );
        }
    }
@@ -1213,15 +1183,12 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
        catch( const packages::WrongPasswordException& rWrongPasswordException )
        {
            SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< beans::NamedValue >() );
            AddLog( rWrongPasswordException.Message );
            AddLog( "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
            throw;
        }
        catch ( const uno::Exception& rException )
        {
            AddLog( rException.Message );
            AddLog( "Quiet exception" );

            SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            SAL_WARN( "package.xstor", "Can't write encryption related properties!" );
            SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< beans::NamedValue >() );
            throw io::IOException(); // TODO:
@@ -1253,9 +1220,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
        }
        catch( const packages::NoEncryptionException& rNoEncryptionException )
        {
            AddLog( rNoEncryptionException.Message );
            AddLog( "Rethrow" );

            SAL_INFO("package.xstor", "Rethrow: " << rNoEncryptionException.Message);
            throw packages::WrongPasswordException();
        }

@@ -1476,9 +1441,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
        }
        catch( const packages::NoEncryptionException& rNoEncryptionException )
        {
            AddLog( rNoEncryptionException.Message );
            AddLog( "No Element" );

            SAL_INFO("package.xstor", "No Element: " << rNoEncryptionException.Message);
            throw packages::WrongPasswordException();
        }

@@ -1547,8 +1510,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
        {
            SAL_WARN( "package.xstor", "Can't open encrypted stream!" );
            SetEncryptionKeyProperty_Impl( xPropertySet, uno::Sequence< beans::NamedValue >() );
            AddLog( rException.Message );
            AddLog( "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
            throw;
        }

@@ -1714,8 +1676,7 @@ OWriteStream::~OWriteStream()
        }
        catch( const uno::RuntimeException& rRuntimeException )
        {
            m_pImpl->AddLog( rRuntimeException.Message );
            m_pImpl->AddLog( "Quiet exception" );
            SAL_INFO("package.xstor", "Quiet exception: " << rRuntimeException.Message);
        }
    }
}
@@ -1798,9 +1759,7 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea
    }
    catch ( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( "Quiet exception" );

        SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
        // TODO: set the stream in invalid state or dispose
        SAL_WARN( "package.xstor", "The stream become invalid during copiing!" );
        throw uno::RuntimeException();
@@ -2406,9 +2365,7 @@ void SAL_CALL OWriteStream::dispose()
            }
            catch( const uno::Exception& rException )
            {
                m_pImpl->AddLog( rException.Message );
                m_pImpl->AddLog( "Rethrow" );

                SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
                uno::Any aCaught( ::cppu::getCaughtException() );
                throw lang::WrappedTargetRuntimeException("Can not commit/revert the storage!",
                                                static_cast< OWeakObject* >( this ),
@@ -2532,15 +2489,12 @@ sal_Bool SAL_CALL OWriteStream::hasEncryptionData()
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( "Rethrow" );

        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( "Problems on hasEncryptionData!",
                                  static_cast< ::cppu::OWeakObject* >( this ),
@@ -2570,8 +2524,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID(  const OUString& sID )
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( "No Element" );
        SAL_INFO("package.xstor", "No Element: " << rNoSuchElementException.Message);
    }

    return false;
@@ -3215,27 +3168,22 @@ void SAL_CALL OWriteStream::commit()
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( "Rethrow" );

        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( "Problems on commit!",
                                  static_cast< ::cppu::OWeakObject* >( this ),
@@ -3275,27 +3223,22 @@ void SAL_CALL OWriteStream::revert()
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( "Rethrow" );

        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( "Problems on revert!",
                                  static_cast< ::cppu::OWeakObject* >( this ),
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index fab951b..a7cd759 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -38,7 +38,6 @@
#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/logging/XSimpleLogRing.hpp>

#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.h>
@@ -91,7 +90,6 @@ struct OWriteStream_Impl : public MutexHolder
    bool                        m_bFlushed;      // sending the streams is coordinated by the root storage of the package

    css::uno::Reference< css::packages::XDataSinkEncrSupport > m_xPackageStream;
    css::uno::Reference< css::logging::XSimpleLogRing >  m_xLogRing;

    css::uno::Reference< css::uno::XComponentContext > m_xContext;

@@ -156,8 +154,6 @@ public:

    void CleanCacheStream();

    void AddLog( const OUString& aMessage );

    bool UsesCommonEncryption_Impl() { return m_bUseCommonEncryption; }
    bool HasTempFile_Impl() const { return ( m_aTempURL.getLength() != 0 ); }
    bool IsTransacted();
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index aa30074..b451a62 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/packages/WrongPasswordException.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
@@ -296,8 +295,7 @@ OStorage_Impl::~OStorage_Impl()
            }
            catch ( const uno::Exception& rException )
            {
                AddLog( rException.Message );
                AddLog( THROW_WHERE "Quiet exception" );
                SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            }
            m_pAntiImpl = nullptr;
        }
@@ -312,8 +310,7 @@ OStorage_Impl::~OStorage_Impl()
                        pStorageIter->m_pPointer->InternalDispose( false );
                    } catch( const uno::Exception& rException )
                    {
                        AddLog( rException.Message );
                        AddLog( THROW_WHERE "Quiet exception" );
                        SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
                    }
            }

@@ -365,33 +362,14 @@ OStorage_Impl::~OStorage_Impl()
                    m_xStream.clear();
                }
            }
            catch( const uno::Exception& rException )
            catch (const uno::Exception& rException)
            {
                AddLog( THROW_WHERE "Quiet exception" );
                AddLog( rException.Message );
                SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            }
        }
    }
}

void OStorage_Impl::AddLog( const OUString& aMessage )
{
    if ( !m_xLogRing.is() )
    {
        try
        {
            m_xLogRing = logging::DocumentIOLogRing::get(m_xContext);
        }
        catch( const uno::Exception& )
        {
            // No log
        }
    }

    if ( m_xLogRing.is() )
        m_xLogRing->logString( aMessage );
}

void OStorage_Impl::SetReadOnlyWrap( OStorage& aStorage )
{
    // Weak reference is used inside the holder so the refcount must not be zero at this point
@@ -411,8 +389,7 @@ void OStorage_Impl::RemoveReadOnlyWrap( OStorage& aStorage )
                pStorageIter->m_pPointer->InternalDispose( false );
            } catch( const uno::Exception& rException )
            {
                AddLog( THROW_WHERE "Quiet exception" );
                AddLog( rException.Message );
                SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
            }

            StorageHoldersType::iterator pIterToDelete( pStorageIter );
@@ -639,10 +616,7 @@ void OStorage_Impl::ReadContents()
        }
        catch( const container::NoSuchElementException& rNoSuchElementException )
        {
            AddLog( rNoSuchElementException.Message );
            AddLog( THROW_WHERE "NoSuchElement" );

            SAL_WARN( "package.xstor", "hasMoreElements() implementation has problems!" );
            SAL_WARN( "package.xstor", "hasMoreElements() implementation has problems! " << rNoSuchElementException.Message);
            break;
        }
    }
@@ -716,8 +690,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes
            }
            catch( const packages::NoEncryptionException& rNoEncryptionException )
            {
                AddLog( rNoEncryptionException.Message );
                AddLog( THROW_WHERE "No Encryption" );
                SAL_INFO("package.xstor", "No Encryption: " << rNoEncryptionException.Message);
            }
        }
    }
@@ -881,8 +854,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
            }
            catch( const packages::NoEncryptionException& rNoEncryptionException )
            {
                AddLog( rNoEncryptionException.Message );
                AddLog( THROW_WHERE "No Encryption" );
                SAL_INFO("package.xstor", "No Encryption: " << rNoEncryptionException.Message);
            }

            if (bHasCommonEncryptionData && ::package::PackageEncryptionDatasEqual(pElement->m_xStream->GetCachedEncryptionData(), aCommonEncryptionData))
@@ -936,8 +908,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
            }
            catch( const packages::WrongPasswordException& rWrongPasswordException )
            {
                AddLog( rWrongPasswordException.Message );
                AddLog( THROW_WHERE "Handled exception" );
                SAL_INFO("package.xstor", "Handled exception: " << rWrongPasswordException.Message);

                // If the common storage password does not allow to open the stream
                // it could be copied in raw way, the problem is that the StartKey should be the same
@@ -1224,8 +1195,7 @@ void OStorage_Impl::Commit()
                throw aException;
            }

            AddLog( aException.Message );
            AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aException.Message);
            throw;
        }
    }
@@ -1853,8 +1823,7 @@ OStorage::~OStorage()
        }
        catch( const uno::RuntimeException& rRuntimeException )
        {
            m_pImpl->AddLog( rRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Handled exception" );
            SAL_INFO("package.xstor", "Handled exception: " << rRuntimeException.Message);
        }
    }
}
@@ -1899,8 +1868,7 @@ void SAL_CALL OStorage::InternalDispose( bool bNotifyImpl )
                            xTmp->dispose();
                        } catch( const uno::Exception& rException )
                        {
                            m_pImpl->AddLog( rException.Message );
                            m_pImpl->AddLog( THROW_WHERE "Quiet exception" );
                            SAL_INFO("package.xstor", "Quiet exception: " << rException.Message);
                        }
                    }
                }
@@ -2254,40 +2222,34 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& 
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy storage!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2332,46 +2294,39 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::WrongPasswordException& rWrongPasswordException )
    {
        m_pImpl->AddLog( rWrongPasswordException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException(THROW_WHERE "Can't open stream element!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2491,40 +2446,34 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open storage!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2559,46 +2508,39 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUStr
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::WrongPasswordException& rWrongPasswordException )
    {
        m_pImpl->AddLog( rWrongPasswordException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2629,40 +2571,34 @@ void SAL_CALL OStorage::copyLastCommitTo(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit version!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2720,40 +2656,34 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy last commit element version!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2784,34 +2714,29 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName )
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can't detect whether it is a stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2847,34 +2772,29 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName )
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "can't detect whether it is a storage",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -2919,46 +2839,39 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName )
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't remove element!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3006,52 +2919,44 @@ void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUStr
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't rename element!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3099,52 +3004,44 @@ void SAL_CALL OStorage::copyElementTo(  const OUString& aElementName,
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3195,52 +3092,44 @@ void SAL_CALL OStorage::moveElementTo(  const OUString& aElementName,
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't move element!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3290,52 +3179,44 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::NoEncryptionException& rNoEncryptionException )
    {
        m_pImpl->AddLog( rNoEncryptionException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoEncryptionException.Message);
        throw;
    }
    catch( const packages::WrongPasswordException& rWrongPasswordException )
    {
        m_pImpl->AddLog( rWrongPasswordException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't open encrypted stream stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3376,52 +3257,44 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::NoEncryptionException& rNoEncryptionException )
    {
        m_pImpl->AddLog( rNoEncryptionException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoEncryptionException.Message);
        throw;
    }
    catch( const packages::WrongPasswordException& rWrongPasswordException )
    {
        m_pImpl->AddLog( rWrongPasswordException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't clone encrypted stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3479,46 +3352,39 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get plain raw stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3581,52 +3447,44 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::NoEncryptionException& rNoEncryptionException )
    {
        m_pImpl->AddLog( rNoEncryptionException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoEncryptionException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get raw stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3668,52 +3526,44 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName,
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::NoRawFormatException& rNoRawFormatException )
    {
        m_pImpl->AddLog( rNoRawFormatException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoRawFormatException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert raw stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -3747,26 +3597,22 @@ void SAL_CALL OStorage::commit()
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on commit!",
@@ -3815,26 +3661,22 @@ void SAL_CALL OStorage::revert()
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Problems on revert!",
@@ -3983,26 +3825,22 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName )
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const lang::WrappedTargetException& rWrappedTargetException )
    {
        m_pImpl->AddLog( rWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetException( THROW_WHERE "Can not open storage!",
@@ -4029,14 +3867,12 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames()
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch ( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!",
@@ -4068,14 +3904,12 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName )
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch ( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!",
@@ -4116,14 +3950,12 @@ sal_Bool SAL_CALL OStorage::hasElements()
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!",
@@ -4149,14 +3981,12 @@ void SAL_CALL OStorage::dispose()
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
        m_pImpl->AddLog( rException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

        uno::Any aCaught( ::cppu::getCaughtException() );
        throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open storage!",
@@ -4223,14 +4053,12 @@ void SAL_CALL OStorage::removeEncryption()
        }
        catch ( const uno::RuntimeException& rRuntimeException )
        {
            m_pImpl->AddLog( rRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
            throw;
        }
        catch ( const uno::Exception& rException )
        {
            m_pImpl->AddLog( rException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4252,16 +4080,14 @@ void SAL_CALL OStorage::removeEncryption()
        }
        catch( const uno::RuntimeException& rRException )
        {
            m_pImpl->AddLog( rRException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rRException.Message);

            SAL_WARN( "package.xstor", "The call must not fail, it is pretty simple!" );
            throw;
        }
        catch( const uno::Exception& rException )
        {
            m_pImpl->AddLog( rException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

            SAL_WARN( "package.xstor", "The call must not fail, it is pretty simple!" );
            throw io::IOException( THROW_WHERE );
@@ -4295,14 +4121,12 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu
        }
        catch ( const uno::RuntimeException& rRuntimeException )
        {
            m_pImpl->AddLog( rRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
            throw;
        }
        catch ( const uno::Exception& rException )
        {
            m_pImpl->AddLog( rException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4322,8 +4146,7 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu
        }
        catch( const uno::Exception& rException )
        {
            m_pImpl->AddLog( rException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

            throw io::IOException( THROW_WHERE );
        }
@@ -4363,14 +4186,12 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam
        }
        catch ( const uno::RuntimeException& aRuntimeException )
        {
            m_pImpl->AddLog( aRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message);
            throw;
        }
        catch ( const uno::Exception& aException )
        {
            m_pImpl->AddLog( aException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4386,14 +4207,12 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam
        }
        catch ( const uno::RuntimeException& aRuntimeException )
        {
            m_pImpl->AddLog( aRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message);
            throw;
        }
        catch( const uno::Exception& aException )
        {
            m_pImpl->AddLog( aException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4425,14 +4244,12 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms()
        }
        catch ( const uno::RuntimeException& aRuntimeException )
        {
            m_pImpl->AddLog( aRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message);
            throw;
        }
        catch ( const uno::Exception& aException )
        {
            m_pImpl->AddLog( aException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4447,14 +4264,12 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms()
        }
        catch ( const uno::RuntimeException& aRuntimeException )
        {
            m_pImpl->AddLog( aRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aRuntimeException.Message);
            throw;
        }
        catch( const uno::Exception& aException )
        {
            m_pImpl->AddLog( aException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << aException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetRuntimeException( THROW_WHERE "Can not open package!",
@@ -4603,14 +4418,12 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName )
        }
        catch ( const uno::RuntimeException& rRuntimeException )
        {
            m_pImpl->AddLog( rRuntimeException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
            throw;
        }
        catch ( const uno::Exception& rException )
        {
            m_pImpl->AddLog( rException.Message );
            m_pImpl->AddLog( THROW_WHERE "Rethrow" );
            SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

            uno::Any aCaught( ::cppu::getCaughtException() );
            throw lang::WrappedTargetException(
@@ -4662,14 +4475,12 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName )
            }
            catch ( const uno::RuntimeException& rRuntimeException )
            {
                m_pImpl->AddLog( rRuntimeException.Message );
                m_pImpl->AddLog( THROW_WHERE "Rethrow" );
                SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
                throw;
            }
            catch ( const uno::Exception& rException )
            {
                m_pImpl->AddLog( rException.Message );
                m_pImpl->AddLog( THROW_WHERE "Rethrow" );
                SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

                uno::Any aCaught( ::cppu::getCaughtException() );
                throw lang::WrappedTargetException( THROW_WHERE "Can not open package!",
@@ -4766,8 +4577,7 @@ sal_Bool SAL_CALL OStorage::hasByID(  const OUString& sID )
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Quiet exception" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
    }

    return false;
@@ -5154,46 +4964,39 @@ void SAL_CALL OStorage::insertStreamElementDirect(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't insert stream directly!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -5239,52 +5042,44 @@ void SAL_CALL OStorage::copyElementDirectlyTo(
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const container::ElementExistException& rElementExistException )
    {
        m_pImpl->AddLog( rElementExistException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rElementExistException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy element direcly!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -5313,40 +5108,34 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't write and attach to stream!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -5389,40 +5178,34 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL,
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't attach to URL!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -5466,58 +5249,49 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const container::NoSuchElementException& rNoSuchElementException )
    {
        m_pImpl->AddLog( rNoSuchElementException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rNoSuchElementException.Message);
        throw;
    }
    catch( const beans::UnknownPropertyException& rUnknownPropertyException )
    {
        m_pImpl->AddLog( rUnknownPropertyException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rUnknownPropertyException.Message);
        throw;
    }
    catch( const beans::PropertyVetoException& rPropertyVetoException )
    {
        m_pImpl->AddLog( rPropertyVetoException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rPropertyVetoException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't get element property!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
@@ -5554,46 +5328,39 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons
    }
    catch( const embed::InvalidStorageException& rInvalidStorageException )
    {
        m_pImpl->AddLog( rInvalidStorageException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rInvalidStorageException.Message);
        throw;
    }
    catch( const lang::IllegalArgumentException& rIllegalArgumentException )
    {
        m_pImpl->AddLog( rIllegalArgumentException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIllegalArgumentException.Message);
        throw;
    }
    catch( const packages::WrongPasswordException& rWrongPasswordException )
    {
        m_pImpl->AddLog( rWrongPasswordException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rWrongPasswordException.Message);
        throw;
    }
    catch( const io::IOException& rIOException )
    {
        m_pImpl->AddLog( rIOException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rIOException.Message);
        throw;
    }
    catch( const embed::StorageWrappedTargetException& rStorageWrappedTargetException )
    {
        m_pImpl->AddLog( rStorageWrappedTargetException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rStorageWrappedTargetException.Message);
        throw;
    }
    catch( const uno::RuntimeException& rRuntimeException )
    {
        m_pImpl->AddLog( rRuntimeException.Message );
        m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rRuntimeException.Message);
        throw;
    }
    catch( const uno::Exception& rException )
    {
          m_pImpl->AddLog( rException.Message );
          m_pImpl->AddLog( THROW_WHERE "Rethrow" );
        SAL_INFO("package.xstor", "Rethrow: " << rException.Message);

          uno::Any aCaught( ::cppu::getCaughtException() );
        uno::Any aCaught( ::cppu::getCaughtException() );
        throw embed::StorageWrappedTargetException( THROW_WHERE "Can't copy stream data!",
                                                 uno::Reference< io::XInputStream >(),
                                                 aCaught );
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index 568caf3..4fb4ed0 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -42,7 +42,6 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/packages/NoEncryptionException.hpp>
#include <com/sun/star/logging/XSimpleLogRing.hpp>

#include <cppuhelper/weak.hxx>
#include <cppuhelper/weakref.hxx>
@@ -142,7 +141,6 @@ struct OStorage_Impl
    SotElementList_Impl                         m_aDeletedList;

    css::uno::Reference< css::container::XNameContainer > m_xPackageFolder;
    css::uno::Reference< css::logging::XSimpleLogRing >  m_xLogRing;

    css::uno::Reference< css::lang::XSingleServiceFactory > m_xPackage;
    css::uno::Reference< css::uno::XComponentContext >  m_xContext;
@@ -198,8 +196,6 @@ struct OStorage_Impl

    ~OStorage_Impl();

    void AddLog( const OUString& aMessage );

    void SetReadOnlyWrap( OStorage& aStorage );
    void RemoveReadOnlyWrap( OStorage& aStorage );

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 12ad933..e4cf5364 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -153,7 +153,7 @@ ScDocument::HardRecalcState ScBroadcastAreaSlot::CheckHardRecalcStateCondition()
            OSL_ENSURE( pShell, "Missing DocShell :-/" );

            if ( pShell )
                pShell->SetError( SCWARN_CORE_HARD_RECALC, OSL_LOG_PREFIX );
                pShell->SetError(SCWARN_CORE_HARD_RECALC);

            pDoc->SetAutoCalc( false );
            eState = ScDocument::HARDRECALCSTATE_ETERNAL;
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index 289ffb7..e2fdfec 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -106,7 +106,7 @@ FltError ExportBiff5::Write()
        SvxImportMSVBasic aBasicImport( *pDocShell, *xRootStrg );
        const ErrCode nErr = aBasicImport.SaveOrDelMSVBAStorage( true, EXC_STORAGE_VBA_PROJECT );
        if( nErr != ERRCODE_NONE )
            pDocShell->SetError( nErr, OSL_LOG_PREFIX );
            pDocShell->SetError(nErr);
    }

    pExcDoc->ReadDoc();         // ScDoc -> ExcDoc
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 3fc6d41..2260329 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -456,7 +456,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
        bRet = aImport.Import(ImportFlags::All, nError);

    if ( nError )
        pLoadMedium->SetError( nError, OSL_LOG_PREFIX );
        pLoadMedium->SetError(nError);

    processDataStream(*this, aImport.GetImportPostProcessData());

@@ -615,10 +615,10 @@ bool ScDocShell::Load( SfxMedium& rMedium )
    }

    if (!bRet && !rMedium.GetError())
        rMedium.SetError( SVSTREAM_FILEFORMAT_ERROR, OSL_LOG_PREFIX );
        rMedium.SetError(SVSTREAM_FILEFORMAT_ERROR);

    if (rMedium.GetError())
        SetError( rMedium.GetError(), OSL_LOG_PREFIX );
        SetError(rMedium.GetError());

    InitItems();
    CalcOutputFactor();
@@ -941,7 +941,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                        }

                        if ( !bSuccess )
                            SetError( ERRCODE_IO_ABORT, OSL_LOG_PREFIX ); // this error code will produce no error message, but will break the further saving process
                            SetError(ERRCODE_IO_ABORT); // this error code will produce no error message, but will break the further saving process
                    }
#endif

@@ -958,7 +958,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )

                        if( RET_NO == aBox->Execute())
                        {
                            SetError( ERRCODE_IO_ABORT, OSL_LOG_PREFIX ); // this error code will produce no error message, but will break the further saving process
                            SetError(ERRCODE_IO_ABORT); // this error code will produce no error message, but will break the further saving process
                        }
                    }
                    SAL_FALLTHROUGH;
@@ -1101,7 +1101,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                if (eError != eERR_OK)
                {
                    if (!GetError())
                        SetError(eError, OSL_LOG_PREFIX);
                        SetError(eError);
                }
                else
                    bRet = true;
@@ -1130,7 +1130,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            if (eError != eERR_OK)
            {
                if (!GetError())
                    SetError(eError, OSL_LOG_PREFIX);
                    SetError(eError);

                if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
                    bRet = true;
@@ -1167,13 +1167,13 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            if (eError == SCWARN_IMPORT_RANGE_OVERFLOW)
            {
                if (!GetError())
                    SetError(eError, OSL_LOG_PREFIX);
                    SetError(eError);
                bRet = true;
            }
            else if (eError != eERR_OK)
            {
                if (!GetError())
                    SetError(eError, OSL_LOG_PREFIX);
                    SetError(eError);
            }
            else
                bRet = true;
@@ -1255,7 +1255,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            if (eError != eERR_OK)
            {
                if (!GetError())
                    SetError(eError, OSL_LOG_PREFIX);
                    SetError(eError);
            }
            else if (!GetError() && (bOverflowRow || bOverflowCol || bOverflowCell))
            {
@@ -1263,7 +1263,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                FltError nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW :
                        (bOverflowCol ? SCWARN_IMPORT_COLUMN_OVERFLOW :
                         SCWARN_IMPORT_CELL_OVERFLOW));
                SetError( nWarn, OSL_LOG_PREFIX);
                SetError(nWarn);
            }
            bSetColWidths = true;
            bSetSimpleTextColWidths = true;
@@ -1295,7 +1295,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            if (eError != eERR_OK)
            {
                if (!GetError())
                    SetError(eError, OSL_LOG_PREFIX);
                    SetError(eError);
                bRet = ( eError == SCWARN_IMPORT_RANGE_OVERFLOW );
            }
            else
@@ -1333,7 +1333,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                if (eError != eERR_OK)
                {
                    if (!GetError())
                        SetError(eError, OSL_LOG_PREFIX);
                        SetError(eError);

                    if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
                        bRet = true;
@@ -1369,7 +1369,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            }

            if ( eError != eERR_OK && !GetError() )
                SetError(eError, OSL_LOG_PREFIX);
                SetError(eError);
            bSetColWidths = true;
            bSetSimpleTextColWidths = true;
            bSetRowHeights = true;
@@ -1380,7 +1380,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            if (eError != eERR_OK)
            {
                if (!GetError())
                    SetError( eError, OSL_LOG_PREFIX );
                    SetError(eError);
                if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
                    bRet = true;
            }
@@ -1406,7 +1406,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                    if (eError != eERR_OK)
                    {
                        if (!GetError())
                            SetError(eError, OSL_LOG_PREFIX);
                            SetError(eError);

                        if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
                            bRet = true;
@@ -1426,7 +1426,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            }

            if ( eError != eERR_OK && !GetError() )
                SetError(eError, OSL_LOG_PREFIX);
                SetError(eError);
        }
        else if (aFltName == pFilterHtml || aFltName == pFilterHtmlWebQ)
        {
@@ -1458,7 +1458,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                    if (eError != eERR_OK)
                    {
                        if (!GetError())
                            SetError(eError, OSL_LOG_PREFIX);
                            SetError(eError);

                        if( ( eError & ERRCODE_WARNING_MASK ) == ERRCODE_WARNING_MASK )
                            bRet = true;
@@ -1477,12 +1477,12 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
            }

            if ( eError != eERR_OK && !GetError() )
                SetError(eError, OSL_LOG_PREFIX);
                SetError(eError);
        }
        else
        {
            if (!GetError())
                SetError(SCERR_IMPORT_NI, OSL_LOG_PREFIX);
                SetError(SCERR_IMPORT_NI);
        }

        if (!bCalc3)
@@ -2289,7 +2289,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
            FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );

            if( eError && !GetError() )
                SetError( eError, OSL_LOG_PREFIX );
                SetError(eError);

            // don't return false for warnings
            bRet = ((eError & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK) || (eError == eERR_OK);
@@ -2297,7 +2297,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
        else
        {
            // export aborted, i.e. "Save without password" warning
            SetError( ERRCODE_ABORT, OSL_LOG_PREFIX );
            SetError(ERRCODE_ABORT);
        }
    }
    else if (aFltName == pFilterAscii)
@@ -2330,7 +2330,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )

            if (aDocument.GetTableCount() > 1)
                if (!rMed.GetError())
                    rMed.SetError(SCWARN_EXPORT_ASCII, OSL_LOG_PREFIX);
                    rMed.SetError(SCWARN_EXPORT_ASCII);
        }
    }
    else if (aFltName == pFilterDBase)
@@ -2371,7 +2371,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
        if ( eError != eERR_OK )
        {
            if (!GetError())
                SetError(eError, OSL_LOG_PREFIX);
                SetError(eError);
            if ( bHasMemo && IsDocument( aTmpFile ) )
                KillFile( aTmpFile );
        }
@@ -2391,7 +2391,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
                {
                    KillFile( aTmpFile );
                    if ( !GetError() )
                        SetError( SCERR_EXPORT_DATA, OSL_LOG_PREFIX );
                        SetError(SCERR_EXPORT_DATA);
                }
            }
        }
@@ -2425,7 +2425,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )

            if (aDocument.GetTableCount() > 1)
                if (!rMed.GetError())
                    rMed.SetError(SCWARN_EXPORT_ASCII, OSL_LOG_PREFIX);
                    rMed.SetError(SCWARN_EXPORT_ASCII);
        }
    }
    else if (aFltName == pFilterSylk)
@@ -2467,14 +2467,14 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
                SetError(*new StringErrorInfo(
                    SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
                    aImExport.GetNonConvertibleChars(),
                    ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageInfo), OSL_LOG_PREFIX);
                    ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageInfo));
            }
        }
    }
    else
    {
        if (GetError())
            SetError(SCERR_IMPORT_NI, OSL_LOG_PREFIX);
            SetError(SCERR_IMPORT_NI);
    }
    return bRet;
}
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index cec6166..ef9b8fe 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -94,7 +94,7 @@ bool SdPPTFilter::Import()
            pDocStream->SetCryptMaskKey(pStorage->GetKey());

            if ( pStorage->IsStream( "EncryptedSummary" ) )
                mrMedium.SetError( ERRCODE_SVX_READ_FILTER_PPOINT, OSL_LOG_PREFIX );
                mrMedium.SetError(ERRCODE_SVX_READ_FILTER_PPOINT);
            else
            {
#ifndef DISABLE_DYNLOADING
@@ -106,14 +106,14 @@ bool SdPPTFilter::Import()
                        bRet = PPTImport( &mrDocument, *pDocStream, *pStorage, mrMedium );

                    if ( !bRet )
                        mrMedium.SetError( SVSTREAM_WRONGVERSION, OSL_LOG_PREFIX );
                        mrMedium.SetError(SVSTREAM_WRONGVERSION);
                    pLibrary->release(); //TODO: let it get unloaded?
                    delete pLibrary;
                }
#else
                bRet = ImportPPT( &mrDocument, *pDocStream, *pStorage, mrMedium );
                if ( !bRet )
                    mrMedium.SetError( SVSTREAM_WRONGVERSION, OSL_LOG_PREFIX );
                    mrMedium.SetError(SVSTREAM_WRONGVERSION);
#endif
            }

diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 0ee9859..d1e464f 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -332,12 +332,12 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
    else
    {
        if( nError == ERRCODE_IO_BROKENPACKAGE )
            SetError( ERRCODE_IO_BROKENPACKAGE, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_BROKENPACKAGE);

        // TODO/LATER: correct error handling?!
        //pStore->SetError( SVSTREAM_WRONGVERSION, OUString( OSL_LOG_PREFIX ) );
        //pStore->SetError(SVSTREAM_WRONGVERSION);
        else
            SetError( ERRCODE_ABORT, OSL_LOG_PREFIX );
            SetError(ERRCODE_ABORT);
    }

    // tell SFX to change viewshell when in preview mode
@@ -592,7 +592,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium )
        bRet = SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export();

    if( GetError() == ERRCODE_NONE )
        SetError( nVBWarning, OSL_LOG_PREFIX );
        SetError(nVBWarning);

    return bRet;
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 063fbf4..52384b4 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -61,8 +61,6 @@
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/security/DocumentSignatureInformation.hpp>
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
@@ -221,7 +219,6 @@ public:
    uno::Reference<io::XStream> xStream;
    uno::Reference<io::XStream> m_xLockingStream;
    uno::Reference<task::XInteractionHandler> xInteraction;
    uno::Reference<logging::XSimpleLogRing> m_xLogRing;

    sal_uInt32                  nLastStorageError;

@@ -300,39 +297,16 @@ void SfxMedium::ResetError()
        pImpl->m_pOutStream->ResetError();
}


sal_uInt32 SfxMedium::GetLastStorageCreationState()
{
    return pImpl->nLastStorageError;
}


void SfxMedium::AddLog( const OUString& aMessage )
{
    if ( !pImpl->m_xLogRing.is() )
    {
        try
        {
            Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
            pImpl->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) );
        }
        catch( const uno::Exception& )
        {}
    }

    if ( pImpl->m_xLogRing.is() )
        pImpl->m_xLogRing->logString( aMessage );
}


void SfxMedium::SetError( sal_uInt32 nError, const OUString& aLogMessage )
void SfxMedium::SetError(sal_uInt32 nError)
{
    pImpl->m_eError = nError;
    if ( pImpl->m_eError != ERRCODE_NONE && !aLogMessage.isEmpty() )
        AddLog( aLogMessage );
}


sal_uInt32 SfxMedium::GetErrorCode() const
{
    sal_uInt32 lError = pImpl->m_eError;
@@ -343,7 +317,6 @@ sal_uInt32 SfxMedium::GetErrorCode() const
    return lError;
}


void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
{
    GetInitFileDate( true );
@@ -372,7 +345,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
                ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
                if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
                {
                    SetError( ERRCODE_ABORT, OSL_LOG_PREFIX );
                    SetError(ERRCODE_ABORT);
                }
            }
            catch ( const uno::Exception& )
@@ -760,7 +733,7 @@ void SfxMedium::StorageBackup_Impl()
    {
        DoInternalBackup_Impl( aOriginalContent );
        if( pImpl->m_aBackupURL.isEmpty() )
            SetError( ERRCODE_SFX_CANTCREATEBACKUP, OSL_LOG_PREFIX );
            SetError(ERRCODE_SFX_CANTCREATEBACKUP);
    }
}

@@ -819,7 +792,7 @@ void SfxMedium::SetEncryptionDataToStorage_Impl()
            {
                SAL_WARN( "sfx.doc", "It must be possible to set a common password for the storage" );
                // TODO/LATER: set the error code in case of problem
                // SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX  ) );
                // SetError(ERRCODE_IO_GENERAL);
            }
        }
    }
@@ -896,7 +869,7 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
        ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
        if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
        {
            SetError( ERRCODE_ABORT, OSL_LOG_PREFIX );
            SetError(ERRCODE_ABORT);
        }
        else if ( uno::Reference< task::XInteractionDisapprove >( xSelected.get(), uno::UNO_QUERY ).is() )
        {
@@ -935,7 +908,7 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog( const LockFileEnt
            GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
        }
        else
            SetError( ERRCODE_IO_ACCESSDENIED, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_ACCESSDENIED);

    }

@@ -1068,7 +1041,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
                const SfxBoolItem* pReadOnlyItem = SfxItemSet::GetItem<SfxBoolItem>(pImpl->m_pSet, SID_DOC_READONLY, false);

                if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) )
                    SetError( ERRCODE_IO_ACCESSDENIED, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_ACCESSDENIED);
                else
                    GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
            }
@@ -1286,7 +1259,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
            const SfxBoolItem* pReadOnlyItem = SfxItemSet::GetItem<SfxBoolItem>(pImpl->m_pSet, SID_DOC_READONLY, false);

            if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) )
                SetError( ERRCODE_IO_ACCESSDENIED, OSL_LOG_PREFIX );
                SetError(ERRCODE_IO_ACCESSDENIED);
            else
                GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
        }
@@ -1638,12 +1611,12 @@ bool SfxMedium::StorageCommit_Impl()
                    }

                    if (!GetError())
                        SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                        SetError(ERRCODE_IO_GENERAL);
                }
                catch ( const uno::Exception& )
                {
                    //TODO/LATER: improve error handling
                    SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_GENERAL);
                }
            }
        }
@@ -1914,7 +1887,7 @@ void SfxMedium::Transfer_Impl()
            else
            {
                SAL_WARN( "sfx.doc", "Illegal Output stream parameter!" );
                SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                SetError(ERRCODE_IO_GENERAL);
            }

            // free the reference
@@ -2448,7 +2421,7 @@ void SfxMedium::GetMedium_Impl()

        //TODO/MBA: ErrorHandling - how to transport error from MediaDescriptor
        if ( !GetError() && !pImpl->xStream.is() && !pImpl->xInputStream.is() )
            SetError( ERRCODE_IO_ACCESSDENIED, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_ACCESSDENIED);

        if ( !GetError() )
        {
@@ -3365,7 +3338,7 @@ void SfxMedium::CreateTempFile( bool bReplace )
    OUString aTmpURL = pImpl->pTempFile->GetURL();
    if ( pImpl->m_aName.isEmpty() || aTmpURL.isEmpty() )
    {
        SetError( ERRCODE_IO_CANTWRITE, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_CANTWRITE);
        return;
    }

@@ -3443,7 +3416,7 @@ void SfxMedium::CreateTempFile( bool bReplace )

        if ( !bTransferSuccess )
        {
            SetError( ERRCODE_IO_CANTWRITE, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_CANTWRITE);
            return;
        }
    }
@@ -3463,7 +3436,7 @@ void SfxMedium::CreateTempFileNoCopy()
    pImpl->m_aName = pImpl->pTempFile->GetFileName();
    if ( pImpl->m_aName.isEmpty() )
    {
        SetError( ERRCODE_IO_CANTWRITE, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_CANTWRITE);
        return;
    }

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index cfccb7d..9597835 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -37,7 +37,6 @@
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/logging/DocumentIOLogRing.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/FinishEngineEvent.hpp>
#include <com/sun/star/script/InterruptReason.hpp>
@@ -210,25 +209,19 @@ void SfxObjectShell::FlushDocInfo()
                 (delay > 0) || !url.isEmpty() );
}


void SfxObjectShell::SetError( sal_uInt32 lErr, const OUString& aLogMessage )
void SfxObjectShell::SetError(sal_uInt32 lErr)
{
    if(pImpl->lErr==ERRCODE_NONE)
    if (pImpl->lErr==ERRCODE_NONE)
    {
        pImpl->lErr=lErr;

        if( lErr != ERRCODE_NONE && !aLogMessage.isEmpty() )
            AddLog( aLogMessage );
    }
}


sal_uInt32 SfxObjectShell::GetError() const
{
    return ERRCODE_TOERROR(GetErrorCode());
}


sal_uInt32 SfxObjectShell::GetErrorCode() const
{
    sal_uInt32 lError=pImpl->lErr;
@@ -237,19 +230,14 @@ sal_uInt32 SfxObjectShell::GetErrorCode() const
    return lError;
}


void SfxObjectShell::ResetError()
{
    if( pImpl->lErr != ERRCODE_NONE )
        AddLog( OSL_LOG_PREFIX "Resetting Error." );

    pImpl->lErr=0;
    SfxMedium * pMed = GetMedium();
    if( pMed )
        pMed->ResetError();
}


void SfxObjectShell::EnableSetModified( bool bEnable )
{
    SAL_INFO_IF( bEnable == pImpl->m_bEnableSetModified, "sfx", "SFX_PERSIST: EnableSetModified 2x called with the same value" );
@@ -1242,7 +1230,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
            }
            else
            {
                SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                SetError(ERRCODE_IO_GENERAL);
            }
        }
        else
@@ -1848,89 +1836,6 @@ bool SfxObjectShell_Impl::hasTrustedScriptingSignature( bool bAllowUIToAddAuthor
    return bResult;
}

void SfxObjectShell::AddLog( const OUString& aMessage )
{
    if ( !pImpl->m_xLogRing.is() )
    {
        try
        {
            Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
            pImpl->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) );
        }
        catch( uno::Exception& )
        {}
    }

    if ( pImpl->m_xLogRing.is() )
        pImpl->m_xLogRing->logString( aMessage );
}

namespace {

void WriteStringInStream( const uno::Reference< io::XOutputStream >& xOutStream, const OUString& aString )
{
    if ( xOutStream.is() )
    {
        OString aStrLog = OUStringToOString( aString, RTL_TEXTENCODING_UTF8 );
        uno::Sequence< sal_Int8 > aLogData( reinterpret_cast<const sal_Int8*>(aStrLog.getStr()), aStrLog.getLength() );
        xOutStream->writeBytes( aLogData );

        aLogData.realloc( 1 );
        aLogData[0] = '\n';
        xOutStream->writeBytes( aLogData );
    }
}

}

void SfxObjectShell::StoreLog()
{
    if ( !pImpl->m_xLogRing.is() )
    {
        try
        {
            Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
            pImpl->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) );
        }
        catch( uno::Exception& )
        {}
    }

    if ( pImpl->m_xLogRing.is() )
    {
        OUString aFileURL = ( "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}"  );

        ::rtl::Bootstrap::expandMacros( aFileURL );

        OUString aBuildID = ( "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("setup") ":buildid}"  );

        ::rtl::Bootstrap::expandMacros( aBuildID );

        if ( !aFileURL.isEmpty() )
        {
            aFileURL += "/user/temp/document_io_logring.txt";
            try
            {
                uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
                uno::Reference< ucb::XSimpleFileAccess3 > xSimpleFileAccess(ucb::SimpleFileAccess::create(xContext));
                uno::Reference< io::XStream > xStream( xSimpleFileAccess->openFileReadWrite( aFileURL ), uno::UNO_SET_THROW );
                uno::Reference< io::XOutputStream > xOutStream( xStream->getOutputStream(), uno::UNO_SET_THROW );
                uno::Reference< io::XTruncate > xTruncate( xOutStream, uno::UNO_QUERY_THROW );
                xTruncate->truncate();

                if ( !aBuildID.isEmpty() )
                    WriteStringInStream( xOutStream, aBuildID );

                uno::Sequence< OUString > aLogSeq = pImpl->m_xLogRing->getCollectedLog();
                for ( sal_Int32 nInd = 0; nInd < aLogSeq.getLength(); nInd++ )
                    WriteStringInStream( xOutStream, aLogSeq[nInd] );
            }
            catch( uno::Exception& )
            {}
        }
    }
}

bool SfxObjectShell::IsContinueImportOnFilterExceptions(const OUString& aErrMessage)
{
    if (mbContinueImportOnFilterExceptions == undefined)
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 72eeba9..2b1e188 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -253,7 +253,7 @@ bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
    catch( uno::Exception& )
    {
        // TODO/LATER: handle the error depending on exception
        SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_GENERAL);
    }

    return bResult;
@@ -285,7 +285,7 @@ OUString SfxObjectShell::CreateTempCopyOfStorage_Impl( const uno::Reference< emb
            aTempURL.clear();

            // TODO/LATER: may need error code setting based on exception
            SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_GENERAL);
        }
    }

@@ -359,7 +359,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
                }
                catch( uno::Exception& )
                {
                    const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                    const_cast<SfxObjectShell*>( this )->SetError(ERRCODE_IO_GENERAL);
                }

                SvtSaveOptions::ODFDefaultVersion nDefVersion = SvtSaveOptions::ODFVER_012;
@@ -412,7 +412,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
                }
                catch( uno::Exception& )
                {
                    const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                    const_cast<SfxObjectShell*>( this )->SetError(ERRCODE_IO_GENERAL);
                }

            }
@@ -450,7 +450,7 @@ bool SfxObjectShell::GeneralInit_Impl( const uno::Reference< embed::XStorage >& 
            {
                if ( bTypeMustBeSetAlready )
                {
                    SetError( ERRCODE_IO_BROKENPACKAGE, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_BROKENPACKAGE);
                    return false;
                }

@@ -662,7 +662,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
    {
        sal_uInt32 nError = HandleFilter( pMedium, this );
        if ( nError != ERRCODE_NONE )
            SetError( nError, OSL_LOG_PREFIX );
            SetError(nError);

        if (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARTPRESENTATION)
            pSet->Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, true) );
@@ -702,12 +702,12 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
                }

                if ( bWarnMediaTypeFallback || !xStorage->getElementNames().getLength() )
                    SetError( ERRCODE_IO_BROKENPACKAGE, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_BROKENPACKAGE);
            }
            catch( uno::Exception& )
            {
                // TODO/LATER: may need error code setting based on exception
                SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                SetError(ERRCODE_IO_GENERAL);
            }

            // Load
@@ -724,11 +724,11 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
                        bHasName = true;
                }
                else
                    SetError( ERRCODE_ABORT, OSL_LOG_PREFIX );
                    SetError(ERRCODE_ABORT);
            }
        }
        else
            SetError( pMed->GetLastStorageCreationState(), OSL_LOG_PREFIX );
            SetError(pMed->GetLastStorageCreationState());
    }
    else if ( GetError() == ERRCODE_NONE && InitNew(nullptr) )
    {
@@ -1010,7 +1010,7 @@ bool SfxObjectShell::DoSave()
                }
                catch( uno::Exception& )
                {
                    SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_GENERAL);
                }

                DBG_ASSERT( bOk, "The root storage must allow to set common password!\n" );
@@ -1050,7 +1050,7 @@ bool SfxObjectShell::DoSave()
                }
                catch( uno::Exception& )
                {
                    SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                    SetError(ERRCODE_IO_GENERAL);
                    bOk = false;
                }
            }
@@ -1100,8 +1100,6 @@ bool SfxObjectShell::SaveTo_Impl

    UpdateDocInfoForSave();

    AddLog( OSL_LOG_PREFIX "Begin" );

    ModifyBlocker_Impl aMod(this);

    std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
@@ -1123,7 +1121,7 @@ bool SfxObjectShell::SaveTo_Impl
    // protected libraries exceed the size we can handler
    if ( bOwnTarget && !QuerySaveSizeExceededModules_Impl( rMedium.GetInteractionHandler() ) )
    {
        SetError( ERRCODE_IO_ABORT, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_ABORT);
        return false;
    }

@@ -1140,8 +1138,6 @@ bool SfxObjectShell::SaveTo_Impl
        || pImpl->nScriptingSignatureState == SignatureState::NOTVALIDATED
        || pImpl->nScriptingSignatureState == SignatureState::INVALID ) )
    {
        AddLog( OSL_LOG_PREFIX "MacroSignaturePreserving" );

        // the checking of the library modified state iterates over the libraries, should be done only when required
        // currently the check is commented out since it is broken, we have to check the signature every time we save
        // TODO/LATER: let isAnyContainerModified() work!
@@ -1186,7 +1182,6 @@ bool SfxObjectShell::SaveTo_Impl
      && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
    {
        bStoreToSameLocation = true;
        AddLog( OSL_LOG_PREFIX "Save" );

        if ( pMedium->DocNeedsFileDateCheck() )
            rMedium.CheckFileDate( pMedium->GetInitFileDate( false ) );
@@ -1194,7 +1189,7 @@ bool SfxObjectShell::SaveTo_Impl
        if ( bCopyTo && GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
        {
            // export to the same location is forbidden
            SetError( ERRCODE_IO_CANTWRITE, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_CANTWRITE);
        }
        else
        {
@@ -1203,11 +1198,10 @@ bool SfxObjectShell::SaveTo_Impl
            const bool bDoBackup = SvtSaveOptions().IsBackup();
            if ( bDoBackup )
            {
                AddLog( OSL_LOG_PREFIX "DoBackup" );
                rMedium.DoBackup_Impl();
                if ( rMedium.GetError() )
                {
                    SetError( rMedium.GetErrorCode(), OSL_LOG_PREFIX );
                    SetError(rMedium.GetErrorCode());
                    rMedium.ResetError();
                }
            }
@@ -1231,8 +1225,6 @@ bool SfxObjectShell::SaveTo_Impl
                    // if the last step is failed the stream should stay to be transacted and should be committed on any flush
                    // so we can forget the stream in any way and the next storage commit will flush it

                AddLog( OSL_LOG_PREFIX "Save: Own to Own" );

                bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
                    *pMedium, rMedium );
                if ( bNeedsDisconnectionOnFail
@@ -1254,8 +1246,6 @@ bool SfxObjectShell::SaveTo_Impl
                // just disconnect the stream from the source format
                // so that the target medium can use it

                AddLog( OSL_LOG_PREFIX "Save: Alien to Alien" );

                pMedium->CloseAndRelease();
                rMedium.CloseAndRelease();
                rMedium.CreateTempFileNoCopy();
@@ -1267,8 +1257,6 @@ bool SfxObjectShell::SaveTo_Impl
                // format is an own one so just disconnect the source
                // medium

                AddLog( OSL_LOG_PREFIX "Save: Alien to Own" );

                pMedium->CloseAndRelease();
                rMedium.CloseAndRelease();
                rMedium.GetOutputStorage();
@@ -1279,8 +1267,6 @@ bool SfxObjectShell::SaveTo_Impl
                // an alien format, just connect the source to temporary
                // storage

                AddLog( OSL_LOG_PREFIX "Save: Own to Alien" );

                bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
                    *pMedium, rMedium );
                if ( bNeedsDisconnectionOnFail
@@ -1301,8 +1287,6 @@ bool SfxObjectShell::SaveTo_Impl
        // but for now the framework has to be ready for it
        // TODO/LATER: let the medium be prepared for alien formats as well

        AddLog( OSL_LOG_PREFIX "SaveAs/Export" );

        rMedium.CloseAndRelease();
        if ( bStorageBasedTarget )
        {
@@ -1317,8 +1301,6 @@ bool SfxObjectShell::SaveTo_Impl
        return false;
    }

    AddLog( OSL_LOG_PREFIX "Locking" );

    rMedium.LockOrigFileOnDemand( false, false );

    if ( bStorageBasedTarget )
@@ -1366,14 +1348,12 @@ bool SfxObjectShell::SaveTo_Impl
    // TODO/LATER: get rid of bOk
    if (bOwnTarget && pFilter && !(pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER))
    {
        AddLog( OSL_LOG_PREFIX "Storing in own format." );
        uno::Reference< embed::XStorage > xMedStorage = rMedium.GetStorage();
        if ( !xMedStorage.is() )
        {
            // no saving without storage, unlock UI and return
            Lock_Impl( this, false );
            pImpl->bForbidReload = bOldStat;
            AddLog( OSL_LOG_PREFIX "Storing failed, still no error set." );
            return false;
        }

@@ -1390,7 +1370,7 @@ bool SfxObjectShell::SaveTo_Impl
            catch( uno::Exception& )
            {
                SAL_WARN( "sfx.doc", "Setting of common encryption key failed!" );
                SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                SetError(ERRCODE_IO_GENERAL);
            }
        }
        else
@@ -1408,18 +1388,15 @@ bool SfxObjectShell::SaveTo_Impl
            if ( xMedStorage == GetStorage() )
            {
                OSL_ENSURE( !pVersionItem, "This scenario is impossible currently!\n" );
                AddLog( OSL_LOG_PREFIX "Should be impossible." );
                // usual save procedure
                bOk = Save();
            }
            else
            {
                // save to target
                AddLog( OSL_LOG_PREFIX "Save as own format." );
                bOk = SaveAsOwnFormat( rMedium );
                if ( bOk && pVersionItem )
                {
                    AddLog( OSL_LOG_PREFIX "pVersionItem != NULL" );
                    aTmpVersionURL = CreateTempCopyOfStorage_Impl( xMedStorage );
                    bOk =  !aTmpVersionURL.isEmpty();
                }
@@ -1432,7 +1409,6 @@ bool SfxObjectShell::SaveTo_Impl
        {
            // store the thumbnail representation image
            // the thumbnail is not stored in case of encrypted document
            AddLog( OSL_LOG_PREFIX "Thumbnail creation." );
            if ( !GenerateAndStoreThumbnail( bPasswdProvided,
                                            pFilter->IsOwnTemplateFormat(),
                                            xMedStorage ) )
@@ -1446,7 +1422,6 @@ bool SfxObjectShell::SaveTo_Impl
        {
            if ( pImpl->bIsSaving || pImpl->bPreserveVersions )
            {
                AddLog( OSL_LOG_PREFIX "Preserve versions." );
                try
                {
                    Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
@@ -1476,7 +1451,6 @@ bool SfxObjectShell::SaveTo_Impl
                }
                catch( uno::Exception& )
                {
                    AddLog( OSL_LOG_PREFIX "Preserve versions has failed." );
                    SAL_WARN( "sfx.doc", "Couldn't copy versions!" );
                    bOk = false;
                    // TODO/LATER: a specific error could be set
@@ -1527,7 +1501,6 @@ bool SfxObjectShell::SaveTo_Impl
    }
    else
    {
        AddLog( OSL_LOG_PREFIX "Storing in alien format." );
        // it's a "SaveAs" in an alien format
        if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
            bOk = ExportTo( rMedium );
@@ -1556,8 +1529,6 @@ bool SfxObjectShell::SaveTo_Impl
        uno::Reference< security::XDocumentDigitalSignatures > xDDSigns;
        if ( bOk && bTryToPreserveScriptSignature )
        {
            AddLog( OSL_LOG_PREFIX "Copying scripting signature." );

            // if the scripting code was not changed and it is signed the signature should be preserved
            // unfortunately at this point we have only information whether the basic code has changed or not
            // so the only way is to check the signature if the basic was not changed
@@ -1640,8 +1611,6 @@ bool SfxObjectShell::SaveTo_Impl
            rMedium.CloseZipStorage_Impl();
        }

        AddLog( OSL_LOG_PREFIX "Medium commit." );

        OUString sName( rMedium.GetName( ) );
        bOk = rMedium.Commit();
        OUString sNewName( rMedium.GetName( ) );
@@ -1651,8 +1620,6 @@ bool SfxObjectShell::SaveTo_Impl

        if ( bOk )
        {
            AddLog( OSL_LOG_PREFIX "Storing is successful." );

            // if the target medium is an alien format and the "old" medium was an own format and the "old" medium
            // has a name, the object storage must be exchanged, because now we need a new temporary storage
            // as object storage
@@ -1672,7 +1639,7 @@ bool SfxObjectShell::SaveTo_Impl
                    // copy storage of old medium to new temporary storage and take this over
                    if( !ConnectTmpStorage_Impl( pMedium->GetStorage(), pMedium ) )
                    {
                        AddLog( OSL_LOG_PREFIX "Process after storing has failed." );
                        SAL_WARN( "sfx.doc", "Process after storing has failed." );
                        bOk = false;
                    }
                }
@@ -1680,7 +1647,7 @@ bool SfxObjectShell::SaveTo_Impl
        }
        else
        {
            AddLog( OSL_LOG_PREFIX "Storing has failed." );
            SAL_WARN( "sfx.doc", "Storing has failed." );

            // in case the document storage was connected to backup temporarely it must be disconnected now
            if ( bNeedsDisconnectionOnFail )
@@ -1861,7 +1828,7 @@ bool SfxObjectShell::ConnectTmpStorage_Impl(
        if ( !bResult )
        {
            // TODO/LATER: may need error code setting based on exception
            SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
            SetError(ERRCODE_IO_GENERAL);
        }
    }
    else if (!GetMedium()->GetFilter()->IsOwnFormat())
@@ -1917,7 +1884,7 @@ bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium )
{
    // here only root storages are included, which are stored via temp file
    rMedium.CreateTempFileNoCopy();
    SetError(rMedium.GetErrorCode(), OSL_LOG_PREFIX );
    SetError(rMedium.GetErrorCode());
    if ( GetError() )
        return false;

@@ -1927,7 +1894,7 @@ bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium )

    bool bRet = SaveTo_Impl( rMedium, nullptr );
    if ( !bRet )
        SetError(rMedium.GetErrorCode(), OSL_LOG_PREFIX );
        SetError(rMedium.GetErrorCode());
    return bRet;
}

@@ -2281,7 +2248,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
        }
        catch (const packages::zip::ZipIOException&)
        {
            SetError( ERRCODE_IO_BROKENPACKAGE, "Badness in the underlying package format." );
            SetError(ERRCODE_IO_BROKENPACKAGE);
        }
        catch (const lang::WrappedTargetRuntimeException& rWrapped)
        {
@@ -2289,7 +2256,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
            if (rWrapped.TargetException >>= e)
            {
                SetError(*new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
                    e.Message, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ), "");
                    e.Message, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ));
            }
        }
        catch (const std::exception& e)
@@ -2297,7 +2264,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
            const char *msg = e.what();
            OUString sError(msg, strlen(msg), RTL_TEXTENCODING_ASCII_US);
            SetError(*new StringErrorInfo(ERRCODE_SFX_DOLOADFAILED,
                sError, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError), "");
                sError, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError));
        }
        catch (...)
        {
@@ -2513,7 +2480,7 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
    pMediumTmp->SetLongName( pRetrMedium->GetLongName() );
    if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE )
    {
        SetError( pMediumTmp->GetError(), OSL_LOG_PREFIX );
        SetError(pMediumTmp->GetError());
        delete pMediumTmp;
        return false;
    }
@@ -2539,7 +2506,7 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
            pMediumTmp->GetItemSet()->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
        }

        SetError(pMediumTmp->GetErrorCode(), OSL_LOG_PREFIX );
        SetError(pMediumTmp->GetErrorCode());

        bool bOpen( false );
        bOpen = DoSaveCompleted( pMediumTmp );
@@ -2550,7 +2517,7 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
    else
    {
        // transfer error code from medium to objectshell
        SetError( pMediumTmp->GetError(), OSL_LOG_PREFIX );
        SetError(pMediumTmp->GetError());

        // reconnect to object storage
        DoSaveCompleted();
@@ -2573,11 +2540,10 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
{
    if ( IsReadOnly() )
    {
        SetError( ERRCODE_SFX_DOCUMENTREADONLY, OSL_LOG_PREFIX );
        SetError(ERRCODE_SFX_DOCUMENTREADONLY);
        return false;
    }


    pImpl->bIsSaving = true;
    bool bSaved = false;
    const SfxStringItem* pSalvageItem = SfxItemSet::GetItem<SfxStringItem>(GetMedium()->GetItemSet(), SID_DOC_SALVAGE, false);
@@ -2611,7 +2577,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString
{
    if( aURL.HasError() )
    {
        SetError( ERRCODE_IO_INVALIDPARAMETER, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_INVALIDPARAMETER);
        return false;
    }

@@ -2633,7 +2599,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString
        if ( pDoc )
        {
            // Then error message: "already opened"
            SetError(ERRCODE_SFX_ALREADYOPEN, OSL_LOG_PREFIX);
            SetError(ERRCODE_SFX_ALREADYOPEN);
            return false;
        }
    }
@@ -2649,7 +2615,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString
        || !pFilter->CanExport()
        || (!bSaveTo && !pFilter->CanImport()) )
    {
        SetError( ERRCODE_IO_INVALIDPARAMETER, OSL_LOG_PREFIX );
        SetError(ERRCODE_IO_INVALIDPARAMETER);
        return false;
    }

@@ -2671,7 +2637,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString
    if ( aURL == aActName && aURL != INetURLObject( OUString("private:stream") )
        && IsReadOnly() )
    {
        SetError(ERRCODE_SFX_DOCUMENTREADONLY, OSL_LOG_PREFIX);
        SetError(ERRCODE_SFX_DOCUMENTREADONLY);
        return false;
    }

@@ -2792,7 +2758,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
    if ( pNewFile->GetErrorCode() != ERRCODE_NONE )
    {
        // creating temporary file failed ( f.e. floppy disk not inserted! )
        SetError( pNewFile->GetError(), OSL_LOG_PREFIX );
        SetError(pNewFile->GetError());
        delete pNewFile;
        return false;
    }
@@ -2813,7 +2779,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
    if ( !pNewFile->GetErrorCode() && SaveTo_Impl( *pNewFile, nullptr ) )
    {
        // transfer a possible error from the medium to the document
        SetError( pNewFile->GetErrorCode(), OSL_LOG_PREFIX );
        SetError(pNewFile->GetErrorCode());

        // notify the document that saving was done successfully
        if ( !bCopyTo )
@@ -2834,7 +2800,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
            //       and the DoSaveCompleted call should not be able to fail in general

            DBG_ASSERT( !bCopyTo, "Error while reconnecting to medium, can't be handled!");
            SetError( pNewFile->GetErrorCode(), OSL_LOG_PREFIX );
            SetError(pNewFile->GetErrorCode());

            if ( !bCopyTo )
            {
@@ -2853,7 +2819,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
    }
    else
    {
        SetError( pNewFile->GetErrorCode(), OSL_LOG_PREFIX );
        SetError(pNewFile->GetErrorCode());

        // reconnect to the old storage
        DoSaveCompleted();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 36b6be4..bd61032 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1470,7 +1470,6 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >

    if ( m_pData->m_pObjectShell.is() )
    {
        m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "storeSelf" );
        SfxSaveGuard aSaveGuard(this, m_pData);

        bool bCheckIn = false;
@@ -1484,9 +1483,6 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
              && aSeqArgs[nInd].Name != "FailOnWarning"
              && aSeqArgs[nInd].Name != "CheckIn" )
            {
                m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." );
                m_pData->m_pObjectShell->StoreLog();

                OUString aMessage( "Unexpected MediaDescriptor parameter: "  );
                aMessage += aSeqArgs[nInd].Name;
                throw lang::IllegalArgumentException( aMessage, Reference< XInterface >(), 1 );
@@ -1558,16 +1554,12 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >

        if ( bRet )
        {
            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "successful saving." );
            m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();

            SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocDone, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell.get() ) );
        }
        else
        {
            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Storing failed!" );
            m_pData->m_pObjectShell->StoreLog();

            // write the contents of the logger to the file
            SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocFailed, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );

@@ -1599,7 +1591,6 @@ void SAL_CALL SfxBaseModel::storeAsURL( const   OUString&                   rURL

    if ( m_pData->m_pObjectShell.is() )
    {
        m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "storeAsURL" );
        SfxSaveGuard aSaveGuard(this, m_pData);

        impl_store( rURL, rArgs, false );
@@ -1639,7 +1630,6 @@ void SAL_CALL SfxBaseModel::storeToURL( const   OUString&                   rURL

    if ( m_pData->m_pObjectShell.is() )
    {
        m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "storeToURL" );
        SfxSaveGuard aSaveGuard(this, m_pData);
        try {
            impl_store(rURL, rArgs, true);
@@ -2901,9 +2891,6 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL        
                            // TODO/LATER: need a new interaction for this case
                            if ( m_pData->m_pObjectShell->IsDocShared() )
                            {
                                m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Can't store shared document!" );
                                m_pData->m_pObjectShell->StoreLog();

                                uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault("EncryptionData", uno::Sequence< beans::NamedValue >() );
                                if ( !aNewEncryptionData.getLength() )
                                {
@@ -2946,9 +2933,6 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL        

        if ( pCopyStreamItem && pCopyStreamItem->GetValue() && !bSaveTo )
        {
            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" );
            m_pData->m_pObjectShell->StoreLog();

            throw frame::IllegalArgumentIOException(
                    "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!" );
        }
@@ -3005,7 +2989,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL        
        sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetErrorCode();
        if ( !bRet && !nErrCode )
        {
            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Storing has failed, no error is set!" );
            SAL_WARN("sfx.doc", "Storing has failed, no error is set!");
            nErrCode = ERRCODE_IO_CANTWRITE;
        }
        m_pData->m_pObjectShell->ResetError();
@@ -3026,7 +3010,6 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL        
                }
            }

            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Storing succeeded!" );
            if ( !bSaveTo )
            {
                m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
@@ -3044,10 +3027,6 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL        
        }
        else
        {
            // let the logring be stored to the related file
            m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "Storing failed!" );
            m_pData->m_pObjectShell->StoreLog();

            m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
            m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );

diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index a9348c1..ac2de9a 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -23,7 +23,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <tools/datetime.hxx>

#include <unotools/securityoptions.hxx>
@@ -128,8 +127,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess

    OUString            m_aSharedFileURL;

    css::uno::Reference< css::logging::XSimpleLogRing > m_xLogRing;

    bool                m_bIncomplEncrWarnShown;

    // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index fa04a49..f0a274c 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -748,7 +748,7 @@ bool SmDocShell::Load( SfxMedium& rMedium )
            SmXMLImportWrapper aEquation(xModel);
            sal_uLong nError = aEquation.Import(rMedium);
            bRet = 0 == nError;
            SetError( nError, OSL_LOG_PREFIX );
            SetError(nError);
        }
    }

diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 6e45da5..58af1d2 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -276,7 +276,7 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )

    SW_MOD()->SetEmbeddedLoadSave( false );

    SetError( nErr, OSL_LOG_PREFIX );
    SetError(nErr);
    bool bOk = !IsError( nErr );

    if (bOk && !m_pDoc->IsInLoadAsynchron())
@@ -366,7 +366,7 @@ bool SwDocShell::Save()
        }
        SW_MOD()->SetEmbeddedLoadSave( false );
    }
    SetError( nErr ? nErr : nVBWarning, OSL_LOG_PREFIX );
    SetError(nErr ? nErr : nVBWarning);

    SfxViewFrame *const pFrame =
        (m_pWrtShell) ? m_pWrtShell->GetView().GetViewFrame() : nullptr;
@@ -512,7 +512,7 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium )

        m_pDoc->cleanupUnoCursorTable();
    }
    SetError( nErr ? nErr : nVBWarning, OSL_LOG_PREFIX );
    SetError(nErr ? nErr : nVBWarning);

    return !IsError( nErr );
}
@@ -595,7 +595,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
                    Sequence<OUString> aModNames = xLib->getElementNames();
                    if(aModNames.getLength())
                    {
                        SetError(WARN_SWG_HTML_NO_MACROS, OSL_LOG_PREFIX );
                        SetError(WARN_SWG_HTML_NO_MACROS);
                        break;
                    }
                }
@@ -751,7 +751,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
    }

    SW_MOD()->SetEmbeddedLoadSave( false );
    SetError( nErrno ? nErrno : nVBWarning, OSL_LOG_PREFIX );
    SetError(nErrno ? nErrno : nVBWarning);
    if( !rMedium.IsStorage() )
        rMedium.CloseOutStream();

diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 9c4af8e..e403838 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -572,7 +572,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                    bMerge = bool(nFlags & SfxTemplateFlags::MERGE_STYLES);
                    aOpt.SetMerge( !bMerge );

                    SetError( LoadStylesFromFile( aFileName, aOpt, false ), OSL_LOG_PREFIX);
                    SetError(LoadStylesFromFile(aFileName, aOpt, false));
                    if ( !GetError() )
                        rReq.Done();
                }
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 9c66635..9589859 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -581,7 +581,7 @@ bool  SwDocShell::Load( SfxMedium& rMedium )
        UpdateFontList();
        InitDrawModelAndDocShell(this, m_pDoc ? m_pDoc->getIDocumentDrawModelAccess().GetDrawModel() : nullptr);

        SetError( nErr, OSL_LOG_PREFIX );
        SetError(nErr);
        bRet = !IsError( nErr );

        if (bRet && !m_pDoc->IsInLoadAsynchron() &&
@@ -630,7 +630,7 @@ bool  SwDocShell::LoadFrom( SfxMedium& rMedium )
            OSL_FAIL("Code removed!");
        }

        SetError( nErr, OSL_LOG_PREFIX );
        SetError(nErr);
        bRet = !IsError( nErr );

    } while( false );