From 814e1da4db65c3cf97e2b8dec246bf25c7f51189 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Fri, 26 Apr 2019 10:46:02 +0900 Subject: cleanup files in SOT, not change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie3a2390a40214e61b05a57ebd5fbfa5f49a5e1fd Reviewed-on: https://gerrit.libreoffice.org/71351 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/sot/storage.hxx | 184 +++++++++++++++++++++++++----------------------- 1 file changed, 95 insertions(+), 89 deletions(-) (limited to 'include/sot/storage.hxx') diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index cb1c0baa3938..bea06931d089 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -34,6 +34,7 @@ namespace com { namespace sun { namespace star { namespace uno { template encryption - sal_Int32 m_nVersion; + BaseStorage* m_pOwnStg; // target storage + SvStream* m_pStorStm; // only for SDSTORAGES + ErrCode m_nError; + OUString m_aName;// name of the storage + bool m_bIsRoot; // e.g.: File Storage + bool m_bDelStm; + OString m_aKey; // aKey.Len != 0 -> encryption + sal_Int32 m_nVersion; protected: - virtual ~SotStorage() override; - void CreateStorage( bool bUCBStorage, StreamMode ); + virtual ~SotStorage() override; + void CreateStorage(bool bUCBStorage, StreamMode); public: - SotStorage( const OUString &, - StreamMode = StreamMode::STD_READWRITE ); - SotStorage( bool bUCBStorage, const OUString &, - StreamMode = StreamMode::STD_READWRITE ); - SotStorage( BaseStorage * ); - SotStorage( SvStream & rStm ); - SotStorage( bool bUCBStorage, SvStream & rStm ); - SotStorage( SvStream * pStm, bool bDelete ); + SotStorage(OUString const & rString, StreamMode eMode = StreamMode::STD_READWRITE); + SotStorage(bool bUCBStorage, const OUString & rString, + StreamMode = StreamMode::STD_READWRITE); + SotStorage(BaseStorage * pStorage); + SotStorage(SvStream & rStream); + SotStorage(bool bUCBStorage, SvStream & rStream); + SotStorage(SvStream * rStream, bool bDelete); std::unique_ptr CreateMemoryStream(); - static bool IsStorageFile( const OUString & rFileName ); - static bool IsStorageFile( SvStream* pStream ); + static bool IsStorageFile(OUString const & rFileName); + static bool IsStorageFile(SvStream* pStream); - const OUString& GetName() const; + const OUString& GetName() const; - bool Validate(); + bool Validate(); - const OString& GetKey() const { return m_aKey;} + const OString& GetKey() const { return m_aKey;} - void SetVersion( sal_Int32 nVers ) - { - m_nVersion = nVers; - } - sal_Int32 GetVersion() const - { - return m_nVersion; - } + void SetVersion(sal_Int32 nVersion) + { + m_nVersion = nVersion; + } + sal_Int32 GetVersion() const + { + return m_nVersion; + } - ErrCode GetError() const { return m_nError.IgnoreWarning(); } - void SetError( ErrCode nErrorCode ) - { - if( m_nError == ERRCODE_NONE ) - m_nError = nErrorCode; - } + ErrCode GetError() const + { + return m_nError.IgnoreWarning(); + } + void SetError(ErrCode nErrorCode) + { + if (m_nError == ERRCODE_NONE) + m_nError = nErrorCode; + } - void SignAsRoot( bool b ) { m_bIsRoot = b; } + void SignAsRoot(bool bRoot) { m_bIsRoot = bRoot; } // own data sector - void SetClass( const SvGlobalName & rClass, - SotClipboardFormatId bOriginalClipFormat, - const OUString & rUserTypeName ); - SvGlobalName GetClassName(); // type of data in the storage + void SetClass(const SvGlobalName & rClass, + SotClipboardFormatId bOriginalClipFormat, + const OUString & rUserTypeName); + + SvGlobalName GetClassName(); // type of data in the storage SotClipboardFormatId GetFormat(); - OUString GetUserName(); - - // list of all elements - void FillInfoList( SvStorageInfoList * ) const; - bool CopyTo( SotStorage * pDestStg ); - bool Commit(); - - // create stream with connection to Storage, - // more or less a Parent-Child relationship - SotStorageStream * OpenSotStream( const OUString & rEleName, - StreamMode = StreamMode::STD_READWRITE ); - SotStorage * OpenSotStorage( const OUString & rEleName, - StreamMode = StreamMode::STD_READWRITE, - bool transacted = true ); - // query whether Storage or Stream - bool IsStream( const OUString & rEleName ) const; - bool IsStorage( const OUString & rEleName ) const; - bool IsContained( const OUString & rEleName ) const; - // remove element - bool Remove( const OUString & rEleName ); - bool CopyTo( const OUString & rEleName, SotStorage * pDest, - const OUString & rNewName ); - - bool IsOLEStorage() const; - static bool IsOLEStorage( const OUString & rFileName ); - static bool IsOLEStorage( SvStream* pStream ); - - static SotStorage* OpenOLEStorage( const css::uno::Reference < css::embed::XStorage >& xStorage, - const OUString& rEleName, StreamMode = StreamMode::STD_READWRITE ); - static SotClipboardFormatId GetFormatID( const css::uno::Reference < css::embed::XStorage >& xStorage ); - static sal_Int32 GetVersion( const css::uno::Reference < css::embed::XStorage >& xStorage ); + OUString GetUserName(); + + // list of all elements + void FillInfoList(SvStorageInfoList *) const; + bool CopyTo(SotStorage * pDestStg); + bool Commit(); + + // create stream with connection to Storage, + // more or less a Parent-Child relationship + SotStorageStream* OpenSotStream(const OUString & rEleName, + StreamMode = StreamMode::STD_READWRITE); + SotStorage* OpenSotStorage(const OUString & rEleName, + StreamMode = StreamMode::STD_READWRITE, + bool transacted = true); + + // query whether Storage or Stream + bool IsStream( const OUString & rEleName ) const; + bool IsStorage( const OUString & rEleName ) const; + bool IsContained( const OUString & rEleName ) const; + // remove element + bool Remove(const OUString & rEleName); + bool CopyTo(const OUString & rEleName, SotStorage* pDest, + const OUString & rNewName); + + bool IsOLEStorage() const; + static bool IsOLEStorage(const OUString & rFileName); + static bool IsOLEStorage(SvStream* pStream); + + static SotStorage* OpenOLEStorage(css::uno::Reference const & xStorage, + OUString const & rEleName, StreamMode = StreamMode::STD_READWRITE); + static SotClipboardFormatId GetFormatID(css::uno::Reference const & xStorage); + static sal_Int32 GetVersion(css::uno::Reference const & xStorage); }; -#endif // _SVSTOR_HXX +#endif // INCLUDED_SOT_STORAGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit