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/filelist.hxx | 13 ++-- include/sot/formats.hxx | 6 +- include/sot/object.hxx | 22 +++--- include/sot/storage.hxx | 184 ++++++++++++++++++++++++----------------------- 4 files changed, 114 insertions(+), 111 deletions(-) (limited to 'include/sot') diff --git a/include/sot/filelist.hxx b/include/sot/filelist.hxx index f853fa4757d7..b94eb84d7e9c 100644 --- a/include/sot/filelist.hxx +++ b/include/sot/filelist.hxx @@ -24,27 +24,24 @@ #include #include + class SvStream; class SOT_DLLPUBLIC FileList { - std::vector< OUString > aStrList; + std::vector aStrList; private: - - // delete list void clear() { aStrList.clear(); } public: - - // import/export + // import / export SOT_DLLPUBLIC friend SvStream& ReadFileList( SvStream& rIStm, FileList& rFileList ); // fill in / interrogate list - void AppendFile( const OUString& rStr ); - OUString GetFile( size_t i ) const; + void AppendFile(const OUString& rStr); + OUString GetFile(size_t nIndex) const; size_t Count() const; - }; #endif // INCLUDED_SOT_FILELIST_HXX diff --git a/include/sot/formats.hxx b/include/sot/formats.hxx index 202c03bbe280..12727ffb34c9 100644 --- a/include/sot/formats.hxx +++ b/include/sot/formats.hxx @@ -180,10 +180,10 @@ enum class SotClipboardFormatId : sal_uInt32 }; /** Make it easier to iterate over format IDs */ -inline SotClipboardFormatId& operator++(SotClipboardFormatId& v) +inline SotClipboardFormatId& operator++(SotClipboardFormatId& eFormat) { - v = static_cast(static_cast(v) + 1); - return v; + eFormat = static_cast(static_cast(eFormat) + 1); + return eFormat; } #define SOT_FORMAT_SYSTEM_START SotClipboardFormatId::NONE diff --git a/include/sot/object.hxx b/include/sot/object.hxx index 9680eaba48a9..8b1d7e3d8968 100644 --- a/include/sot/object.hxx +++ b/include/sot/object.hxx @@ -27,25 +27,25 @@ class SOT_DLLPUBLIC SotObject : virtual public SvRefBase { - sal_uInt16 nOwnerLockCount; - bool bInClose; // TRUE, in DoClose + sal_uInt16 nOwnerLockCount; + bool bInClose; // TRUE, in DoClose protected: - virtual ~SotObject() override; - virtual bool Close(); + virtual ~SotObject() override; + virtual bool Close(); public: - SotObject(); + SotObject(); - sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } + sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; } - void OwnerLock( bool bLock ); - bool DoClose(); - bool IsInClose() const { return bInClose; } + void OwnerLock(bool bLock); + bool DoClose(); + bool IsInClose() const { return bInClose; } private: - SotObject & operator = ( const SotObject & ) = delete; - SotObject( const SotObject & ) = delete; + SotObject & operator= (const SotObject &) = delete; + SotObject(const SotObject &) = delete; }; #endif 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