diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-07 09:28:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-07 11:20:44 +0200 |
commit | 7f8f277b94704a289fbbd1b836e4e5d66311580d (patch) | |
tree | 2400b7306a0a2a3ea63aee2e5bfc336b52102635 /sfx2 | |
parent | 8db77209e0755d21d9efc34f70a2978d1df5d2c6 (diff) |
fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/xpackcreator.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/openflag.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 8 |
13 files changed, 26 insertions, 26 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 742d84195511..b76bbb45e8da 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -291,7 +291,7 @@ sal_uInt32 CheckPasswd_Impl sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString &rFileName, bool bCopy, SfxItemSet* pSet ) { const SfxFilter* pFilter = NULL; - SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ) ); + SfxMedium aMedium( rFileName, ( StreamMode::READ | StreamMode::SHARE_DENYNONE ) ); if ( !aMedium.GetStorage( false ).is() ) aMedium.GetInStream(); diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index c14f0e1b53a6..6b8a19d09176 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -524,7 +524,7 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType, if( rValue.hasValue() && ( rValue >>= aSeq ) ) { SvMemoryStream aMemStm( (void*)aSeq.getConstArray(), aSeq.getLength(), - STREAM_READ ); + StreamMode::READ ); aMemStm.Seek( 0 ); switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) ) diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index e781f53bc089..075899772f7f 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -128,7 +128,7 @@ short SvxOpenGraphicDialog::Execute() // non-local? if ( INET_PROT_FILE != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); aMed.Download(); SvStream* pStream = aMed.GetInStream(); diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 0274e5c09cbb..124641dec40c 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -76,7 +76,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde { UCBStorage* pUCBStorage = new UCBStorage( aContent, aFolderUrl, - STREAM_READ, + StreamMode::READ, false, true ); SotStorageRef aStorage = new SotStorage( pUCBStorage ); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index dc5f254005f6..84bf04a6ed92 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -185,7 +185,7 @@ void RecentDocsView::Reload() Sequence<sal_Int8> aDecoded; sax::Converter::decodeBase64(aDecoded, aBase64); - SvMemoryStream aStream(aDecoded.getArray(), aDecoded.getLength(), STREAM_READ); + SvMemoryStream aStream(aDecoded.getArray(), aDecoded.getLength(), StreamMode::READ); vcl::PNGReader aReader(aStream); aThumbnail = aReader.Read(); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 2b46f08eb350..c5803cd7d216 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -768,7 +768,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, // non-local? if ( INET_PROT_FILE != aURLObj.GetProtocol() ) { - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( rURL, STREAM_READ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ ); if( pStream ) nRet = mpGraphicFilter->ImportGraphic( rGraphic, rURL, *pStream, nFilter, NULL, nFilterImportFlags ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 6fcd374c269d..8422c5eca23a 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -488,7 +488,7 @@ SvStream* SfxMedium::GetInStream() pImp->m_eError = pImp->m_pInStream->GetError(); - if (!pImp->m_eError && (pImp->m_nStorOpenMode & STREAM_WRITE) + if (!pImp->m_eError && (pImp->m_nStorOpenMode & StreamMode::WRITE) && ! pImp->m_pInStream->IsWritable() ) { pImp->m_eError = ERRCODE_IO_ACCESSDENIED; @@ -667,7 +667,7 @@ bool SfxMedium::Commit() GetInitFileDate( true ); // remove truncation mode from the flags - pImp->m_nStorOpenMode &= (~STREAM_TRUNC); + pImp->m_nStorOpenMode &= (~StreamMode::TRUNC); return bResult; } @@ -2269,7 +2269,7 @@ void SfxMedium::GetMedium_Impl() if ( !bFromTempFile ) { GetItemSet()->Put( SfxStringItem( SID_FILE_NAME, aFileName ) ); - if( !(pImp->m_nStorOpenMode & STREAM_WRITE) ) + if( !(pImp->m_nStorOpenMode & StreamMode::WRITE) ) GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) ); if (xInteractionHandler.is()) GetItemSet()->Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, makeAny(xInteractionHandler) ) ); @@ -2696,7 +2696,7 @@ void SfxMedium::SetIsRemote_Impl() // As files that are written to the remote transmission must also be able // to be read. if (pImp->m_bRemote) - pImp->m_nStorOpenMode |= STREAM_READ; + pImp->m_nStorOpenMode |= StreamMode::READ; } @@ -3180,7 +3180,7 @@ bool SfxMedium::IsReadOnly() const // b) if filter allow read/write contents .. check open mode of the storage if (!bReadOnly) - bReadOnly = !( GetOpenMode() & STREAM_WRITE ); + bReadOnly = !( GetOpenMode() & StreamMode::WRITE ); // c) the API can force the readonly state! if (!bReadOnly) @@ -3250,7 +3250,7 @@ void SfxMedium::CreateTempFile( bool bReplace ) return; } - if ( !(pImp->m_nStorOpenMode & STREAM_TRUNC) ) + if ( !(pImp->m_nStorOpenMode & StreamMode::TRUNC) ) { bool bTransferSuccess = false; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 230d19a461b6..6fe904b6f725 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1271,7 +1271,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags ) else { // if a readonly medium has storage then it's stream is already based on temporary file - if( !(pMedium->GetOpenMode() & STREAM_WRITE) && !pMedium->HasStorage_Impl() ) + if( !(pMedium->GetOpenMode() & StreamMode::WRITE) && !pMedium->HasStorage_Impl() ) // don't lock file opened read only pMedium->CloseInStream(); } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 5d841a710a80..3de8c4918ca8 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2011,7 +2011,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) } else { - if( pMedium->GetOpenMode() & STREAM_WRITE ) + if( pMedium->GetOpenMode() & StreamMode::WRITE ) pMedium->GetInStream(); xStorage = GetStorage(); } @@ -2040,7 +2040,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) { if( pMedium ) { - if( pFilter && !IsPackageStorageFormat_Impl( *pMedium ) && (pMedium->GetOpenMode() & STREAM_WRITE )) + if( pFilter && !IsPackageStorageFormat_Impl( *pMedium ) && (pMedium->GetOpenMode() & StreamMode::WRITE )) { pMedium->ReOpen(); bOk = SaveCompletedChildren( false ); @@ -2590,7 +2590,7 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) pFilter = SfxFilterMatcher( OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( - pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, pFilter ); + pSalvageItem->GetValue(), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter ); SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, false ); if ( pPasswordItem ) @@ -2801,7 +2801,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl pParams = pMergedParams; // create a medium for the target URL - SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, 0, pParams ); + SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, 0, pParams ); // set filter; if no filter is given, take the default filter of the factory if ( !aFilterName.isEmpty() ) diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 9516e31871cb..8eaa6956aedb 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -1168,7 +1168,7 @@ ErrCode SfxOlePropertySet::SavePropertySet( SotStorage* pStrg, const OUString& r { if( pStrg ) { - SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, STREAM_TRUNC | STREAM_STD_WRITE ); + SotStorageStreamRef xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::TRUNC | STREAM_STD_WRITE ); if( xStrm.Is() ) Save( *xStrm ); else diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 79fc4e371f3a..96ea1b99fe20 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1989,7 +1989,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla utl::TempFile aTmp; aTmp.EnableKillingFile( true ); storeToURL( aTmp.GetURL(), Sequence < beans::PropertyValue >() ); - SvStream* pStream = aTmp.GetStream( STREAM_READ ); + SvStream* pStream = aTmp.GetStream( StreamMode::READ ); const sal_uInt32 nLen = pStream->Seek( STREAM_SEEK_TO_END ); Sequence< sal_Int8 > aSeq( nLen ); pStream->Seek( STREAM_SEEK_TO_BEGIN ); diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx index ecfb51884a54..ddae32cdf40d 100644 --- a/sfx2/source/inc/openflag.hxx +++ b/sfx2/source/inc/openflag.hxx @@ -20,13 +20,13 @@ #define INCLUDED_SFX2_SOURCE_INC_OPENFLAG_HXX // Open file for editing, then only the third option (reading a copy) works -#define SFX_STREAM_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYWRITE) +#define SFX_STREAM_READWRITE (STREAM_READWRITE | StreamMode::SHARE_DENYWRITE) // I work on the original, not a copy // -> file then can not be opened for editing -#define SFX_STREAM_READONLY (STREAM_READ | STREAM_SHARE_DENYWRITE) // + !bDirect +#define SFX_STREAM_READONLY (StreamMode::READ | StreamMode::SHARE_DENYWRITE) // + !bDirect // Someone else is editing the file, a copy it created // -> the file can then be opened for editing -#define SFX_STREAM_READONLY_MAKECOPY (STREAM_READ | STREAM_SHARE_DENYNONE) +#define SFX_STREAM_READONLY_MAKECOPY (StreamMode::READ | StreamMode::SHARE_DENYNONE) #endif diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e84c617994f3..3c9a9df554b4 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -366,7 +366,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) return; } - sal_uInt16 nOpenMode; + StreamMode nOpenMode; bool bNeedsReload = false; if ( !pSh->IsReadOnly() ) { @@ -465,15 +465,15 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } pMed->CloseAndRelease(); - pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); + pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) ); pMed->SetOpenMode( nOpenMode ); pMed->CompleteReOpen(); - if ( nOpenMode & STREAM_WRITE ) + if ( nOpenMode & StreamMode::WRITE ) pMed->LockOrigFileOnDemand( false, true ); // LockOrigFileOnDemand might set the readonly flag itself, it should be set back - pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); + pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & StreamMode::WRITE ) ) ); if ( !pMed->GetErrorCode() ) bOK = true; |