diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-05-24 11:38:12 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-05-24 11:38:12 +0200 |
commit | 683312377a294e9dbe0a96b7b1b489e3d5b4f1f7 (patch) | |
tree | 41de4a50becb801246dc2001eae20702c474e04f /sfx2 | |
parent | 226b81d0f300a62da9351d1fc011b88f93f0b2b0 (diff) |
Removed unused SfxMedium::bDirect
See the TODO comment in sfx2/inc/sfx2/docfile.hxx about a temporary SfxMedium
ctor overload to find not yet adapted uses of another overload, to be removed
again in due time.
Change-Id: Ie22c33c32f8870ce6ebf6d500abc7a4e33d97183
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/docfile.hxx | 18 | ||||
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/docinsert.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 4 |
10 files changed, 28 insertions, 25 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 70fae05fb33b..f7f85d5502c5 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -77,8 +77,7 @@ class DateTime; class SFX2_DLLPUBLIC SfxMedium : public SvRefBase { sal_uInt32 eError; - sal_Bool bDirect:1, - bRoot:1, + sal_Bool bRoot:1, bSetFilter:1, bTriedStorage; StreamMode nStorOpenMode; @@ -113,9 +112,19 @@ public: SfxMedium(); SfxMedium( const String &rName, StreamMode nOpenMode, - sal_Bool bDirect=sal_False, const SfxFilter *pFilter = 0, SfxItemSet *pSet = 0 ); + //TODO: the next, non-defined overload is only there to + // detect uses of the above (String, StreamMode, etc.) + // overload from when it still had an additional third + // parameter sal_Bool bDirect, where now a leftover + // "false" or "sal_False" could be mistaken for a null + // pointer argument for the pFilter parameter; it can be + // removed once we are confident all old uses of the + // original overload have been adapted (in platform + // specific code etc.): + SfxMedium(String const &, StreamMode, void *) + /* = delete */; SfxMedium( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const String& rBaseURL, @@ -178,8 +187,7 @@ public: void CloseStorage(); StreamMode GetOpenMode() const { return nStorOpenMode; } - void SetOpenMode( StreamMode nStorOpen, sal_Bool bDirect, sal_Bool bDontClose = sal_False ); - sal_Bool IsDirect() const { return bDirect? sal_True: sal_False; } + void SetOpenMode( StreamMode nStorOpen, sal_Bool bDontClose = sal_False ); SvStream* GetInStream(); SvStream* GetOutStream(); diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 33b5183b0e13..15fe9047173e 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -404,7 +404,7 @@ sal_uInt32 CheckPasswd_Impl sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFileName, sal_Bool bCopy, SfxItemSet* pSet ) { const SfxFilter* pFilter = NULL; - SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), sal_False ); + SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ) ); if ( !aMedium.GetStorage( sal_True ).is() ) aMedium.GetInStream(); @@ -460,7 +460,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String if ( !xDoc.Is() ) xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() ); - SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, sal_False, pFilter, pSet ); + SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_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 d9190d6162bc..d0fe61ebe5f3 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -270,7 +270,7 @@ sal_Bool SvFileObject::LoadFile_Impl() return sal_False; // at the moment on the current DocShell - xMed = new SfxMedium( sFileNm, STREAM_STD_READ, sal_True ); + xMed = new SfxMedium( sFileNm, STREAM_STD_READ ); SvLinkSource::StreamToLoadFrom aStreamToLoadFrom = getStreamToLoadFrom(); xMed->setStreamToLoadFrom( diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index a0dc6e435932..cfc00a72a314 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -138,7 +138,7 @@ short SvxOpenGraphicDialog::Execute() // non-local? if ( INET_PROT_FILE != aObj.GetProtocol() ) { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, sal_True ); + SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); aMed.DownLoad(); SvStream* pStream = aMed.GetInStream(); diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 6a3fee662876..51d597f6164c 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -242,7 +242,7 @@ void SfxHTMLParser::StartFileDownload( const String& rURL, if( pDLMedium ) return; - pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY, sal_False ); + pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY ); if( pSh ) { // Register the medium, so that it can be stopped. diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 2daebaee8c3f..4da155678152 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -360,7 +360,6 @@ SfxMedium_Impl::~SfxMedium_Impl() #define IMPL_CTOR(rootVal,URLVal) \ eError( SVSTREAM_OK ), \ \ - bDirect( sal_False ), \ bRoot( rootVal ), \ bSetFilter( sal_False ), \ bTriedStorage( sal_False ), \ @@ -1480,7 +1479,6 @@ sal_Bool SfxMedium::WillDisposeStorageOnClose_Impl() //------------------------------------------------------------------ void SfxMedium::SetOpenMode( StreamMode nStorOpen, - sal_Bool bDirectP, sal_Bool bDontClose ) { if ( nStorOpenMode != nStorOpen ) @@ -1496,7 +1494,6 @@ void SfxMedium::SetOpenMode( StreamMode nStorOpen, } } - bDirect = bDirectP; bSetFilter = sal_False; } @@ -2821,7 +2818,7 @@ void SfxMedium::CompleteReOpen() //------------------------------------------------------------------ SfxMedium::SfxMedium ( - const String &rName, StreamMode nOpenMode, sal_Bool bDirectP, + const String &rName, StreamMode nOpenMode, const SfxFilter *pFlt, SfxItemSet *pInSet ) : IMPL_CTOR( sal_False, 0 ), // bRoot, pURLObj @@ -2831,7 +2828,6 @@ SfxMedium::SfxMedium { aLogicName = rName; nStorOpenMode = nOpenMode; - bDirect = bDirectP; Init_Impl(); } @@ -2887,7 +2883,6 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b if (!pFileNameItem) throw uno::RuntimeException(); aLogicName = pFileNameItem->GetValue(); nStorOpenMode = bReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE; - bDirect = sal_False; Init_Impl(); } diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index 8ad6af137945..a9629aaaf73c 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -98,7 +98,7 @@ SfxMedium* DocumentInserter::CreateMedium() DBG_ASSERT( m_pURLList.size() == 1, "DocumentInserter::CreateMedium(): invalid URL list count" ); String sURL(m_pURLList[0]); pMedium = new SfxMedium( - sURL, SFX_STREAM_READONLY, sal_False, + sURL, SFX_STREAM_READONLY, SFX_APP()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_pItemSet ); pMedium->UseInteractionHandler( sal_True ); SfxFilterMatcher* pMatcher = NULL; @@ -131,7 +131,7 @@ SfxMediumList* DocumentInserter::CreateMediumList() for(std::vector<rtl::OUString>::const_iterator i = m_pURLList.begin(); i != m_pURLList.end(); ++i) { SfxMedium* pMedium = new SfxMedium( - *i, SFX_STREAM_READONLY, sal_False, + *i, SFX_STREAM_READONLY, SFX_APP()->GetFilterMatcher().GetFilter4FilterName( m_sFilter ), m_pItemSet ); pMedium->UseInteractionHandler( sal_True ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 900858c1f923..037f4bcc2504 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -442,7 +442,7 @@ void SfxObjectShell::SetReadOnly() if ( !pMedium->HasStorage_Impl() && IsLoadingFinished() ) pMedium->CloseInStream(); - pMedium->SetOpenMode( SFX_STREAM_READONLY, pMedium->IsDirect(), sal_True ); + pMedium->SetOpenMode( SFX_STREAM_READONLY, sal_True ); pMedium->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) ); if ( !bWasROUI ) @@ -1402,7 +1402,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad() // templates are never readonly pTmpMedium->GetItemSet()->ClearItem( SID_DOC_READONLY ); - pTmpMedium->SetOpenMode( SFX_STREAM_READWRITE, sal_True, sal_True ); + pTmpMedium->SetOpenMode( SFX_STREAM_READWRITE, sal_True ); // notifications about possible changes in readonly state and document info Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d8406dcdb6c2..313d95d19054 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2421,7 +2421,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) // create a medium as a copy; this medium is only for writingm, because it // uses the same name as the original one writing is done through a copy, // that will be transferred to the target (of course after calling HandsOff) - SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pRetrMedium->IsDirect(), pFilter, pSet ); + SfxMedium* pMediumTmp = new SfxMedium( pRetrMedium->GetName(), pRetrMedium->GetOpenMode(), pFilter, pSet ); pMediumTmp->SetLongName( pRetrMedium->GetLongName() ); if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE ) { @@ -2504,7 +2504,7 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) pFilter = SfxFilterMatcher( String::CreateFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( - pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, sal_False, pFilter ); + pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, pFilter ); SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False ); if ( pPasswordItem ) @@ -2710,7 +2710,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl pParams = pMergedParams; // create a medium for the target URL - SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, sal_False, 0, pParams ); + SfxMedium *pNewFile = new SfxMedium( rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, 0, pParams ); // set filter; if no filter is given, take the default filter of the factory if ( aFilterName.Len() ) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 34929e20702c..579a10d17fe9 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -472,7 +472,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pMed->CloseAndRelease(); pMed->GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, !( nOpenMode & STREAM_WRITE ) ) ); - pMed->SetOpenMode( nOpenMode, pMed->IsDirect() ); + pMed->SetOpenMode( nOpenMode ); pMed->CompleteReOpen(); if ( nOpenMode & STREAM_WRITE ) @@ -493,7 +493,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) else { pMed->ResetError(); - pMed->SetOpenMode( SFX_STREAM_READONLY, pMed->IsDirect() ); + pMed->SetOpenMode( SFX_STREAM_READONLY ); pMed->ReOpen(); pSh->DoSaveCompleted( pMed ); } |