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 | |
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>
103 files changed, 211 insertions, 212 deletions
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx index beb0ed9a84ad..a21af8e47d9b 100644 --- a/avmedia/source/vlc/vlcframegrabber.cxx +++ b/avmedia/source/vlc/vlcframegrabber.cxx @@ -103,7 +103,7 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString rtl::OUString url; osl::FileBase::getFileURLFromSystemPath( fileName, url ); std::shared_ptr<SvStream> stream( utl::UcbStreamHelper::CreateStream( url, - STREAM_STD_READ ) ); + StreamMode::STD_READ ) ); vcl::PNGReader reader( *stream ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 4aa4f1b103f1..cfbcd5613f11 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1173,7 +1173,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ) if (xStorage.Is() && xStorage->IsStorage(szBasicStorage)) { tools::SvRef<SotStorage> xBasicStorage = xStorage->OpenSotStorage - ( szBasicStorage, STREAM_STD_READWRITE, false ); + ( szBasicStorage, StreamMode::STD_READWRITE, false ); if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx index 0400c2cc8761..d2ea8416a149 100644 --- a/canvas/source/cairo/cairo_devicehelper.cxx +++ b/canvas/source/cairo/cairo_devicehelper.cxx @@ -238,7 +238,7 @@ namespace cairocanvas { OUString aFilename = "dbg_frontbuffer" + OUString::number(nFilePostfixCount) + ".bmp"; - SvFileStream aStream( aFilename, STREAM_STD_READWRITE ); + SvFileStream aStream( aFilename, StreamMode::STD_READWRITE ); const ::Point aEmptyPoint; bool bOldMap( mpRefDevice->IsMapModeEnabled() ); diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx index a833cd109576..7447cef2f2ad 100644 --- a/canvas/source/vcl/devicehelper.cxx +++ b/canvas/source/vcl/devicehelper.cxx @@ -203,7 +203,7 @@ namespace vclcanvas { OUString aFilename = "dbg_frontbuffer" + OUString::number(nFilePostfixCount) + ".bmp"; - SvFileStream aStream( aFilename, STREAM_STD_READWRITE ); + SvFileStream aStream( aFilename, StreamMode::STD_READWRITE ); const ::Point aEmptyPoint; OutputDevice& rOutDev = mpOutDev->getOutDev(); diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx index ec0feeeb8273..2b484f8a3852 100644 --- a/canvas/source/vcl/spritedevicehelper.cxx +++ b/canvas/source/vcl/spritedevicehelper.cxx @@ -116,7 +116,7 @@ namespace vclcanvas { OUString aFilename = "dbg_backbuffer" + OUString::number(nFilePostfixCount) + ".bmp"; - SvFileStream aStream( aFilename, STREAM_STD_READWRITE ); + SvFileStream aStream( aFilename, StreamMode::STD_READWRITE ); const ::Point aEmptyPoint; mpBackBuffer->getOutDev().EnableMapMode( false ); diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index f5f4c4993906..0e8caed1782d 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -149,7 +149,7 @@ bool ODbaseIndex::openIndexFile() OUString sFile = getCompletePath(); if(UCBContentHelper::Exists(sFile)) { - m_pFileStream = OFileTable::createStream_simpleError(sFile, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); + m_pFileStream = OFileTable::createStream_simpleError(sFile, StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if (!m_pFileStream) m_pFileStream = OFileTable::createStream_simpleError(sFile, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); if(m_pFileStream) @@ -514,7 +514,7 @@ bool ODbaseIndex::CreateImpl() ::dbtools::throwFunctionSequenceException(*this); // create the index file - m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC); + m_pFileStream = OFileTable::createStream_simpleError(sFile,StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC); if (!m_pFileStream) { const OUString sError( m_pTable->getConnection()->getResources().getResourceStringWithSubstitution( diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 4c39e43e6d22..4e9b60a75bff 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -502,7 +502,7 @@ void ODbaseTable::construct() "ODbaseTable::ODbaseTable: invalid extension!"); // getEntry is expected to ensure the correct file name - m_pFileStream = createStream_simpleError( sFileName, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); + m_pFileStream = createStream_simpleError( sFileName, StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); m_bWriteable = ( m_pFileStream != nullptr ); if ( !m_pFileStream ) @@ -527,7 +527,7 @@ void ODbaseTable::construct() // If the memo file isn't found, the data will be displayed anyhow. // However, updates can't be done // but the operation is executed - m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); + m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if ( !m_pMemoStream ) { m_bWriteableMemo = false; @@ -1170,7 +1170,7 @@ bool ODbaseTable::CreateFile(const INetURLObject& aFile, bool& bCreateMemo) bCreateMemo = false; Date aDate( Date::SYSTEM ); // current date - m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC ); + m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC ); if (!m_pFileStream) return false; @@ -1416,7 +1416,7 @@ bool ODbaseTable::CreateFile(const INetURLObject& aFile, bool& bCreateMemo) bool ODbaseTable::CreateMemoFile(const INetURLObject& aFile) { // filehandling macro for table creation - m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | StreamMode::SHARE_DENYWRITE); + m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); if (!m_pMemoStream) return false; diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index ac0ca35dc410..dfa9baad7c4e 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -428,7 +428,7 @@ void OFlatTable::construct() OUString aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE); - m_pFileStream = createStream_simpleError( aFileName, STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); + m_pFileStream = createStream_simpleError( aFileName, StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYWRITE); if(!m_pFileStream) m_pFileStream = createStream_simpleError( aFileName, StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYNONE); diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index 429039babb89..a7a023223f39 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -115,7 +115,7 @@ namespace migration bool IsUserWordbook( const OUString& rFile ) { bool bRet = false; - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( OUString(rFile), STREAM_STD_READ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( OUString(rFile), StreamMode::STD_READ ); if ( pStream && !pStream->GetError() ) { static const sal_Char* pVerOOo7 = "OOoUserDict1"; diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index eda2aedaab3a..6af4e4918d17 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3824,7 +3824,7 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co bool bGraphicLoaded = false; // try to create stream directly from given URL - pImpl->pStream = utl::UcbStreamHelper::CreateStream( maStrLink, STREAM_STD_READ ); + pImpl->pStream = utl::UcbStreamHelper::CreateStream( maStrLink, StreamMode::STD_READ ); // tdf#94088 if we have a stream, try to load it directly as graphic if( pImpl->pStream && !pImpl->pStream->GetError() ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 5948e090d1f3..08cc36ebefcb 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2167,7 +2167,7 @@ bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const OUString& rNew) if( !rNew.isEmpty() && GetCplSttExceptList()->insert( rNew ).second ) { MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2188,7 +2188,7 @@ bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const OUString& rNew) if( !rNew.isEmpty() && pExceptList && pExceptList->insert( rNew ).second ) { MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2220,7 +2220,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadCplSttExceptList() void SvxAutoCorrectLanguageLists::SaveCplSttExceptList() { MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2265,7 +2265,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadWrdSttExceptList() void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList() { MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2300,7 +2300,7 @@ void SvxAutoCorrectLanguageLists::RemoveStream_Imp( const OUString& rName ) { if( sShareAutoCorrFile != sUserAutoCorrFile ) { - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); if( xStg.Is() && SVSTREAM_OK == xStg->GetError() && xStg->IsStream( rName ) ) { @@ -2470,7 +2470,7 @@ bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( std::vector<SvxAutocorrWo GetAutocorrWordList(); MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStorage = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStorage = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); bool bRet = xStorage.Is() && SVSTREAM_OK == xStorage->GetError(); @@ -2542,7 +2542,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort, const OUStrin GetAutocorrWordList(); MakeUserStorage_Impl(); - tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); bool bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); @@ -2604,7 +2604,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort, SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, sLong, false ); if( pAutocorr_List->Insert( pNew ) ) { - tools::SvRef<SotStorage> xStor = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE ); + tools::SvRef<SotStorage> xStor = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE ); MakeBlocklist_Imp( *xStor ); } else diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 631d9bc63fd4..5e8b22ad563f 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -6943,7 +6943,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo if ( pName ) { // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also - tools::SvRef<SotStorageStream> xStr = rSrcStg.OpenSotStream( "package_stream", STREAM_STD_READ ); + tools::SvRef<SotStorageStream> xStr = rSrcStg.OpenSotStream( "package_stream", StreamMode::STD_READ ); xStr->ReadStream( *xMemStream ); } else @@ -7112,7 +7112,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( // TODO/LATER: should the caller be notified if the aspect changes in future? tools::SvRef<SotStorageStream> xObjInfoSrc = xObjStg->OpenSotStream( - "\3ObjInfo", STREAM_STD_READ ); + "\3ObjInfo", StreamMode::STD_READ ); if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() ) { sal_uInt8 nByte = 0; @@ -7144,7 +7144,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( if( bValidStorage ) { // object is not an own object - tools::SvRef<SotStorage> xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName, STREAM_READWRITE ); + tools::SvRef<SotStorage> xObjStor = SotStorage::OpenOLEStorage( xDestStorage, aDstStgName, StreamMode::READWRITE ); if ( xObjStor.Is() ) { diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx index 9c56db12c3e6..0e0fd263331d 100644 --- a/filter/source/msfilter/msoleexp.cxx +++ b/filter/source/msfilter/msoleexp.cxx @@ -326,7 +326,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotSt catch ( const uno::Exception& ) {} - tools::SvRef<SotStorage> xOLEStor = SotStorage::OpenOLEStorage( xStor, aTempName, STREAM_STD_READ ); + tools::SvRef<SotStorage> xOLEStor = SotStorage::OpenOLEStorage( xStor, aTempName, StreamMode::STD_READ ); xOLEStor->CopyTo( &rDestStg ); rDestStg.Commit(); } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 6e311048d984..7bf2191b2ffd 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1862,7 +1862,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, bool bGetItAsOle = (sizeof(aTestA) == xSrcTst->ReadBytes(aTestA, sizeof(aTestA))); if ( !bGetItAsOle ) { // maybe there is a contents stream in here - xSrcTst = xObjStor->OpenSotStream( "Contents", STREAM_READWRITE | StreamMode::NOCREATE ); + xSrcTst = xObjStor->OpenSotStream( "Contents", StreamMode::READWRITE | StreamMode::NOCREATE ); bGetItAsOle = (xSrcTst.Is() && sizeof(aTestA) == xSrcTst->ReadBytes(aTestA, sizeof(aTestA))); } @@ -1899,7 +1899,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, aNm = pOe->pShell->getEmbeddedObjectContainer().CreateUniqueObjectName(); // object is not an own object - tools::SvRef<SotStorage> xTarget = SotStorage::OpenOLEStorage( pOe->pShell->GetStorage(), aNm, STREAM_READWRITE ); + tools::SvRef<SotStorage> xTarget = SotStorage::OpenOLEStorage( pOe->pShell->GetStorage(), aNm, StreamMode::READWRITE ); if ( xObjStor.Is() && xTarget.Is() ) { xObjStor->CopyTo( xTarget ); @@ -2021,7 +2021,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt { // is this a visual basic storage ? tools::SvRef<SotStorage> xSubStorage = xSource->OpenSotStorage( "VBA", - STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ); + StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ); if( xSubStorage.Is() && ( SVSTREAM_OK == xSubStorage->GetError() ) ) { tools::SvRef<SotStorage> xMacros = xDest->OpenSotStorage( "MACROS" ); diff --git a/filter/source/msfilter/svxmsbas2.cxx b/filter/source/msfilter/svxmsbas2.cxx index 0c04ff77e172..e9aa27764f91 100644 --- a/filter/source/msfilter/svxmsbas2.cxx +++ b/filter/source/msfilter/svxmsbas2.cxx @@ -34,7 +34,7 @@ ErrCode SvxImportMSVBasic::SaveOrDelMSVBAStorage( bool bSaveInto, uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() ); OUString aDstStgName( GetMSBasicStorageName() ); tools::SvRef<SotStorage> xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, - STREAM_READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ) ); + StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL ) ); if( xVBAStg.Is() && !xVBAStg->GetError() ) { xVBAStg = nullptr; @@ -45,8 +45,8 @@ ErrCode SvxImportMSVBasic::SaveOrDelMSVBAStorage( bool bSaveInto, if( pBasicMan && pBasicMan->IsBasicModified() ) nRet = ERRCODE_SVX_MODIFIED_VBASIC_STORAGE; #endif - tools::SvRef<SotStorage> xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, STREAM_STD_READ ); - tools::SvRef<SotStorage> xDst = xRoot->OpenSotStorage( rStorageName, STREAM_READWRITE | StreamMode::TRUNC ); + tools::SvRef<SotStorage> xSrc = SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName, StreamMode::STD_READ ); + tools::SvRef<SotStorage> xDst = xRoot->OpenSotStorage( rStorageName, StreamMode::READWRITE | StreamMode::TRUNC ); xSrc->CopyTo( xDst ); xDst->Commit(); ErrCode nError = xDst->GetError(); diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index 3de265240b58..f384978aaebe 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -722,7 +722,7 @@ namespace frm { delete m_pMedium; - m_pMedium = new SfxMedium(rURL, STREAM_STD_READ); + m_pMedium = new SfxMedium(rURL, StreamMode::STD_READ); // Find the XModel to get to the Object shell or at least the // Referer. diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index ad635ab4a095..e90bbfc30cee 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -224,7 +224,7 @@ void ImageProducer::SetImage( const OUString& rPath ) } else if( !maURL.isEmpty() ) { - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_STD_READ ); + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, StreamMode::STD_READ ); mpStm = pIStm ? new SvStream( new ImgProdLockBytes( pIStm, true ) ) : nullptr; } else diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 9deffd4e5e4c..054dc95031b7 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -1273,7 +1273,7 @@ Image AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL) { Image aImage; - SvStream* pStream = UcbStreamHelper::CreateStream( aImageURL, STREAM_STD_READ ); + SvStream* pStream = UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ ); if ( pStream && ( pStream->GetErrorCode() == 0 )) { // Use graphic class to also support more graphic formats (bmp,png,...) @@ -1376,7 +1376,7 @@ bool AddonsOptions_Impl::CreateImageFromSequence( Image& rImage, Sequence< sal_I if ( rBitmapDataSeq.getLength() > 0 ) { - SvMemoryStream aMemStream( rBitmapDataSeq.getArray(), rBitmapDataSeq.getLength(), STREAM_STD_READ ); + SvMemoryStream aMemStream( rBitmapDataSeq.getArray(), rBitmapDataSeq.getLength(), StreamMode::STD_READ ); BitmapEx aBitmapEx; ReadDIBBitmapEx(aBitmapEx, aMemStream); diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index 11d6163c9e29..39db8a0712ba 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -125,7 +125,7 @@ void ImageButtonToolbarController::executeControlCommand( const css::frame::Cont bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUString& aImageURL, Image& aImage ) { - std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aImageURL, STREAM_STD_READ )); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ )); if ( pStream && ( pStream->GetErrorCode() == 0 )) { // Use graphic class to also support more graphic formats (bmp,png,...) diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 56d696a0d7a1..9774991793a7 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -84,7 +84,7 @@ void SvTokenStream::InitCtor() } SvTokenStream::SvTokenStream( const OUString & rFileName ) - : pInStream( new SvFileStream( rFileName, STREAM_STD_READ ) ) + : pInStream( new SvFileStream( rFileName, StreamMode::STD_READ ) ) , aFileName( rFileName ) { InitCtor(); diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index fb5e9d75ce10..41ea28b016fc 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -144,7 +144,7 @@ static bool ResponseFile( StringList * pList, int argc, char ** argv ) { if( '@' == **(argv +i) ) { // when @, then response file - SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), STREAM_STD_READ ); + SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), StreamMode::STD_READ ); if( aStm.GetError() != SVSTREAM_OK ) return false; diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx index 96c651e44271..aa517f67b7c1 100644 --- a/idl/source/prj/svidl.cxx +++ b/idl/source/prj/svidl.cxx @@ -35,8 +35,8 @@ bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, bool bImme sal_uLong nC2 = 1; if( !bImmerVerschieben ) { - SvFileStream aOutStm1( rFile1, STREAM_STD_READ ); - SvFileStream aOutStm2( rFile2, STREAM_STD_READ ); + SvFileStream aOutStm1( rFile1, StreamMode::STD_READ ); + SvFileStream aOutStm2( rFile2, StreamMode::STD_READ ); if( aOutStm1.GetError() == SVSTREAM_OK ) { std::unique_ptr<sal_uInt8[]> pBuf1(new sal_uInt8[ BR ]); @@ -130,7 +130,7 @@ int main ( int argc, char ** argv) if( nExit == 0 && !aCommand.aSlotMapFile.isEmpty() ) { aTmpSlotMapFile = tempFileHelper(aCommand.aSlotMapFile); - SvFileStream aOutStm( aTmpSlotMapFile, STREAM_READWRITE | StreamMode::TRUNC ); + SvFileStream aOutStm( aTmpSlotMapFile, StreamMode::READWRITE | StreamMode::TRUNC ); if( !pDataBase->WriteSfx( aOutStm ) ) { nExit = -1; @@ -142,7 +142,7 @@ int main ( int argc, char ** argv) if (nExit == 0 && !aCommand.m_DepFile.isEmpty()) { aTmpDepFile = tempFileHelper(aCommand.m_DepFile); - SvFileStream aOutStm( aTmpDepFile, STREAM_READWRITE | StreamMode::TRUNC ); + SvFileStream aOutStm( aTmpDepFile, StreamMode::READWRITE | StreamMode::TRUNC ); pDataBase->WriteDepFile(aOutStm, aCommand.aTargetFile); if( aOutStm.GetError() != SVSTREAM_OK ) { @@ -195,7 +195,7 @@ int main ( int argc, char ** argv) { // stamp file, because idl passed through correctly SvFileStream aOutStm( aCommand.aTargetFile, - STREAM_READWRITE | StreamMode::TRUNC ); + StreamMode::READWRITE | StreamMode::TRUNC ); } } } 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 diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index ecfdb335f5e4..c8009f8edab7 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -159,7 +159,7 @@ BlipContext::BlipContext( ContextHandler2Helper& rParent, // code rework. OUString aRelId = rAttribs.getString( R_TOKEN( link ), OUString() ); OUString aTargetLink = getFilter().getAbsoluteUrl( getRelations().getExternalTargetFromRelId( aRelId ) ); - SfxMedium aMed( aTargetLink, STREAM_STD_READ ); + SfxMedium aMed( aTargetLink, StreamMode::STD_READ ); aMed.Download(); Reference< io::XInputStream > xInStrm = aMed.GetInputStream(); if ( xInStrm.is() ) diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index a882511ba35a..80e135362119 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -800,7 +800,7 @@ void exportDirStream(SvStream& rStrm, const css::uno::Reference<css::container:: #if VBA_EXPORT_DEBUG const OUString aDirFileName("/tmp/vba_dir_out.bin"); - SvFileStream aDirStreamDebug(aDirFileName, STREAM_READWRITE); + SvFileStream aDirStreamDebug(aDirFileName, StreamMode::READWRITE); aDirStreamDebug.WriteStream(aDirStream); aDirStream.Seek(0); @@ -845,7 +845,7 @@ void exportModuleStream(SvStream& rStrm, const OUString& rSourceCode, const OUSt #if VBA_EXPORT_DEBUG OUString aModuleFileName("/tmp/vba_" + aElementName + "_out.bin"); - SvFileStream aModuleStreamDebug(aModuleFileName, STREAM_READWRITE); + SvFileStream aModuleStreamDebug(aModuleFileName, StreamMode::READWRITE); aModuleStreamDebug.WriteStream(aModuleStream); aModuleStream.Seek(0); #endif @@ -1047,7 +1047,7 @@ void getCorrectExportOrder(const css::uno::Reference<css::container::XNameContai || VBA_USE_ORIGINAL_DIR_STREAM void addFileStreamToSotStream(const OUString& rPath, SotStorageStream* pStream) { - SvFileStream aFileStream(rPath, STREAM_READWRITE); + SvFileStream aFileStream(rPath, StreamMode::READWRITE); pStream->WriteStream(aFileStream); } #endif @@ -1066,12 +1066,12 @@ void VbaExport::exportVBA(SotStorage* pRootStorage) getCorrectExportOrder(xNameContainer, aLibraryMap); // start here with the VBA export - tools::SvRef<SotStorage> xVBAStream = pRootStorage->OpenSotStorage("VBA", STREAM_READWRITE); - SotStorageStream* pDirStream = xVBAStream->OpenSotStream("dir", STREAM_READWRITE); + tools::SvRef<SotStorage> xVBAStream = pRootStorage->OpenSotStorage("VBA", StreamMode::READWRITE); + SotStorageStream* pDirStream = xVBAStream->OpenSotStream("dir", StreamMode::READWRITE); - SotStorageStream* pVBAProjectStream = xVBAStream->OpenSotStream("_VBA_PROJECT", STREAM_READWRITE); - SotStorageStream* pPROJECTStream = pRootStorage->OpenSotStream("PROJECT", STREAM_READWRITE); - SotStorageStream* pPROJECTwmStream = pRootStorage->OpenSotStream("PROJECTwm", STREAM_READWRITE); + SotStorageStream* pVBAProjectStream = xVBAStream->OpenSotStream("_VBA_PROJECT", StreamMode::READWRITE); + SotStorageStream* pPROJECTStream = pRootStorage->OpenSotStream("PROJECT", StreamMode::READWRITE); + SotStorageStream* pPROJECTwmStream = pRootStorage->OpenSotStream("PROJECTwm", StreamMode::READWRITE); #if VBA_USE_ORIGINAL_WM_STREAM OUString aProjectwmPath = "/home/moggi/Documents/testfiles/vba/PROJECTwm"; @@ -1107,11 +1107,11 @@ void VbaExport::exportVBA(SotStorage* pRootStorage) OUString aSheet2Path = "/home/moggi/Documents/testfiles/vba/VBA/Sheet2"; OUString aSheet3Path = "/home/moggi/Documents/testfiles/vba/VBA/Sheet3"; OUString aWorkbookPath = "/home/moggi/Documents/testfiles/vba/VBA/ThisWorkbook"; - SotStorageStream* pModule1Stream = xVBAStream->OpenSotStream("Module1", STREAM_READWRITE); - SotStorageStream* pSheet1Stream = xVBAStream->OpenSotStream("Sheet1", STREAM_READWRITE); - SotStorageStream* pSheet2Stream = xVBAStream->OpenSotStream("Sheet2", STREAM_READWRITE); - SotStorageStream* pSheet3Stream = xVBAStream->OpenSotStream("Sheet3", STREAM_READWRITE); - SotStorageStream* pWorkbookStream = xVBAStream->OpenSotStream("ThisWorkbook", STREAM_READWRITE); + SotStorageStream* pModule1Stream = xVBAStream->OpenSotStream("Module1", StreamMode::READWRITE); + SotStorageStream* pSheet1Stream = xVBAStream->OpenSotStream("Sheet1", StreamMode::READWRITE); + SotStorageStream* pSheet2Stream = xVBAStream->OpenSotStream("Sheet2", StreamMode::READWRITE); + SotStorageStream* pSheet3Stream = xVBAStream->OpenSotStream("Sheet3", StreamMode::READWRITE); + SotStorageStream* pWorkbookStream = xVBAStream->OpenSotStream("ThisWorkbook", StreamMode::READWRITE); addFileStreamToSotStream(aModule1Path, pModule1Stream); addFileStreamToSotStream(aSheet1Path, pSheet1Stream); addFileStreamToSotStream(aSheet2Path, pSheet2Stream); @@ -1129,7 +1129,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage) for (sal_Int32 i = 0; i < n; ++i) { const OUString& rModuleName = aElementNames[aLibraryMap[i]]; - SotStorageStream* pModuleStream = xVBAStream->OpenSotStream(rModuleName, STREAM_READWRITE); + SotStorageStream* pModuleStream = xVBAStream->OpenSotStream(rModuleName, StreamMode::READWRITE); css::uno::Any aCode = xNameContainer->getByName(rModuleName); css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName); OUString aSourceCode; diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h index 0b0ee4edf111..c878a5bc4213 100644 --- a/opencl/inc/opencl_device_selection.h +++ b/opencl/inc/opencl_device_selection.h @@ -410,7 +410,7 @@ inline ds_status writeProfile(const OUString& rStreamName, std::unique_ptr<ds_pr return DS_INVALID_PROFILE; std::unique_ptr<SvStream> pStream; - pStream.reset(new SvFileStream(rStreamName, STREAM_STD_READWRITE | StreamMode::TRUNC)); + pStream.reset(new SvFileStream(rStreamName, StreamMode::STD_READWRITE | StreamMode::TRUNC)); XmlWriter aXmlWriter(pStream.get()); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index e3493a18652a..7e74465a5cf1 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -548,7 +548,7 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite, ScDocShellRef xDocShRef = new ScDocShell; xDocShRef->GetDocument().EnableUserInteraction(false); - SfxMedium* pSrcMed = new SfxMedium(rURL, bReadWrite ? STREAM_STD_READWRITE : STREAM_STD_READ ); + SfxMedium* pSrcMed = new SfxMedium(rURL, bReadWrite ? StreamMode::STD_READWRITE : StreamMode::STD_READ ); pSrcMed->SetFilter(pFilter); pSrcMed->UseInteractionHandler(false); SfxItemSet* pSet = pSrcMed->GetItemSet(); @@ -628,7 +628,7 @@ ScDocShellRef ScBootstrapFixture::saveAndReload( { utl::TempFile aTempFile; - SfxMedium aStoreMedium( aTempFile.GetURL(), STREAM_STD_WRITE ); + SfxMedium aStoreMedium( aTempFile.GetURL(), StreamMode::STD_WRITE ); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; @@ -673,7 +673,7 @@ std::shared_ptr<utl::TempFile> ScBootstrapFixture::exportTo( ScDocShell* pShell, std::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile()); pTempFile->EnableKillingFile(); - SfxMedium aStoreMedium( pTempFile->GetURL(), STREAM_STD_WRITE ); + SfxMedium aStoreMedium( pTempFile->GetURL(), StreamMode::STD_WRITE ); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType; if (nFormatType == ODS_FORMAT_TYPE) diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 18deabd1969d..ab17fa4d3ee8 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -297,7 +297,7 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt { utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - SfxMedium aStoreMedium( aTempFile.GetURL(), STREAM_STD_WRITE ); + SfxMedium aStoreMedium( aTempFile.GetURL(), StreamMode::STD_WRITE ); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index cef4feffda22..c538ec7b056f 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1537,7 +1537,7 @@ void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase) const_cast<SfxFilter*>(pFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); ScDocShellRef xDocSh = new ScDocShell; - SfxMedium* pMedium = new SfxMedium(aFileName, STREAM_STD_READWRITE); + SfxMedium* pMedium = new SfxMedium(aFileName, StreamMode::STD_READWRITE); SfxItemSet* pSet = pMedium->GetItemSet(); pSet->Put(SfxStringItem(SID_PASSWORD, OUString("test"))); pMedium->SetFilter(pFilter); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 19c9460d0785..954669422cb8 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4431,7 +4431,7 @@ void Test::testCopyPasteFormulas() void Test::testCopyPasteFormulasExternalDoc() { OUString aDocName("file:///source.fake"); - SfxMedium* pMedium = new SfxMedium(aDocName, STREAM_STD_READWRITE); + SfxMedium* pMedium = new SfxMedium(aDocName, StreamMode::STD_READWRITE); getDocShell().DoInitNew(pMedium); m_pDoc = &getDocShell().GetDocument(); @@ -4439,7 +4439,7 @@ void Test::testCopyPasteFormulasExternalDoc() OUString aExtDocName("file:///extdata.fake"); OUString aExtSh1Name("ExtSheet1"); OUString aExtSh2Name("ExtSheet2"); - SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE); xExtDocSh->DoInitNew(pMed); CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.", findLoadedDocShellByName(aExtDocName) != nullptr); diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 6322c14352a2..48105692a707 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5293,7 +5293,7 @@ void Test::testExternalRef() OUString aExtSh1Name("Data1"); OUString aExtSh2Name("Data2"); OUString aExtSh3Name("Data3"); - SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE); xExtDocSh->DoInitNew(pMed); CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.", findLoadedDocShellByName(aExtDocName) != nullptr); @@ -5463,7 +5463,7 @@ void Test::testExternalRangeName() ScDocShellRef xExtDocSh = new ScDocShell; OUString aExtDocName("file:///extdata.fake"); OUString aExtSh1Name("Data1"); - SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE); xExtDocSh->DoInitNew(pMed); CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.", findLoadedDocShellByName(aExtDocName) != nullptr); @@ -5558,7 +5558,7 @@ void Test::testExternalRefFunctions() { ScDocShellRef xExtDocSh = new ScDocShell; OUString aExtDocName("file:///extdata.fake"); - SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE); xExtDocSh->DoInitNew(pMed); CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.", findLoadedDocShellByName(aExtDocName) != nullptr); diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index e9833a23238a..6a9a0000651f 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -744,7 +744,7 @@ void Test::testSharedFormulasRefUpdateExternal() ScDocShellRef xExtDocSh = new ScDocShell; OUString aExtDocName("file:///extdata.fake"); - SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + SfxMedium* pMed = new SfxMedium(aExtDocName, StreamMode::STD_READWRITE); xExtDocSh->DoInitNew(pMed); ScDocument& rExtDoc = xExtDocSh->GetDocument(); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 91f9d80499c1..87c478ee93dc 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -374,7 +374,7 @@ void ImportExcel8::ReadBasic() rFilterOpt.IsLoadExcelBasicExecutable() ) { // see if we have the XCB stream - tools::SvRef<SotStorageStream> xXCB = xRootStrg->OpenSotStream( "XCB", STREAM_STD_READ ); + tools::SvRef<SotStorageStream> xXCB = xRootStrg->OpenSotStream( "XCB", StreamMode::STD_READ ); if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() ) { ScCTBWrapper wrapper; diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 11c07055aca1..e340ff8dbf1e 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1565,7 +1565,7 @@ void XclExpObjectManager::InitStream( bool bTempFile ) if( mxTempFile->IsValid() ) { mxTempFile->EnableKillingFile(); - mxDffStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxTempFile->GetURL(), STREAM_STD_READWRITE ) ); + mxDffStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxTempFile->GetURL(), StreamMode::STD_READWRITE ) ); } } diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index d17e48a09d36..1a8e3cfee6cf 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -169,7 +169,7 @@ tools::SvRef<SotStorage> ScfTools::OpenStorageRead( tools::SvRef<SotStorage> con { tools::SvRef<SotStorage> xSubStrg; if( xStrg.Is() && xStrg->IsContained( rStrgName ) ) - xSubStrg = xStrg->OpenSotStorage( rStrgName, STREAM_STD_READ ); + xSubStrg = xStrg->OpenSotStorage( rStrgName, StreamMode::STD_READ ); return xSubStrg; } @@ -177,7 +177,7 @@ tools::SvRef<SotStorage> ScfTools::OpenStorageWrite( tools::SvRef<SotStorage> co { tools::SvRef<SotStorage> xSubStrg; if( xStrg.Is() ) - xSubStrg = xStrg->OpenSotStorage( rStrgName, STREAM_STD_WRITE ); + xSubStrg = xStrg->OpenSotStorage( rStrgName, StreamMode::STD_WRITE ); return xSubStrg; } @@ -185,7 +185,7 @@ tools::SvRef<SotStorageStream> ScfTools::OpenStorageStreamRead( tools::SvRef<Sot { tools::SvRef<SotStorageStream> xStrm; if( xStrg.Is() && xStrg->IsContained( rStrmName ) && xStrg->IsStream( rStrmName ) ) - xStrm = xStrg->OpenSotStream( rStrmName, STREAM_STD_READ ); + xStrm = xStrg->OpenSotStream( rStrmName, StreamMode::STD_READ ); return xStrm; } @@ -194,7 +194,7 @@ tools::SvRef<SotStorageStream> ScfTools::OpenStorageStreamWrite( tools::SvRef<So OSL_ENSURE( !xStrg || !xStrg->IsContained( rStrmName ), "ScfTools::OpenStorageStreamWrite - stream exists already" ); tools::SvRef<SotStorageStream> xStrm; if( xStrg.Is() ) - xStrm = xStrg->OpenSotStream( rStrmName, STREAM_STD_WRITE | StreamMode::TRUNC ); + xStrm = xStrg->OpenSotStream( rStrmName, StreamMode::STD_WRITE | StreamMode::TRUNC ); return xStrm; } diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx index 8fcc42165078..9267cafe13c0 100644 --- a/sc/source/filter/lotus/lotus.cxx +++ b/sc/source/filter/lotus/lotus.cxx @@ -75,7 +75,7 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum // try to load *.FM3 file INetURLObject aURL( rMedium.GetURLObject() ); aURL.setExtension( "FM3" ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::STD_READ ); pStream = aMedium.GetInStream(); if ( pStream ) { diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index 6b48b87df8b2..7c2d39f0d6a8 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -83,7 +83,7 @@ SvStream* XclEscherExGlobal::ImplQueryPictureStream() if( mxPicTempFile->IsValid() ) { mxPicTempFile->EnableKillingFile(); - mxPicStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxPicTempFile->GetURL(), STREAM_STD_READWRITE ) ); + mxPicStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxPicTempFile->GetURL(), StreamMode::STD_READWRITE ) ); mxPicStrm->SetEndian( SvStreamEndian::LITTLE ); } return mxPicStrm.get(); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index b9dff306376c..0c203013a5dc 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -707,7 +707,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) ); if ( nVersion != 0 ) pSet->Put( SfxInt16Item( SID_VERSION, nVersion ) ); - pMed = new SfxMedium( aFileName, STREAM_STD_READ, pFilter, pSet ); + pMed = new SfxMedium( aFileName, StreamMode::STD_READ, pFilter, pSet ); } else { diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index e2f100ec6fc2..663cbd41c883 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2529,7 +2529,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt } } - unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, pFilter, pSet)); + unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, StreamMode::STD_READ, pFilter, pSet)); if (pMedium->GetError() != ERRCODE_NONE) return nullptr; diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 78869f91db5b..9cd8ea29c42e 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -182,7 +182,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter, if (!aOptions.isEmpty()) pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) ); - SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, pFilter, pSet); + SfxMedium* pMed = new SfxMedium(aNewUrl, StreamMode::STD_READ, pFilter, pSet); if ( bInEdit ) // only if using the edit dialog, pMed->UseInteractionHandler(true); // enable the filter options dialog @@ -450,7 +450,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName, // Filter-Detection std::shared_ptr<const SfxFilter> pSfxFilter; - SfxMedium* pMedium = new SfxMedium( rFileName, STREAM_STD_READ ); + SfxMedium* pMedium = new SfxMedium( rFileName, StreamMode::STD_READ ); if ( pMedium->GetError() == ERRCODE_NONE ) { if ( bWithInteraction ) @@ -492,7 +492,7 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, std::share if ( !rOptions.isEmpty() ) pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) ); - return new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); + return new SfxMedium( rFileName, StreamMode::STD_READ, pFilter, pSet ); } ScDocumentLoader::ScDocumentLoader( const OUString& rFileName, diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx index c08f6c0dd142..647f9ddc094f 100644 --- a/sd/qa/unit/filters-test.cxx +++ b/sd/qa/unit/filters-test.cxx @@ -70,7 +70,7 @@ bool SdFiltersTest::load(const OUString &rFilter, const OUString &rURL, const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion); ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(); - SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); + SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); pSrcMed->SetFilter(pFilter); bool bLoaded = xDocShRef->DoLoad(pSrcMed); xDocShRef->DoClose(); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index cf7337f38e11..8fc2b3af94b0 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -135,7 +135,7 @@ protected: std::shared_ptr<const SfxFilter> pFilt(pFilter); ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(); - SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ, pFilt, pParams); + SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ, pFilt, pParams); if ( !xDocShRef->DoLoad(pSrcMed) || !xDocShRef.Is() ) { if (xDocShRef.Is()) @@ -157,7 +157,7 @@ protected: void exportTo(sd::DrawDocShell* pShell, FileFormat* pFormat, utl::TempFile& rTempFile) { - SfxMedium aStoreMedium(rTempFile.GetURL(), STREAM_STD_WRITE); + SfxMedium aStoreMedium(rTempFile.GetURL(), StreamMode::STD_WRITE); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCALC_8; @@ -176,7 +176,7 @@ protected: void save(sd::DrawDocShell* pShell, FileFormat* pFormat, utl::TempFile& rTempFile) { - SfxMedium aStoreMedium(rTempFile.GetURL(), STREAM_STD_WRITE); + SfxMedium aStoreMedium(rTempFile.GetURL(), StreamMode::STD_WRITE); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index ce1b85f36bfa..40c51d0e57ac 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -132,7 +132,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt #endif PowerPointImportParam aParam( rDocStream, nImportFlags ); - SvStream* pCurrentUserStream = rStorage.OpenSotStream( "Current User", STREAM_STD_READ ); + SvStream* pCurrentUserStream = rStorage.OpenSotStream( "Current User", StreamMode::STD_READ ); if( pCurrentUserStream ) { ReadPptCurrentUserAtom( *pCurrentUserStream, aParam.aCurrentUserAtom ); @@ -191,7 +191,7 @@ ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SotStorage& rStorag { sal_uLong nPosMerk = rStCtrl.Tell(); - pStData = rStorage_.OpenSotStream( "Pictures", STREAM_STD_READ ); + pStData = rStorage_.OpenSotStream( "Pictures", StreamMode::STD_READ ); rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 ); sal_uLong nDocLen = maDocHd.GetRecEndFilePos(); @@ -2761,13 +2761,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportPPT(const OUString &rURL if (xStorage->GetError()) return false; - tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", STREAM_STD_READ)); + tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", StreamMode::STD_READ)); if (!xDocStream) return false; SdDLL::Init(); - SfxMedium aSrcMed(rURL, STREAM_STD_READ); + SfxMedium aSrcMed(rURL, StreamMode::STD_READ); xDocStream->SetVersion(xStorage->GetVersion()); xDocStream->SetCryptMaskKey(xStorage->GetKey()); diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 9e7d16cb18a8..f91888b08fc8 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -552,7 +552,7 @@ PropRead::PropRead( SotStorage& rStorage, const OUString& rName ) : { if ( rStorage.IsStream( rName ) ) { - mpSvStream = rStorage.OpenSotStream( rName, STREAM_STD_READ ); + mpSvStream = rStorage.OpenSotStream( rName, StreamMode::STD_READ ); if ( mpSvStream ) { mpSvStream->SetEndian( SvStreamEndian::LITTLE ); diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx index 049d3dad0af1..d64a1e145005 100644 --- a/sd/source/filter/sdpptwrp.cxx +++ b/sd/source/filter/sdpptwrp.cxx @@ -84,10 +84,10 @@ bool SdPPTFilter::Import() OUString sDualStorage( "PP97_DUALSTORAGE" ); if ( pStorage->IsContained( sDualStorage ) ) { - xDualStorage = pStorage->OpenSotStorage( sDualStorage, STREAM_STD_READ ); + xDualStorage = pStorage->OpenSotStorage( sDualStorage, StreamMode::STD_READ ); pStorage = xDualStorage; } - SvStream* pDocStream = pStorage->OpenSotStream( "PowerPoint Document" , STREAM_STD_READ ); + SvStream* pDocStream = pStorage->OpenSotStream( "PowerPoint Document" , StreamMode::STD_READ ); if( pDocStream ) { pDocStream->SetVersion( pStorage->GetVersion() ); diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index f665d7f5960a..9f0ff7de6be2 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -183,7 +183,7 @@ tools::SvRef<SotStorageStream> SdModule::GetOptionStream( const OUString& rOptio aURL.Append( "drawing.cfg" ); - SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE ); + SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READWRITE ); if( pStm ) xOptionStorage = new SotStorage( pStm, true ); 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<SotStorage> 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<SfxStringItem>(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<SotStorageStream> xStrm = pStrg->OpenSotStream( rStrmName, STREAM_STD_READ ); + tools::SvRef<SotStorageStream> 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<SotStorageStream> xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::TRUNC | STREAM_STD_WRITE ); + tools::SvRef<SotStorageStream> 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 diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index ab256fd1a628..26703ff5fd15 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -128,7 +128,7 @@ bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) if( m == INTERNAL_MODE ) return true; StreamMode nCurMode = ( p && p->m_nRefCnt ) ? p->m_nMode : StreamMode::SHARE_DENYALL; - if( ( m & STREAM_READWRITE ) == StreamMode::READ ) + if( ( m & StreamMode::READWRITE ) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed if( ( ( m & StreamMode::SHARE_DENYWRITE ) @@ -166,7 +166,7 @@ StorageStream::StorageStream( StgIo* p, StgDirEntry* q, StreamMode m ) } } else - m &= ~StreamMode(STREAM_READWRITE); + m &= ~StreamMode(StreamMode::READWRITE); m_nMode = m; } @@ -304,7 +304,7 @@ SvStorageInfo::SvStorageInfo( const StgDirEntry& rE ) bool Storage::IsStorageFile( const OUString & rFileName ) { StgIo aIo; - if( aIo.Open( rFileName, STREAM_STD_READ ) ) + if( aIo.Open( rFileName, StreamMode::STD_READ ) ) return aIo.Load(); return false; } @@ -478,7 +478,7 @@ Storage::Storage( StgIo* p, StgDirEntry* q, StreamMode m ) if( q ) q->m_aEntry.GetName( aName ); else - m &= ~StreamMode(STREAM_READWRITE); + m &= ~StreamMode(StreamMode::READWRITE); m_nMode = m; if( q && q->m_nRefCnt == 1 ) q->m_nMode = m; diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 521c6cf5adde..92473d0bca47 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1197,7 +1197,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) if( n > THRESHOLD ) { m_aName = utl::TempFile(nullptr, false).GetURL(); - SvFileStream* s = new SvFileStream( m_aName, STREAM_READWRITE ); + SvFileStream* s = new SvFileStream( m_aName, StreamMode::READWRITE ); const sal_uInt64 nCur = Tell(); sal_uInt64 i = nEndOfData; std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]); diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 6ff2bf862c6d..3d26f5c12116 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -491,7 +491,7 @@ bool SotStorage::IsStorageFile( const OUString & rFileName ) aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); } - std::unique_ptr<SvStream> pStm(::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ )); + std::unique_ptr<SvStream> pStm(::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READ )); bool bRet = SotStorage::IsStorageFile( pStm.get() ); return bRet; } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index b61053976f73..7ea86ab09978 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -287,7 +287,7 @@ void FileStreamWrapper_Impl::checkConnected() throw NotConnectedException(OUString(), const_cast<XWeak*>(static_cast<const XWeak*>(this))); if ( !m_pSvStream ) { - m_pSvStream = ::utl::UcbStreamHelper::CreateStream( m_aURL, STREAM_STD_READ ); + m_pSvStream = ::utl::UcbStreamHelper::CreateStream( m_aURL, StreamMode::STD_READ ); #if OSL_DEBUG_LEVEL > 0 ++nOpenFiles; #endif @@ -726,7 +726,7 @@ bool UCBStorageStream_Impl::Init() if ( m_aTempURL.isEmpty() ) m_aTempURL = ::utl::TempFile().GetURL(); - m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, STREAM_STD_READWRITE, true /* bFileExists */ ); + m_pStream = ::utl::UcbStreamHelper::CreateStream( m_aTempURL, StreamMode::STD_READWRITE, true /* bFileExists */ ); #if OSL_DEBUG_LEVEL > 0 ++nOpenFiles; #endif @@ -1314,7 +1314,7 @@ bool UCBStorageStream::ValidateMode( StreamMode m ) const // ??? if( m == ( StreamMode::READ | StreamMode::TRUNC ) ) // from stg.cxx return true; - if( ( m & STREAM_READWRITE) == StreamMode::READ ) + if( ( m & StreamMode::READWRITE) == StreamMode::READ ) { // only SHARE_DENYWRITE or SHARE_DENYALL allowed if( ( m & StreamMode::SHARE_DENYWRITE ) @@ -1561,7 +1561,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt if ( m_nMode & StreamMode::WRITE ) { // the root storage opens the package, so make sure that there is any - SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READWRITE, m_pTempFile != nullptr /* bFileExists */ ); + SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READWRITE, m_pTempFile != nullptr /* bFileExists */ ); delete pStream; } } @@ -1603,7 +1603,7 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool m_aURL = aTemp; // copy data into the temporary file - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READWRITE, true /* bFileExists */ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READWRITE, true /* bFileExists */ )); if ( pStream ) { rStream.Seek(0); @@ -1646,7 +1646,7 @@ void UCBStorage_Impl::Init() aObj.Append( "manifest.xml" ); // create input stream - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::STD_READ )); // no stream means no manifest.xml if ( pStream ) { @@ -1815,7 +1815,7 @@ void UCBStorage_Impl::ReadContent() else if ( aMediaType.isEmpty() ) { // older files didn't have that special content type, so they must be detected - OpenStream( pElement, STREAM_STD_READ, m_bDirect, nullptr ); + OpenStream( pElement, StreamMode::STD_READ, m_bDirect, nullptr ); if ( Storage::IsStorageFile( pElement->m_xStream ) ) pElement->m_bIsStorage = true; else @@ -2218,7 +2218,7 @@ sal_Int16 UCBStorage_Impl::Commit() std::unique_ptr< ::utl::TempFile> pTempFile(new ::utl::TempFile( &aURL )); // get the stream from the temp file and create an output stream wrapper - SvStream* pStream = pTempFile->GetStream( STREAM_STD_READWRITE ); + SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE ); ::utl::OOutputStreamWrapper* pHelper = new ::utl::OOutputStreamWrapper( *pStream ); css::uno::Reference < css::io::XOutputStream > xOutputStream( pHelper ); @@ -2251,7 +2251,7 @@ sal_Int16 UCBStorage_Impl::Commit() m_pContent->executeCommand( "flush", aAny ); if ( m_pSource != nullptr ) { - std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), STREAM_STD_READ )); + std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READ )); m_pSource->SetStreamSize(0); // m_pSource->Seek(0); pStream->ReadStream( *m_pSource ); @@ -2473,7 +2473,7 @@ bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement, Base pStream = rElement.m_xStream->m_pAntiImpl; if ( !pStream ) { - pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, STREAM_STD_READ, pImp->m_bDirect ); + pStream = ( const_cast < UCBStorage* > (this) )->OpenStream( rElement.m_aName, StreamMode::STD_READ, pImp->m_bDirect ); bDeleteStream = true; } diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index ce1a4675d0fc..f13ee9deba21 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -75,7 +75,7 @@ xmlDocPtr MathMLExportTest::exportAndParse() { utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - SfxMedium aStoreMedium(aTempFile.GetURL(), STREAM_STD_WRITE); + SfxMedium aStoreMedium(aTempFile.GetURL(), StreamMode::STD_WRITE); std::shared_ptr<const SfxFilter> pExportFilter = SfxFilter::GetFilterByName(MATHML_XML); aStoreMedium.SetFilter(pExportFilter); CPPUNIT_ASSERT(mxDocShell->ConvertTo(aStoreMedium)); diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 846ea87681a6..fcb6be9e6d8a 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -61,7 +61,7 @@ private: SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY); - SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); + SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); pSrcMed->SetFilter(pFilter); pSrcMed->UseInteractionHandler(false); bool bLoaded = mxDocShell->DoLoad(pSrcMed); diff --git a/starmath/source/eqnolefilehdr.cxx b/starmath/source/eqnolefilehdr.cxx index 0465149e0090..3cac2b3584f7 100644 --- a/starmath/source/eqnolefilehdr.cxx +++ b/starmath/source/eqnolefilehdr.cxx @@ -31,7 +31,7 @@ bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion ) tools::SvRef<SotStorageStream> xSrc = pStor->OpenSotStream( "Equation Native", - STREAM_STD_READ); + StreamMode::STD_READ); if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return bSuccess; SotStorageStream *pS = &xSrc; diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index f39843e825d6..92aa6c40d835 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -557,7 +557,7 @@ bool MathType::Parse(SotStorage *pStor) { tools::SvRef<SotStorageStream> xSrc = pStor->OpenSotStream( "Equation Native", - STREAM_STD_READ); + StreamMode::STD_READ); if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return false; pS = &xSrc; diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 533389daf825..5d7735f43faf 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -244,7 +244,7 @@ namespace svgio if (!aAbsUrl.isEmpty() && !rPath.equals(aAbsUrl)) { - SvFileStream aStream(aAbsUrl, STREAM_STD_READ); + SvFileStream aStream(aAbsUrl, StreamMode::STD_READ); Graphic aGraphic; if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 08561f0e0885..cbcc682599fc 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -406,7 +406,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( { // TODO: test whether it really works for http and fwp SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), - STREAM_STD_WRITE ); + StreamMode::STD_WRITE ); if ( pStream ) { if ( !pStream->GetError() ) @@ -1354,7 +1354,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl { // TODO: test whether it really works for http and fwp SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL, - STREAM_STD_WRITE ); + StreamMode::STD_WRITE ); if ( pStream ) { if ( !pStream->GetError() ) diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index c133fe2c5426..8dab2ac5abdb 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -126,7 +126,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo } else { - pStream = aTmp.GetStream( STREAM_STD_READWRITE ); + pStream = aTmp.GetStream( StreamMode::STD_READWRITE ); uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetStorageFromStream( new utl::OStreamWrapper( *pStream ) ); xStg->openStorageElement( aName, embed::ElementModes::READ )->copyToStorage( xStor ); } diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index bbc70f48d3bc..f4ff92462036 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -378,7 +378,7 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, bool bDetectFol sal_uInt16 nId = IMG_WRITERTEMPLATE; try { - tools::SvRef<SotStorage> aStorage = new SotStorage( sURL, STREAM_STD_READ ); + tools::SvRef<SotStorage> aStorage = new SotStorage( sURL, StreamMode::STD_READ ); if ( !aStorage->GetError() ) { SvGlobalName aGlobalName = aStorage->GetClassName(); diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 0dc040e33b92..216ae9ecd7bc 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -1891,7 +1891,7 @@ bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavo if( ( aDesc.getLength() > 4 ) && aDesc.copy(aDesc.getLength() - 4).equalsIgnoreAsciiCase(".URL") ) { std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( INetURLObject( OStringToOUString(aDesc, eTextEncoding) ).GetMainURL( INetURLObject::NO_DECODE ), - STREAM_STD_READ )); + StreamMode::STD_READ )); if( !pStream || pStream->GetError() ) { @@ -1904,7 +1904,7 @@ bool TransferableDataHelper::GetINetBookmark( const css::datatransfer::DataFlavo { aSeq = GetSequence(aFileContentFlavor, OUString()); if (aSeq.getLength()) - pStream.reset(new SvMemoryStream( (sal_Char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_STD_READ )); + pStream.reset(new SvMemoryStream( (sal_Char*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::STD_READ )); } } diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 719475728cf3..81a7a6af356f 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -91,7 +91,7 @@ void GalleryTheme::ImplCreateSvDrawStorage() { try { - aSvDrawStorageRef = new SotStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? StreamMode::READ : STREAM_STD_READWRITE ); + aSvDrawStorageRef = new SotStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? StreamMode::READ : StreamMode::STD_READWRITE ); // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) aSvDrawStorageRef = new SotStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); @@ -656,7 +656,7 @@ void GalleryTheme::Actualize( const Link<const INetURLObject&, void>& rActualize try { - tools::SvRef<SotStorage> aTempStorageRef( new SotStorage( false, aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE ) ); + tools::SvRef<SotStorage> aTempStorageRef( new SotStorage( false, aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::STD_READWRITE ) ); aSvDrawStorageRef->CopyTo( aTempStorageRef ); nStorErr = aSvDrawStorageRef->GetError(); } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index bb9211c93306..c2b40aca0f57 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -71,7 +71,7 @@ const Graphic ImpLoadLinkedGraphic( const OUString& aFileName, const OUString& a { Graphic aGraphic; - SfxMedium aMed( aFileName, aReferer, STREAM_STD_READ ); + SfxMedium aMed( aFileName, aReferer, StreamMode::STD_READ ); aMed.Download(); SvStream* pInStrm = aMed.GetInStream(); diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index cd5fc113c771..3762d5ed6047 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -88,7 +88,7 @@ OutputStorageWrapper_Impl::OutputStorageWrapper_Impl() , pStream(nullptr) { aTempFile.EnableKillingFile(); - pStream = aTempFile.GetStream( STREAM_READWRITE ); + pStream = aTempFile.GetStream( StreamMode::READWRITE ); xOut = new OOutputStreamWrapper( *pStream ); } diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index e8ddc2a0ab90..b8cb7c506ac6 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -87,7 +87,7 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion); SwDocShellRef xDocShRef = new SwDocShell; - SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); + SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); std::shared_ptr<const SfxFilter> pImportFilter; std::shared_ptr<const SfxFilter> pExportFilter; @@ -121,7 +121,7 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - SfxMedium aDstMed(aTempFile.GetURL(), STREAM_STD_WRITE); + SfxMedium aDstMed(aTempFile.GetURL(), StreamMode::STD_WRITE); aDstMed.SetFilter(pExportFilter); bool bSaved = xDocShRef->DoSaveAs(aDstMed); if (xDocShRef.Is()) diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index aa830210fab6..2469e981351c 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -187,7 +187,7 @@ void SwDocTest::testFileNameFields() INetURLObject aTempFileURL(aTempFile.GetURL()); OUString sFileURL = aTempFileURL.GetMainURL(INetURLObject::NO_DECODE); - SfxMedium aDstMed(sFileURL, STREAM_STD_READWRITE); + SfxMedium aDstMed(sFileURL, StreamMode::STD_READWRITE); std::shared_ptr<SfxFilter> pFilter(new SfxFilter( OUString("Text"), diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index edc1aaf8e300..eec97754fe3b 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -319,7 +319,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, utl::TempFile aTempFile2(sLeading, true, &sExt, &sPath); sFileName = aTempFile2.GetURL(); SfxMedium* pTmpMed = new SfxMedium( sFileName, - STREAM_STD_READWRITE ); + StreamMode::STD_READWRITE ); pTmpMed->SetFilter( pFilter ); // We need to have a Layout for the HTMLFilter, so that diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index d44ebcba9527..38824b29456f 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1291,7 +1291,7 @@ bool SwTableAutoFormatTable::Load() SvtPathOptions aOpt; if( aOpt.SearchFile( sNm )) { - SfxMedium aStream( sNm, STREAM_STD_READ ); + SfxMedium aStream( sNm, StreamMode::STD_READ ); bRet = Load( *aStream.GetInStream() ); } else @@ -1303,7 +1303,7 @@ bool SwTableAutoFormatTable::Save() const { SvtPathOptions aPathOpt; const OUString sNm( aPathOpt.GetUserConfigPath() + "/" AUTOTABLE_FORMAT_NAME ); - SfxMedium aStream(sNm, STREAM_STD_WRITE ); + SfxMedium aStream(sNm, StreamMode::STD_WRITE ); return Save( *aStream.GetOutStream() ) && aStream.Commit(); } diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index fcb9ec294831..eb006419dae2 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -302,7 +302,7 @@ void SwEditShell::ApplyAutoMark() } //2. - SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ ); + SfxMedium aMedium( sAutoMarkURL, StreamMode::STD_READ ); SvStream& rStrm = *aMedium.GetInStream(); Push(); rtl_TextEncoding eChrSet = ::osl_getThreadTextEncoding(); diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 1ecf8d381b09..ef2181437ee5 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -515,7 +515,7 @@ bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName) aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); } - SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, STREAM_STD_READ ); + SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READ ); bool bRet = UCBStorage::IsStorageFile( pStm ); delete pStm; return bRet; diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 8de8f0d195a0..55a62390ab86 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -127,7 +127,7 @@ bool SwIoSystem::IsValidStgFilter(SotStorage& rStg, const SfxFilter& rFilter) { tools::SvRef<SotStorageStream> xRef = rStg.OpenSotStream("WordDocument", - STREAM_STD_READ ); + StreamMode::STD_READ ); xRef->Seek(10); sal_uInt8 nByte; xRef->ReadUChar( nByte ); @@ -160,7 +160,7 @@ std::shared_ptr<const SfxFilter> SwIoSystem::GetFileFilter(const OUString& rFile INetURLObject aObj; aObj.SetSmartProtocol( INetProtocol::File ); aObj.SetSmartURL( rFileName ); - SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ); + SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), StreamMode::STD_READ); // templates should not get precedence over "normal" filters (#i35508, #i33168) std::shared_ptr<const SfxFilter> pTemplateFilter; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 843f45c532d7..3b23221a07f6 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3216,9 +3216,9 @@ void WW8Export::ExportDocument_Impl() pFib->fWhichTableStm = true; xTableStrm = GetWriter().GetStorage().OpenSotStream(OUString(SL::a1Table), - STREAM_STD_WRITE ); + StreamMode::STD_WRITE ); xDataStrm = GetWriter().GetStorage().OpenSotStream(OUString(SL::aData), - STREAM_STD_WRITE ); + StreamMode::STD_WRITE ); xDataStrm->SetBufferSize( 32768 ); // for graphics xTableStrm->SetBufferSize( 16384 ); // for the Font-/Style-Table, etc. @@ -3244,11 +3244,11 @@ void WW8Export::ExportDocument_Impl() if ( bEncrypt ) { GetWriter().SetStream( - aTempMain.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ) ); + aTempMain.GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ) ); - pTableStrm = aTempTable.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ); + pTableStrm = aTempTable.GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ); - pDataStrm = aTempData.GetStream( STREAM_READWRITE | StreamMode::SHARE_DENYWRITE ); + pDataStrm = aTempData.GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ); sal_uInt8 aRC4EncryptionHeader[ 52 ] = {0}; pTableStrm->WriteBytes(aRC4EncryptionHeader, 52); diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index cb89dfbc0aa1..1df65d0e58d2 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -43,7 +43,7 @@ WW8Glossary::WW8Glossary(tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVer if (aWwFib.nFibBack >= 0x6A) //Word97 { xTableStream = pStg->OpenSotStream(OUString::createFromAscii( - aWwFib.fWhichTableStm ? SL::a1Table : SL::a0Table), STREAM_STD_READ); + aWwFib.fWhichTableStm ? SL::a1Table : SL::a0Table), StreamMode::STD_READ); if (xTableStream.Is() && SVSTREAM_OK == xTableStream->GetError()) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 32f40bac90ed..0c95f2227827 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4887,7 +4887,7 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, if ( !aURL.endsWithIgnoreAsciiCase( ".dot" ) || ( !sCreatedFrom.isEmpty() && sCreatedFrom.equals( aURL ) ) ) continue; // don't try and read the same document as ourselves - tools::SvRef<SotStorage> rRoot = new SotStorage( aURL, STREAM_STD_READWRITE ); + tools::SvRef<SotStorage> rRoot = new SotStorage( aURL, StreamMode::STD_READWRITE ); BasicProjImportHelper aBasicImporter( *m_pDocShell ); // Import vba via oox filter @@ -4897,7 +4897,7 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, tools::SvRef<SotStorageStream> refMainStream = rRoot->OpenSotStream( "WordDocument"); refMainStream->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib( *refMainStream, 8 ); - tools::SvRef<SotStorageStream> xTableStream = rRoot->OpenSotStream(OUString::createFromAscii( aWwFib.fWhichTableStm ? SL::a1Table : SL::a0Table), STREAM_STD_READ); + tools::SvRef<SotStorageStream> xTableStream = rRoot->OpenSotStream(OUString::createFromAscii( aWwFib.fWhichTableStm ? SL::a1Table : SL::a0Table), StreamMode::STD_READ); if (xTableStream.Is() && SVSTREAM_OK == xTableStream->GetError()) { @@ -5438,13 +5438,13 @@ sal_uLong SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableS rTableStream = m_pStg->OpenSotStream( OUString::createFromAscii( m_pWwFib->fWhichTableStm ? SL::a1Table : SL::a0Table), - STREAM_STD_READ); + StreamMode::STD_READ); m_pTableStream = &rTableStream; m_pTableStream->SetEndian( SvStreamEndian::LITTLE ); rDataStream = m_pStg->OpenSotStream(OUString(SL::aData), - STREAM_STD_READ ); + StreamMode::STD_READ ); if (rDataStream.Is() && SVSTREAM_OK == rDataStream->GetError()) { @@ -5469,7 +5469,7 @@ namespace { utl::TempFile *pT = new utl::TempFile; pT->EnableKillingFile(); - rSt.Open(pT->GetFileName(), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE); + rSt.Open(pT->GetFileName(), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); return pT; } diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 867ea7ad54d2..4b68065876c6 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -83,7 +83,7 @@ static bool SwWw8ReadScaling(long& rX, long& rY, tools::SvRef<SotStorage>& rSrc1 // 0x34, 0x38, 0x3c, 0x40 Crop Left, Top, Right, Bot in tw tools::SvRef<SotStorageStream> xSrc3 = rSrc1->OpenSotStream( "\3PIC", - STREAM_STD_READ ); + StreamMode::STD_READ ); SotStorageStream* pS = xSrc3; pS->SetEndian( SvStreamEndian::LITTLE ); pS->Seek( STREAM_SEEK_TO_END ); @@ -128,7 +128,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp, tools::SvRef<SotStorage>& rSrc1) { tools::SvRef<SotStorageStream> xSrc2 = rSrc1->OpenSotStream( "\3META", - STREAM_STD_READ ); + StreamMode::STD_READ ); SotStorageStream* pSt = xSrc2; pSt->SetEndian( SvStreamEndian::LITTLE ); size_t const nRead = pSt->ReadBytes(pMfp, sizeof(*pMfp)); @@ -424,7 +424,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { tools::SvRef<SotStorageStream> xObjInfoSrc = xSrc1->OpenSotStream("\3ObjInfo", - STREAM_STD_READ ); + StreamMode::STD_READ ); if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() ) { sal_uInt8 nByte = 0; diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index c677afc681ce..a615eead2b72 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -641,7 +641,7 @@ IMPL_LINK_NOARG_TYPED(SwCreateAddressListDialog, OkHdl_Impl, Button*, void) } if(!m_sURL.isEmpty()) { - SfxMedium aMedium( m_sURL, STREAM_READWRITE|StreamMode::TRUNC ); + SfxMedium aMedium( m_sURL, StreamMode::READWRITE|StreamMode::TRUNC ); SvStream* pStream = aMedium.GetOutStream(); pStream->SetLineDelimiter( LINEEND_LF ); pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 60e0dd250bc7..ccdf15ef7f95 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1357,7 +1357,7 @@ IMPL_LINK_TYPED( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent&, rEvent, vo aAbs, sFileName, URIHelper::GetMaybeFileHdl() ); //load file and set the shell - SfxMedium aMedium( sFileName, STREAM_STD_READ ); + SfxMedium aMedium( sFileName, StreamMode::STD_READ ); sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); ::lcl_ReadSections(aMedium, *m_pSubRegionED); } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 096fc3f4f85a..6049e5d86767 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -4167,7 +4167,7 @@ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(vcl::Window* pParent, const OUString& rAu m_pEntriesBB->RowInserted(0); else { - SfxMedium aMed( sAutoMarkURL, STREAM_STD_READ ); + SfxMedium aMed( sAutoMarkURL, StreamMode::STD_READ ); if( aMed.GetInStream() && !aMed.GetInStream()->GetError() ) m_pEntriesBB->ReadEntries( *aMed.GetInStream() ); else diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 6f2249dfc9aa..6554b2689b51 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1413,7 +1413,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL, SfxFilterMatcher aMatcher( sFactory ); // search for filter in WebDocShell, too - SfxMedium aMed( rURL, STREAM_STD_READ ); + SfxMedium aMed( rURL, StreamMode::STD_READ ); std::shared_ptr<const SfxFilter> pFlt; aMatcher.DetectFilter( aMed, pFlt ); if(!pFlt) diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index fcb10e9a1705..ede3be4d7a6e 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -86,7 +86,7 @@ void SwChapterNumRules::Init() SvtPathOptions aOpt; if( aOpt.SearchFile( sNm )) { - SfxMedium aStrm( sNm, STREAM_STD_READ ); + SfxMedium aStrm( sNm, StreamMode::STD_READ ); sw::ImportStoredChapterNumberingRules(*this, *aStrm.GetInStream(), CHAPTER_FILENAME); } diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index d7d6c151f0ae..33d497a456da 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -874,7 +874,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, INetURLObject aTempFileURL( aTempFile.GetURL() ); SfxMedium* pDstMed = new SfxMedium( aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ), - STREAM_STD_READWRITE ); + StreamMode::STD_READWRITE ); bool bAnyError = !xTargetDocShell->DoSaveAs( *pDstMed ); // xObjectShell->DoSaveCompleted crashes the mail merge unit tests, so skip it bAnyError |= (0 != xTargetDocShell->GetError()); @@ -899,7 +899,7 @@ static bool lcl_SaveDoc( if( decodedURL ) (*decodedURL) = url; - SfxMedium* pDstMed = new SfxMedium( url, STREAM_STD_READWRITE ); + SfxMedium* pDstMed = new SfxMedium( url, StreamMode::STD_READWRITE ); pDstMed->SetFilter( pStoreToFilter ); if( pDstMed->GetItemSet() ) { diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 06f0a092d16b..f83659b7a3d0 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -707,7 +707,7 @@ uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /* else { Sequence<sal_Int8> aData; - SfxMedium aMedium( m_aURL, STREAM_STD_READ ); + SfxMedium aMedium( m_aURL, StreamMode::STD_READ ); SvStream* pStream = aMedium.GetInStream(); if ( aMedium.GetErrorCode() == ERRCODE_NONE && pStream) { diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index dc75047a9158..8341af327452 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2429,7 +2429,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, // or should the file be an ImageMap-File? ImageMap aMap; SfxMedium aMed( INetURLObject(aBkmk.GetURL()).GetFull(), - STREAM_STD_READ ); + StreamMode::STD_READ ); SvStream* pStream = aMed.GetInStream(); if( pStream != nullptr && !pStream->GetError() && diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index 2dc12033bd12..863fe2cf3b2b 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -131,7 +131,7 @@ BitmapEx GenerateStylePreview(SfxObjectShell& rSource, OUString& aName) BitmapEx CreatePreview(OUString& aUrl, OUString& aName) { - SfxMedium aMedium(aUrl, STREAM_STD_READWRITE); + SfxMedium aMedium(aUrl, StreamMode::STD_READWRITE); SfxObjectShell* pObjectShell = SfxObjectShell::Current(); SfxObjectShellLock xTemplDoc = SfxObjectShell::CreateObjectByFactoryName(pObjectShell->GetFactory().GetFactoryName(), SfxObjectCreateMode::ORGANIZER); xTemplDoc->DoInitNew(); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 07ba09615e36..0735970b5bd8 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -826,7 +826,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) SvtSaveOptions aOpt; { - SfxMedium aMedium( sFileURL,STREAM_READWRITE ); + SfxMedium aMedium( sFileURL,StreamMode::READWRITE ); SwWriter aWriter( aMedium, *pDocShell->GetDoc() ); WriterRef xWriter; ::GetHTMLWriter(OUString(), aMedium.GetBaseURL( true ), xWriter); diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index c955fccd12bf..4e926df2d9fe 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -260,7 +260,7 @@ xmlDocPtr MetafileXmlDump::dumpAndParse(const GDIMetaFile& rMetaFile, const OUSt if (rTempStreamName.isEmpty()) pStream.reset(new SvMemoryStream()); else - pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | StreamMode::TRUNC)); + pStream.reset(new SvFileStream(rTempStreamName, StreamMode::STD_READWRITE | StreamMode::TRUNC)); XmlWriter aWriter(pStream.get()); aWriter.startDocument(); diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index 9cc58ef8edea..6523c4c0c971 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -65,7 +65,7 @@ xmlDocPtr Primitive2dXmlDump::dumpAndParse( if (rTempStreamName.isEmpty()) pStream.reset(new SvMemoryStream()); else - pStream.reset(new SvFileStream(rTempStreamName, STREAM_STD_READWRITE | StreamMode::TRUNC)); + pStream.reset(new SvFileStream(rTempStreamName, StreamMode::STD_READWRITE | StreamMode::TRUNC)); XmlWriter aWriter(pStream.get()); aWriter.startDocument(); diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index aaf7a32fb227..c05ed9821c55 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -312,7 +312,7 @@ void OTempFileService::checkConnected () { if (!mpStream && mpTempFile) { - mpStream = mpTempFile->GetStream( STREAM_STD_READWRITE ); + mpStream = mpTempFile->GetStream( StreamMode::STD_READWRITE ); if ( mpStream && mbHasCachedPos ) { mpStream->Seek( sal::static_int_cast<sal_Size>(mnCachedPos) ); diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx index 3f49c3a38784..590fec1d8329 100644 --- a/vcl/source/app/brand.cxx +++ b/vcl/source/app/brand.cxx @@ -32,7 +32,7 @@ namespace { bool loadPng( const OUString & rPath, BitmapEx &rBitmap) { INetURLObject aObj( rPath ); - SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); + SvFileStream aStrm( aObj.PathToFileName(), StreamMode::STD_READ ); if ( !aStrm.GetError() ) { vcl::PNGReader aReader( aStrm ); rBitmap = aReader.Read(); diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 39ff4e21deb3..d9680e610aef 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -148,7 +148,7 @@ void GfxLink::SwapOut() if( !aURL.isEmpty() ) { std::shared_ptr<GfxLink::SwapOutData> pSwapOut = std::make_shared<SwapOutData>(aURL); // aURL is removed in the destructor - std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); + std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE )); if( xOStm ) { xOStm->WriteBytes( mpSwapInData.get(), mnSwapInDataSize ); @@ -267,7 +267,7 @@ std::shared_ptr<sal_uInt8> GfxLink::GetSwapInData() const std::shared_ptr<sal_uInt8> pData; - std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( mpSwapOutData->maURL, STREAM_READWRITE )); + std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( mpSwapOutData->maURL, StreamMode::READWRITE )); if( xIStm ) { pData = o3tl::make_shared_array<sal_uInt8>(mnSwapInDataSize); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 4d7a14fe64b3..bea44dc70438 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1129,7 +1129,7 @@ bool ImpGraphic::ImplSwapOut() std::unique_ptr<SvStream> xOStm; try { - xOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); + xOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE )); } catch( const css::uno::Exception& ) { @@ -1225,7 +1225,7 @@ bool ImpGraphic::ImplSwapIn() std::unique_ptr<SvStream> xIStm; try { - xIStm.reset(::utl::UcbStreamHelper::CreateStream( aSwapURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE )); + xIStm.reset(::utl::UcbStreamHelper::CreateStream( aSwapURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE )); } catch( const css::uno::Exception& ) { diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index 2efe52f332ee..76badae279ee 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -168,7 +168,7 @@ SvgData::SvgData(const OUString& rPath): maSequence(), maReplacement() { - SvFileStream rIStm(rPath, STREAM_STD_READ); + SvFileStream rIStm(rPath, StreamMode::STD_READ); if(rIStm.GetError()) return; const sal_uInt32 nStmLen(rIStm.remainingSize()); diff --git a/vcl/unx/gtk/salprn-gtk.cxx b/vcl/unx/gtk/salprn-gtk.cxx index cfba6bef5670..896640d22891 100644 --- a/vcl/unx/gtk/salprn-gtk.cxx +++ b/vcl/unx/gtk/salprn-gtk.cxx @@ -905,7 +905,7 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe if (xController.is()) xDoc.set(xController->getModel(), UNO_QUERY); - SvFileStream aStream(rFileURL, STREAM_READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC); + SvFileStream aStream(rFileURL, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC); uno::Reference< XOutputStream > xOStm(new utl::OOutputStreamWrapper(aStream)); uno::Reference< XExporter > xExport(xFilter, UNO_QUERY); diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index c5e344850475..d23fc6c77dad 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -227,7 +227,7 @@ void OLEStorageImpl::traverse(const tools::SvRef<SotStorage> &rStorage, const rt { const rtl::OUString aPath = concatPath(rPath, aIt->GetName()); SotStorageRefWrapper aStorage; - aStorage.ref = rStorage->OpenSotStorage(aIt->GetName(), STREAM_STD_READ); + aStorage.ref = rStorage->OpenSotStorage(aIt->GetName(), StreamMode::STD_READ); maStorageMap[aPath] = aStorage; // deep-first traversal @@ -245,7 +245,7 @@ tools::SvRef<SotStorageStream> OLEStorageImpl::createStream(const rtl::OUString const sal_Int32 nDelim = rPath.lastIndexOf(sal_Unicode('/')); if (-1 == nDelim) - return mxRootStorage.ref->OpenSotStream(rPath, STREAM_STD_READ); + return mxRootStorage.ref->OpenSotStream(rPath, StreamMode::STD_READ); const rtl::OUString aDir = rPath.copy(0, nDelim); const rtl::OUString aName = rPath.copy(nDelim + 1); @@ -255,7 +255,7 @@ tools::SvRef<SotStorageStream> OLEStorageImpl::createStream(const rtl::OUString if (maStorageMap.end() == aIt) return nullptr; - return aIt->second.ref->OpenSotStream(aName, STREAM_STD_READ); + return aIt->second.ref->OpenSotStream(aName, StreamMode::STD_READ); } } |