Kaydet (Commit) 15678e74 authored tarafından Matúš Kukan's avatar Matúš Kukan

ZipPackageFolder: releaseUpwardRef only calls clearParent, remove it.

Since commit 0c5bb3f4.

Change-Id: I5511f9dc829aca42790f05cb8fb3ebd83b2acad4
üst ad91cfdc
......@@ -82,7 +82,6 @@ public:
const com::sun::star::uno::Sequence< sal_Int8 > &rEncryptionKey,
const rtlRandomPool & rRandomPool) const
throw(::com::sun::star::uno::RuntimeException);
void releaseUpwardRef();
// XNameContainer
virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
......
......@@ -50,7 +50,7 @@ public:
virtual ~ContentInfo ()
{
if ( bFolder )
pFolder->releaseUpwardRef();
pFolder->clearParent();
else
pStream->clearParent();
}
......
......@@ -392,35 +392,6 @@ void ZipPackageFolder::saveContents(
throw uno::RuntimeException(THROW_WHERE );
}
void ZipPackageFolder::releaseUpwardRef( void )
{
// Now it is possible that a package folder is disconnected from the package before removing of the folder.
// Such a scenario is used in storage implementation. When a new version of a folder is provided the old
// one is retrieved, removed from the package but preserved for the error handling.
// In this scenario the referencing to the parent is not really useful, since it requires disposing.
// Actually there is no need in having a reference to the parent, it even make things more complicated and
// requires disposing mechanics. Using of a simple pointer seems to be easier solution and also a safe enough.
clearParent();
#if 0
for ( ContentHash::const_iterator aCI = maContents.begin();
aCI!=maContents.end();
aCI++)
{
ContentInfo &rInfo = * (*aCI).second;
if ( rInfo.bFolder )// && ! rInfo.pFolder->HasReleased () )
rInfo.pFolder->releaseUpwardRef();
else //if ( !rInfo.bFolder && !rInfo.pStream->HasReleased() )
rInfo.pStream->clearParent();
}
clearParent();
OSL_ENSURE ( m_refCount == 1, "Ref-count is not 1!" );
#endif
}
sal_Int64 SAL_CALL ZipPackageFolder::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
throw(uno::RuntimeException, std::exception)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment