From 33b38082ca63813f7c478945be198cc504efde4b Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Sat, 27 Aug 2016 10:18:06 +0200 Subject: put StreamMode masks in scope of enum class Change-Id: I77682f7e289a59b986bb84edf014029a20266470 Reviewed-on: https://gerrit.libreoffice.org/28420 Tested-by: Jenkins Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- sfx2/source/appl/appopen.cxx | 2 +- sfx2/source/appl/fileobj.cxx | 2 +- sfx2/source/appl/xpackcreator.cxx | 2 +- sfx2/source/doc/docfile.cxx | 2 +- sfx2/source/doc/graphhelp.cxx | 2 +- sfx2/source/doc/objcont.cxx | 2 +- sfx2/source/doc/objstor.cxx | 4 ++-- sfx2/source/doc/oleprops.cxx | 4 ++-- sfx2/source/inc/openflag.hxx | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index bcae942bd5bc..5b0fddd80e78 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -340,7 +340,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStri xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); //pMedium takes ownership of pSet - SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); + SfxMedium *pMedium = new SfxMedium( rFileName, StreamMode::STD_READ, pFilter, pSet ); if(!xDoc->DoLoad(pMedium)) { ErrCode nErrCode = xDoc->GetErrorCode(); diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 1460787f94b9..edcc9792568f 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -252,7 +252,7 @@ bool SvFileObject::LoadFile_Impl() return false; // at the moment on the current DocShell - xMed = new SfxMedium( sFileNm, sReferer, STREAM_STD_READ ); + xMed = new SfxMedium( sFileNm, sReferer, StreamMode::STD_READ ); SvLinkSource::StreamToLoadFrom aStreamToLoadFrom = getStreamToLoadFrom(); xMed->setStreamToLoadFrom( diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 49f34224a443..5297d927b009 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -83,7 +83,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde if ( !aTempURL.isEmpty() ) { - pTempStream = new SvFileStream( aTempURL, STREAM_STD_READWRITE ); + pTempStream = new SvFileStream( aTempURL, StreamMode::STD_READWRITE ); tools::SvRef aTargetStorage = new SotStorage( true, *pTempStream ); aStorage->CopyTo( aTargetStorage ); aTargetStorage->Commit(); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 301a0263206a..42b1fda5068c 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -593,7 +593,7 @@ SvStream* SfxMedium::GetOutStream() // On Unix don't try to re-use XOutStream from xStream if that exists; // it causes fdo#59022 (fails opening files via SMB on Linux) pImpl->m_pOutStream = new SvFileStream( - pImpl->m_aName, STREAM_STD_READWRITE); + pImpl->m_aName, StreamMode::STD_READWRITE); } CloseStorage(); } diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index f5fb3c6ee1fc..e4e6cc71fb95 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -90,7 +90,7 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta ) OUString aMetaURL = aTempFile.GetURL(); OString aWinFile = OUStringToOString( aMetaFile, osl_getThreadTextEncoding() ); - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMetaURL, STREAM_STD_READWRITE ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMetaURL, StreamMode::STD_READWRITE ); if ( pStream ) { Graphic aGraph( *pGDIMeta ); diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index bac439a9247d..03aaa3a709c3 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -489,7 +489,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) //xTemplDoc->SetBaseURL( aFoundName ); // TODO/LATER: make sure that we don't use binary templates! - SfxMedium aMedium( aFoundName, STREAM_STD_READ ); + SfxMedium aMedium( aFoundName, StreamMode::STD_READ ); if ( xTemplDoc->LoadFrom( aMedium ) ) { // transfer styles from xTemplDoc to this document diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 15fd9db9d098..eec5ca75970d 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2586,7 +2586,7 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) pFilter = SfxFilterMatcher( OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( - pSalvageItem->GetValue(), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter ); + pSalvageItem->GetValue(), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter ); const SfxStringItem* pPasswordItem = SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_PASSWORD, false); if ( pPasswordItem ) @@ -2779,7 +2779,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString& pMergedParams->ClearItem( SID_DOC_SALVAGE ); // create a medium for the target URL - SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, nullptr, pMergedParams ); + SfxMedium *pNewFile = new SfxMedium( rFileName, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, nullptr, pMergedParams ); // 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 71e0e98b6bf7..027c0b759e68 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -1098,7 +1098,7 @@ ErrCode SfxOlePropertySet::LoadPropertySet( SotStorage* pStrg, const OUString& r { if( pStrg ) { - tools::SvRef xStrm = pStrg->OpenSotStream( rStrmName, STREAM_STD_READ ); + tools::SvRef xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::STD_READ ); if( xStrm.Is() && (xStrm->GetError() == SVSTREAM_OK) ) { xStrm->SetBufferSize( STREAM_BUFFER_SIZE ); @@ -1116,7 +1116,7 @@ ErrCode SfxOlePropertySet::SavePropertySet( SotStorage* pStrg, const OUString& r { if( pStrg ) { - tools::SvRef xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::TRUNC | STREAM_STD_WRITE ); + tools::SvRef xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::TRUNC | StreamMode::STD_WRITE ); if( xStrm.Is() ) Save( *xStrm ); else diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx index ddae32cdf40d..3bdfb3428f64 100644 --- a/sfx2/source/inc/openflag.hxx +++ b/sfx2/source/inc/openflag.hxx @@ -20,7 +20,7 @@ #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 | StreamMode::SHARE_DENYWRITE) +#define SFX_STREAM_READWRITE (StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE) // I work on the original, not a copy // -> file then can not be opened for editing #define SFX_STREAM_READONLY (StreamMode::READ | StreamMode::SHARE_DENYWRITE) // + !bDirect -- cgit