summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 15:39:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-15 08:33:37 +0200
commitb3204c541ee422923f069b869b2f08cd02f8f6a7 (patch)
tree7c6ed4244619c93176eb610d1502d245dc8318c0 /sot
parentdfd5510a7a94885d6e678dd401528fdf656fbf73 (diff)
convert RepresentModes to scoped enum
and drop unused xinputstream enumerator Change-Id: I7c608a4a80b0aec29140dd481cdafd646ad7a05f
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/ucbstorage.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 8f3e27a6f4fb..aa1302df3640 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -393,10 +393,9 @@ SvGlobalName GetClassId_Impl( SotClipboardFormatId nFormat )
// All storage and streams are refcounted internally; outside of this classes they are only accessible through a handle
// class, that uses the refcounted object as impl-class.
-enum RepresentModes {
- nonset,
- svstream,
- xinputstream
+enum class RepresentMode {
+ NONE,
+ svstream
};
class UCBStorageStream_Impl : public SvRefBase, public SvStream
@@ -424,7 +423,7 @@ public:
SvStream* m_pStream; // the stream worked on; for readonly streams it is the original stream of the content
// for read/write streams it's a copy into a temporary file
OUString m_aTempURL; // URL of this temporary stream
- RepresentModes m_nRepresentMode; // should it be used as XInputStream or as SvStream
+ RepresentMode m_nRepresentMode; // should it be used as XInputStream or as SvStream
ErrCode m_nError;
StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing )
bool m_bSourceRead; // Source still contains useful information
@@ -638,7 +637,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const OUString& rName, StreamMode
, m_aURL( rName )
, m_pContent( nullptr )
, m_pStream( nullptr )
- , m_nRepresentMode( nonset )
+ , m_nRepresentMode( RepresentMode::NONE )
, m_nError( 0 )
, m_nMode( nMode )
, m_bSourceRead( !( nMode & StreamMode::TRUNC ) )
@@ -693,19 +692,12 @@ UCBStorageStream_Impl::~UCBStorageStream_Impl()
bool UCBStorageStream_Impl::Init()
{
- if( m_nRepresentMode == xinputstream )
- {
- OSL_FAIL( "XInputStream misuse!" );
- SetError( ERRCODE_IO_ACCESSDENIED );
- return false;
- }
-
if( !m_pStream )
{
// no temporary stream was created
// create one
- m_nRepresentMode = svstream; // can not be used as XInputStream
+ m_nRepresentMode = RepresentMode::svstream; // can not be used as XInputStream
if ( m_aTempURL.isEmpty() )
m_aTempURL = ::utl::TempFile().GetURL();
@@ -1196,7 +1188,7 @@ void UCBStorageStream_Impl::Free()
}
#endif
- m_nRepresentMode = nonset;
+ m_nRepresentMode = RepresentMode::NONE;
m_rSource.clear();
DELETEZ( m_pStream );
}