summaryrefslogtreecommitdiff
path: root/include/sot
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-26 10:46:02 +0900
committerTomaž Vajngerl <quikee@gmail.com>2019-04-26 17:12:08 +0200
commit814e1da4db65c3cf97e2b8dec246bf25c7f51189 (patch)
treeee40b9565f9d392a41f49789ffa0687e4189e583 /include/sot
parent615202cab983f1f13407f6515aeb047e4e09f6ed (diff)
cleanup files in SOT, not change
Change-Id: Ie3a2390a40214e61b05a57ebd5fbfa5f49a5e1fd Reviewed-on: https://gerrit.libreoffice.org/71351 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/sot')
-rw-r--r--include/sot/filelist.hxx13
-rw-r--r--include/sot/formats.hxx6
-rw-r--r--include/sot/object.hxx22
-rw-r--r--include/sot/storage.hxx184
4 files changed, 114 insertions, 111 deletions
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 <rtl/ustring.hxx>
#include <vector>
+
class SvStream;
class SOT_DLLPUBLIC FileList
{
- std::vector< OUString > aStrList;
+ std::vector<OUString> 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<SotClipboardFormatId>(static_cast<sal_uInt32>(v) + 1);
- return v;
+ eFormat = static_cast<SotClipboardFormatId>(static_cast<sal_uInt32>(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 <typen
enum class SotClipboardFormatId : sal_uInt32;
class BaseStorageStream;
+
class SOT_DLLPUBLIC SotStorageStream : virtual public SotObject, public SvStream
{
friend class SotStorage;
@@ -41,22 +42,23 @@ friend class SotStorage;
protected:
virtual std::size_t GetData(void* pData, std::size_t nSize) override;
virtual std::size_t PutData(const void* pData, std::size_t nSize) override;
- virtual sal_uInt64 SeekPos(sal_uInt64 nPos) override;
- virtual void FlushData() override;
- virtual ~SotStorageStream() override;
+ virtual sal_uInt64 SeekPos(sal_uInt64 nPos) override;
+ virtual void FlushData() override;
+
+ virtual ~SotStorageStream() override;
public:
- SotStorageStream( const OUString &,
- StreamMode = StreamMode::STD_READWRITE );
- SotStorageStream( BaseStorageStream *pStm );
-
- virtual void ResetError() override;
-
- virtual void SetSize( sal_uInt64 nNewSize ) override;
- sal_uInt32 GetSize() const;
- void CopyTo( SotStorageStream * pDestStm );
- bool Commit();
- bool SetProperty( const OUString& rName, const css::uno::Any& rValue );
- virtual sal_uInt64 TellEnd() override;
+ SotStorageStream(OUString const & rString,
+ StreamMode = StreamMode::STD_READWRITE);
+ SotStorageStream(BaseStorageStream *pBaseStream);
+
+ virtual void ResetError() override;
+
+ virtual void SetSize(sal_uInt64 nNewSize) override;
+ sal_uInt32 GetSize() const;
+ void CopyTo(SotStorageStream * pDestStm);
+ bool Commit();
+ bool SetProperty(OUString const & rName, css::uno::Any const & rValue);
+ virtual sal_uInt64 TellEnd() override;
};
class BaseStorage;
@@ -64,96 +66,100 @@ class SOT_DLLPUBLIC SotStorage : virtual public SotObject
{
friend class SotStorageStream;
- 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;
+ 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<SvMemoryStream> 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<css::embed::XStorage> const & xStorage,
+ OUString const & rEleName, StreamMode = StreamMode::STD_READWRITE);
+ static SotClipboardFormatId GetFormatID(css::uno::Reference<css::embed::XStorage> const & xStorage);
+ static sal_Int32 GetVersion(css::uno::Reference<css::embed::XStorage> const & xStorage);
};
-#endif // _SVSTOR_HXX
+#endif // INCLUDED_SOT_STORAGE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */