diff options
Diffstat (limited to 'sot')
-rw-r--r-- | sot/inc/sot/object.hxx | 3 | ||||
-rw-r--r-- | sot/inc/sot/storage.hxx | 12 | ||||
-rw-r--r-- | sot/source/base/object.cxx | 25 | ||||
-rw-r--r-- | sot/source/sdstor/storage.cxx | 109 |
4 files changed, 4 insertions, 145 deletions
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx index 0424b0d81fa4..81d3d3739dee 100644 --- a/sot/inc/sot/object.hxx +++ b/sot/inc/sot/object.hxx @@ -269,7 +269,6 @@ class SOT_DLLPUBLIC SotObject : virtual public SvRefBase { friend class SotFactory; friend class SvObject; - sal_uInt16 nStrongLockCount; sal_uInt16 nOwnerLockCount; sal_Bool bOwner:1, bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist @@ -290,9 +289,7 @@ public: void* CastAndAddRef( const SotFactory * pFact ); - sal_uInt16 Lock( sal_Bool bLock ); // affects nStrongLockCount sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } - sal_uInt16 GetStrongLockCount() const { return nStrongLockCount; } void OwnerLock( sal_Bool bLock ); sal_Bool DoClose(); diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 012799069fea..3a01028df107 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -75,9 +75,6 @@ public: virtual sal_Bool Commit(); virtual sal_Bool Revert(); sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > - GetXInputStream() const; virtual sal_Size remainingSize(); }; @@ -127,7 +124,6 @@ public: SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA()) SvMemoryStream * CreateMemoryStream(); - const SvStream * GetSvStream(); static sal_Bool IsStorageFile( const String & rFileName ); static sal_Bool IsStorageFile( SvStream* pStream ); @@ -136,8 +132,7 @@ public: virtual sal_Bool Validate(); - void SetKey( const rtl::OString& rKey ); - const rtl::OString& GetKey() const { return m_aKey; } + const rtl::OString& GetKey() const; void SetVersion( long nVers ) { @@ -172,7 +167,6 @@ public: virtual sal_uLong GetFormat(); virtual String GetUserName(); virtual sal_Bool ShouldConvert(); - void SetName( const String& rName ); // Liste aller Elemente virtual void FillInfoList( SvStorageInfoList * ) const; @@ -189,9 +183,6 @@ public: SotStorage * OpenSotStorage( const String & rEleName, StreamMode = STREAM_STD_READWRITE, StorageMode = STORAGE_TRANSACTED ); - SotStorage * OpenUCBStorage( const String & rEleName, - StreamMode = STREAM_STD_READWRITE, - StorageMode = STORAGE_TRANSACTED ); // Abfrage auf Storage oder Stream virtual sal_Bool IsStream( const String & rEleName ) const; virtual sal_Bool IsStorage( const String & rEleName ) const; @@ -207,7 +198,6 @@ public: const String & rNewName ); sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); - sal_Bool GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ); sal_Bool IsOLEStorage() const; static sal_Bool IsOLEStorage( const String & rFileName ); static sal_Bool IsOLEStorage( SvStream* pStream ); diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index 3264015d21f6..3bf6d92bda14 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -44,8 +44,7 @@ SO2_IMPL_BASIC_CLASS_DLL(SotObject,SotObjectFactory, |* Beschreibung *************************************************************************/ SotObject::SotObject() - : nStrongLockCount( 0 ) - , nOwnerLockCount( 0 ) + : nOwnerLockCount( 0 ) , bOwner ( sal_True ) , bSVObject ( sal_False ) , bInClose ( sal_False ) @@ -87,28 +86,6 @@ void* SotObject::CastAndAddRef( const SotFactory * pFact ) } //========================================================================= -sal_uInt16 SotObject::Lock( sal_Bool bLock ) -{ - SotObjectRef xHoldAlive( this ); - sal_uInt16 nRet; - if( bLock ) - { - AddRef(); - nRet = ++nStrongLockCount; - } - else - { - nRet = --nStrongLockCount; - ReleaseRef(); - } - - if( !nRet && !nOwnerLockCount ) - DoClose(); - - return nRet; -} - -//========================================================================= void SotObject::OwnerLock ( sal_Bool bLock /* sal_True, lock. sal_False, unlock. */ diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index bc0ab823386b..5fd1efa0b8b0 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -360,36 +360,6 @@ sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::s } } -sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) -{ - UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); - if ( pStg ) - { - return pStg->GetProperty( rName, rValue ); - } - else - { - OSL_FAIL("Not implemented!"); - return sal_False; - } -} - -::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SotStorageStream::GetXInputStream() const -{ - UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm ); - if ( pStg ) - { - return pStg->GetXInputStream(); - } - else - { - OSL_FAIL("Not implemented!"); - return ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >(); - } -} - - - /************** class SotStorage ****************************************** *************************************************************************/ class SotStorageFactory : public SotFactory @@ -732,13 +702,9 @@ const String & SotStorage::GetName() const return m_aName; } -void SotStorage::SetName( const String& rName ) +const rtl::OString& SotStorage::GetKey() const { - // This method is necessary because most storages will not be opened with a FileName, but an external stream instead - // This stream is a stream opened by a UCP and so aName is only used as a transport for all client code of the SotStorage - // class that depends on the fact that a root storage has a name - DBG_ASSERT( !GetName().Len(), "SetName() must not be called when the storage already has a name!" ); - m_aName = rName; + return m_aKey; } /************************************************************************* @@ -960,27 +926,6 @@ SotStorage * SotStorage::OpenSotStorage( const String & rEleName, return NULL; } -SotStorage * SotStorage::OpenUCBStorage( const String & rEleName, - StreamMode nMode, - StorageMode nStorageMode ) -{ - SotStorage * pStor = NULL; - DBG_ASSERT( Owner(), "must be owner" ); - if( m_pOwnStg ) - { - nMode |= STREAM_SHARE_DENYALL; - ErrCode nE = m_pOwnStg->GetError(); - BaseStorage * p = m_pOwnStg->OpenUCBStorage( rEleName, nMode, - (nStorageMode & STORAGE_TRANSACTED) ? sal_False : sal_True ); - pStor = new SotStorage( p ); - if( !nE ) - m_pOwnStg->ResetError(); // kein Fehler setzen - } - else - SetError( SVSTREAM_GENERALERROR ); - return pStor; -} - /************************************************************************* |* SotStorage::IsStream() |* SotStorage::IsStorage() @@ -1093,15 +1038,6 @@ sal_Bool SotStorage::MoveTo( const String & rEleName, return SVSTREAM_OK == GetError(); } -const SvStream* SotStorage::GetSvStream() -{ - const SvStream* pResult = 0; - DBG_ASSERT( Owner(), "must be owner" ); - if( m_pOwnStg ) - pResult = m_pOwnStg->GetSvStream(); - return pResult; -} - sal_Bool SotStorage::Validate() { DBG_ASSERT( m_bIsRoot, "Validate nur an Rootstorage" ); @@ -1125,29 +1061,6 @@ sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::u } } -sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue ) -{ - UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); - if ( pStg ) - { - return pStg->GetProperty( rName, rValue ); - } - else if ( rName.CompareToAscii("MediaType") == COMPARE_EQUAL ) - { - String aStr = SotExchange::GetFormatMimeType( GetFormat() ); - sal_uInt16 nPos = aStr.Search(';'); - if ( nPos != STRING_NOTFOUND ) - aStr = aStr.Copy( 0, nPos ); - rValue <<= (::rtl::OUString) aStr; - return sal_True; - } - else - { - DBG_WARNING("W1:Not implemented!"); - return sal_False; - } -} - sal_Bool SotStorage::IsOLEStorage() const { UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg ); @@ -1164,24 +1077,6 @@ sal_Bool SotStorage::IsOLEStorage( SvStream* pStream ) return Storage::IsStorageFile( pStream ); } -void SotStorage::SetKey( const rtl::OString& rKey ) -{ - m_aKey = rKey; - if ( !IsOLEStorage() ) - { - sal_uInt8 aBuffer[RTL_DIGEST_LENGTH_SHA1]; - rtlDigestError nError = rtl_digest_SHA1( m_aKey.getStr(), m_aKey.getLength(), aBuffer, RTL_DIGEST_LENGTH_SHA1 ); - if ( nError == rtl_Digest_E_None ) - { - sal_uInt8* pBuffer = aBuffer; - ::com::sun::star::uno::Sequence < sal_Int8 > aSequ( (sal_Int8*) pBuffer, RTL_DIGEST_LENGTH_SHA1 ); - ::com::sun::star::uno::Any aAny; - aAny <<= aSequ; - SetProperty( ::rtl::OUString("EncryptionKey"), aAny ); - } - } -} - SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage, const String& rEleName, StreamMode nMode ) { |