[Libreoffice-commits] core.git: avmedia/source basic/source canvas/source connectivity/source desktop/source editeng/source filter/source forms/source framework/source idl/source include/sot include/tools oox/source opencl/inc sc/qa sc/source sd/qa sd/source sfx2/source sot/source starmath/qa starmath/source svgio/source svl/source svtools/source svx/source sw/qa sw/source test/source unotools/source vcl/source vcl/unx writerperfect/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Sat Aug 27 12:06:38 UTC 2016


 avmedia/source/vlc/vlcframegrabber.cxx                      |    2 
 basic/source/basmgr/basmgr.cxx                              |    2 
 canvas/source/cairo/cairo_devicehelper.cxx                  |    2 
 canvas/source/vcl/devicehelper.cxx                          |    2 
 canvas/source/vcl/spritedevicehelper.cxx                    |    2 
 connectivity/source/drivers/dbase/DIndex.cxx                |    4 -
 connectivity/source/drivers/dbase/DTable.cxx                |    8 +--
 connectivity/source/drivers/flat/ETable.cxx                 |    2 
 desktop/source/migration/services/wordbookmigration.cxx     |    2 
 editeng/source/items/frmitems.cxx                           |    2 
 editeng/source/misc/svxacorr.cxx                            |   16 +++---
 filter/source/msfilter/msdffimp.cxx                         |    6 +-
 filter/source/msfilter/msoleexp.cxx                         |    2 
 filter/source/msfilter/svdfppt.cxx                          |    6 +-
 filter/source/msfilter/svxmsbas2.cxx                        |    6 +-
 forms/source/component/clickableimage.cxx                   |    2 
 forms/source/component/imgprod.cxx                          |    2 
 framework/source/fwe/classes/addonsoptions.cxx              |    4 -
 framework/source/uielement/imagebuttontoolbarcontroller.cxx |    2 
 idl/source/cmptools/lex.cxx                                 |    2 
 idl/source/prj/command.cxx                                  |    2 
 idl/source/prj/svidl.cxx                                    |   10 ++--
 include/sot/stg.hxx                                         |   26 +++++------
 include/sot/storage.hxx                                     |   12 ++---
 include/tools/stream.hxx                                    |   13 ++---
 oox/source/drawingml/fillpropertiesgroupcontext.cxx         |    2 
 oox/source/ole/vbaexport.cxx                                |   28 ++++++------
 opencl/inc/opencl_device_selection.h                        |    2 
 sc/qa/unit/helper/qahelper.cxx                              |    6 +-
 sc/qa/unit/subsequent_export-test.cxx                       |    2 
 sc/qa/unit/subsequent_filters-test.cxx                      |    2 
 sc/qa/unit/ucalc.cxx                                        |    4 -
 sc/qa/unit/ucalc_formula.cxx                                |    6 +-
 sc/qa/unit/ucalc_sharedformula.cxx                          |    2 
 sc/source/filter/excel/excimp8.cxx                          |    2 
 sc/source/filter/excel/xeescher.cxx                         |    2 
 sc/source/filter/ftools/ftools.cxx                          |    8 +--
 sc/source/filter/lotus/lotus.cxx                            |    2 
 sc/source/filter/xcl97/xcl97esc.cxx                         |    2 
 sc/source/ui/docshell/docsh4.cxx                            |    2 
 sc/source/ui/docshell/externalrefmgr.cxx                    |    2 
 sc/source/ui/docshell/tablink.cxx                           |    6 +-
 sd/qa/unit/filters-test.cxx                                 |    2 
 sd/qa/unit/sdmodeltestbase.hxx                              |    6 +-
 sd/source/filter/ppt/pptin.cxx                              |    8 +--
 sd/source/filter/ppt/propread.cxx                           |    2 
 sd/source/filter/sdpptwrp.cxx                               |    4 -
 sd/source/ui/app/sdmod.cxx                                  |    2 
 sfx2/source/appl/appopen.cxx                                |    2 
 sfx2/source/appl/fileobj.cxx                                |    2 
 sfx2/source/appl/xpackcreator.cxx                           |    2 
 sfx2/source/doc/docfile.cxx                                 |    2 
 sfx2/source/doc/graphhelp.cxx                               |    2 
 sfx2/source/doc/objcont.cxx                                 |    2 
 sfx2/source/doc/objstor.cxx                                 |    4 -
 sfx2/source/doc/oleprops.cxx                                |    4 -
 sfx2/source/inc/openflag.hxx                                |    2 
 sot/source/sdstor/stg.cxx                                   |    8 +--
 sot/source/sdstor/stgstrms.cxx                              |    2 
 sot/source/sdstor/storage.cxx                               |    2 
 sot/source/sdstor/ucbstorage.cxx                            |   20 ++++----
 starmath/qa/extras/mmlexport-test.cxx                       |    2 
 starmath/qa/extras/mmlimport-test.cxx                       |    2 
 starmath/source/eqnolefilehdr.cxx                           |    2 
 starmath/source/mathtype.cxx                                |    2 
 svgio/source/svgreader/svgimagenode.cxx                     |    2 
 svl/source/fsstor/fsstorage.cxx                             |    4 -
 svtools/source/misc/embedtransfer.cxx                       |    2 
 svtools/source/misc/imagemgr.cxx                            |    2 
 svtools/source/misc/transfer.cxx                            |    4 -
 svx/source/gallery2/galtheme.cxx                            |    4 -
 svx/source/svdraw/svdograf.cxx                              |    2 
 svx/source/xml/xmleohlp.cxx                                 |    2 
 sw/qa/core/filters-test.cxx                                 |    4 -
 sw/qa/core/uwriter.cxx                                      |    2 
 sw/source/core/doc/docglbl.cxx                              |    2 
 sw/source/core/doc/tblafmt.cxx                              |    4 -
 sw/source/core/edit/edtox.cxx                               |    2 
 sw/source/core/swg/SwXMLTextBlocks.cxx                      |    2 
 sw/source/filter/basflt/iodetect.cxx                        |    4 -
 sw/source/filter/ww8/wrtww8.cxx                             |   10 ++--
 sw/source/filter/ww8/ww8glsy.cxx                            |    2 
 sw/source/filter/ww8/ww8par.cxx                             |   10 ++--
 sw/source/filter/ww8/ww8par4.cxx                            |    6 +-
 sw/source/ui/dbui/createaddresslistdialog.cxx               |    2 
 sw/source/ui/dialog/uiregionsw.cxx                          |    2 
 sw/source/ui/index/cnttab.cxx                               |    2 
 sw/source/uibase/app/docsh2.cxx                             |    2 
 sw/source/uibase/config/uinums.cxx                          |    2 
 sw/source/uibase/dbui/dbmgr.cxx                             |    4 -
 sw/source/uibase/dbui/mailmergehelper.cxx                   |    2 
 sw/source/uibase/dochdl/swdtflvr.cxx                        |    2 
 sw/source/uibase/sidebar/StylePresetsPanel.cxx              |    2 
 sw/source/uibase/uiview/srcview.cxx                         |    2 
 test/source/mtfxmldump.cxx                                  |    2 
 test/source/primitive2dxmldump.cxx                          |    2 
 unotools/source/ucbhelper/xtempfile.cxx                     |    2 
 vcl/source/app/brand.cxx                                    |    2 
 vcl/source/gdi/gfxlink.cxx                                  |    4 -
 vcl/source/gdi/impgraph.cxx                                 |    4 -
 vcl/source/gdi/svgdata.cxx                                  |    2 
 vcl/unx/gtk/salprn-gtk.cxx                                  |    2 
 writerperfect/source/common/WPXSvInputStream.cxx            |    6 +-
 103 files changed, 211 insertions(+), 212 deletions(-)

