diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-27 10:18:06 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-27 12:06:15 +0000 |
commit | 33b38082ca63813f7c478945be198cc504efde4b (patch) | |
tree | 030eb240e231d855e477d985c3edc36304dd2914 /include | |
parent | 81a7aeb0806298c7a8571a46e09f485f3cf5ea13 (diff) |
put StreamMode masks in scope of enum class
Change-Id: I77682f7e289a59b986bb84edf014029a20266470
Reviewed-on: https://gerrit.libreoffice.org/28420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sot/stg.hxx | 26 | ||||
-rw-r--r-- | include/sot/storage.hxx | 12 | ||||
-rw-r--r-- | include/tools/stream.hxx | 13 |
3 files changed, 25 insertions, 26 deletions
diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx index ada5c7e75319..2654fd7a74ca 100644 --- a/include/sot/stg.hxx +++ b/include/sot/stg.hxx @@ -100,16 +100,16 @@ public: virtual bool Commit() = 0; virtual bool Revert() = 0; virtual BaseStorageStream* OpenStream( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = true, const OString* pKey=nullptr ) = 0; virtual BaseStorage* OpenStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) = 0; virtual BaseStorage* OpenUCBStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) = 0; virtual BaseStorage* OpenOLEStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) = 0; virtual bool IsStream( const OUString& rEleName ) const = 0; virtual bool IsStorage( const OUString& rEleName ) const = 0; @@ -165,7 +165,7 @@ class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase protected: virtual ~Storage(); public: - Storage( const OUString &, StreamMode = STREAM_STD_READWRITE, bool bDirect = true ); + Storage( const OUString &, StreamMode = StreamMode::STD_READWRITE, bool bDirect = true ); Storage( SvStream& rStrm, bool bDirect = true ); Storage( UCBStorageStream& rStrm, bool bDirect = true ); @@ -188,16 +188,16 @@ public: virtual bool Commit() final override; virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = true, const OString* pKey=nullptr ) override; virtual BaseStorage* OpenStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual BaseStorage* OpenUCBStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual BaseStorage* OpenOLEStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual bool IsStream( const OUString& rEleName ) const override; virtual bool IsStorage( const OUString& rEleName ) const override; @@ -291,16 +291,16 @@ public: virtual bool Commit() final override; virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = true, const OString* pKey=nullptr ) override; virtual BaseStorage* OpenStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual BaseStorage* OpenUCBStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual BaseStorage* OpenOLEStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; virtual bool IsStream( const OUString& rEleName ) const override; virtual bool IsStorage( const OUString& rEleName ) const override; diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index 25f0a39ac755..d2e56c6caf0e 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -45,7 +45,7 @@ protected: virtual ~SotStorageStream(); public: SotStorageStream( const OUString &, - StreamMode = STREAM_STD_READWRITE ); + StreamMode = StreamMode::STD_READWRITE ); SotStorageStream( BaseStorageStream *pStm ); virtual void ResetError() override; @@ -77,9 +77,9 @@ protected: void CreateStorage( bool bUCBStorage, StreamMode ); public: SotStorage( const OUString &, - StreamMode = STREAM_STD_READWRITE ); + StreamMode = StreamMode::STD_READWRITE ); SotStorage( bool bUCBStorage, const OUString &, - StreamMode = STREAM_STD_READWRITE ); + StreamMode = StreamMode::STD_READWRITE ); SotStorage( BaseStorage * ); SotStorage( SvStream & rStm ); SotStorage( bool bUCBStorage, SvStream & rStm ); @@ -130,9 +130,9 @@ public: // create stream with connection to Storage, // more or less a Parent-Child relationship SotStorageStream * OpenSotStream( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE ); + StreamMode = StreamMode::STD_READWRITE ); SotStorage * OpenSotStorage( const OUString & rEleName, - StreamMode = STREAM_STD_READWRITE, + StreamMode = StreamMode::STD_READWRITE, bool transacted = true ); // query whether Storage or Stream bool IsStream( const OUString & rEleName ) const; @@ -148,7 +148,7 @@ public: static bool IsOLEStorage( SvStream* pStream ); static SotStorage* OpenOLEStorage( const css::uno::Reference < css::embed::XStorage >& xStorage, - const OUString& rEleName, StreamMode = STREAM_STD_READWRITE ); + 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 ); }; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 7d5726a7e986..19d756b7431d 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -54,19 +54,18 @@ enum class StreamMode { SHARE_DENYREAD = 0x0200, // overrides denynone SHARE_DENYWRITE = 0x0400, // overrides denynone SHARE_DENYALL = 0x0800, // overrides denyread,write,none +// masks + READWRITE = READ | WRITE, + SHARE_DENYREADWRITE = SHARE_DENYREAD | SHARE_DENYWRITE, + STD_READ = READ | SHARE_DENYNONE | NOCREATE, + STD_WRITE = WRITE | SHARE_DENYALL, + STD_READWRITE = READWRITE | SHARE_DENYALL }; namespace o3tl { template<> struct typed_flags<StreamMode> : is_typed_flags<StreamMode, 0x0f1f> {}; } -#define STREAM_READWRITE (StreamMode::READ | StreamMode::WRITE) -#define STREAM_SHARE_DENYREADWRITE (StreamMode::SHARE_DENYREAD | StreamMode::SHARE_DENYWRITE) - -#define STREAM_STD_READ (StreamMode::READ | StreamMode::SHARE_DENYNONE | StreamMode::NOCREATE) -#define STREAM_STD_WRITE (StreamMode::WRITE | StreamMode::SHARE_DENYALL) -#define STREAM_STD_READWRITE (STREAM_READWRITE | StreamMode::SHARE_DENYALL) - #define STREAM_SEEK_TO_BEGIN 0L #define STREAM_SEEK_TO_END SAL_MAX_UINT64 |