New commits:
commit 33b38082ca63813f7c478945be198cc504efde4b
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sat Aug 27 10:18:06 2016 +0200

    put StreamMode masks in scope of enum class
    
    Change-Id: I77682f7e289a59b986bb84edf014029a20266470
    Reviewed-on: https://gerrit.libreoffice.org/28420
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index beb0ed9..a21af8e 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 4aa4f1b..cfbcd56 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 0400c2c..d2ea841 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 a833cd1..7447cef 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 ec0feee..2b484f8 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 f5f4c49..0e8caed 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 4c39e43..4e9b60a 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 ac0ca35..dfa9baa 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 429039b..a7a0232 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 eda2aed..6af4e49 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 5948e09..08cc36e 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 631d9bc..5e8b22a 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 9c56db1..0e0fd26 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 6e31104..7bf2191 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 0c04ff7..e9aa277 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 3de2652..f384978 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 ad635ab..e90bbfc 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 9deffd4..054dc95 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 11d6163..39db8a0 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 56d696a..9774991 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 fb5e9d7..41ea28b 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 96c651e..aa517f6 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 ada5c7e..2654fd7 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 25f0a39..d2e56c6 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 7d5726a..19d756b 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 ecfdb33..c8009f8 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 a882511..80e1353 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 0b0ee4e..c878a5b 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 e3493a1..7e74465 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 18deabd..ab17fa4 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 cef4fef..c538ec7 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 19c9460..9546694 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 6322c14..4810569 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 e9833a2..6a9a000 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 91f9d80..87c478e 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 11c0705..e340ff8 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 d17e48a..1a8e3cf 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 8fcc421..9267caf 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 6b48b87..7c2d39f 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 b9dff30..0c20301 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 e2f100e..663cbd4 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 78869f9..9cd8ea2 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 c08f6c0..647f9dd 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 cf7337f..8fc2b3a 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 ce1b85f..40c51d0 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 9e7d16c..f91888b 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 049d3da..d64a1e1 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 f665d7f..9f0ff7d 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 bcae942..5b0fddd 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 1460787..edcc979 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 49f3422..5297d92 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 301a026..42b1fda 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 f5fb3c6..e4e6cc7 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 bac439a..03aaa3a 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 15fd9db..eec5ca7 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 71e0e98..027c0b7 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 ddae32c..3bdfb34 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 ab256fd..26703ff 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 521c6cf..92473d0 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 6ff2bf8..3d26f5c 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 b610539..7ea86ab 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 ce1a467..f13ee9d 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 846ea87..fcb6be9 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 0465149..3cac2b3 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 f39843e..92aa6c4 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 533389d..5d7735f 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 08561f0..cbcc682 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 c133fe2..8dab2ac 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 bbc70f4..f4ff924 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 0dc040e..216ae9e 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 7194757..81a7a6a 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 bb9211c..c2b40ac 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 cd5fc11..3762d5e 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 e8ddc2a..b8cb7c5 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 aa83021..2469e98 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 edc1aaf..eec9775 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 d44ebcb..38824b2 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 fcb9ec2..eb00641 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 1ecf8d3..ef21814 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 8de8f0d..55a6239 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 843f45c..3b23221 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 cb89dfb..1df65d0 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 32f40ba..0c95f22 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 867ea7a..4b68065 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 c677afc..a615eea 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list