Referer was set to SfxMedium but was never used. Removing it.

Change-Id: I88ab874d4efc60d58722f0bb175d14a4d443398b
This commit is contained in:
Kohei Yoshida 2012-07-25 16:23:13 -04:00
parent dd41664543
commit 73bc1c8b7a
11 changed files with 2 additions and 67 deletions

View file

@ -790,26 +790,12 @@ namespace frm
#ifdef USE_REGISTER_TRANSFER
if( pObjSh )
{
// Medium registrieren, damit abgebrochen werden kann
pObjSh->RegisterTransfer( *m_pMedium );
// Target-Frame uebertragen, damit auch javascript:-URLs
// "geladen" werden koennen.
const SfxMedium *pShMedium = pObjSh->GetMedium();
if( pShMedium )
m_pMedium->SetLoadTargetFrame(pShMedium->GetLoadTargetFrame());
}
else
{
// Keine Object-Shell, aber ein Medium? Dann uebernehmen wir
// zumindest den Referer.
if( xModel.is() )
{
::rtl::OUString sReferer( xModel->getURL() );
if( sReferer.getLength() )
m_pMedium->SetReferer( OUStringToString(sReferer, CHARSET_SYSTEM) );
}
}
#else
if( pObjSh )
{
@ -819,13 +805,6 @@ namespace frm
if( pShMedium )
m_pMedium->SetLoadTargetFrame(pShMedium->GetLoadTargetFrame());
}
if( xModel.is() )
{
::rtl::OUString sReferer( xModel->getURL() );
if( !sReferer.isEmpty() )
m_pMedium->SetReferer( sReferer );
}
#endif
// Downloading-Flag auf sal_True setzen. Es werden dann auch

View file

@ -122,7 +122,6 @@ public:
void SetLoadTargetFrame(SfxFrame* pFrame );
SfxFrame* GetLoadTargetFrame() const;
void SetReferer( const String& rRefer );
void SetFilter(const SfxFilter *pFlt, sal_Bool bResetOrig = sal_False);
const SfxFilter* GetFilter() const;
const SfxFilter * GetOrigFilter( sal_Bool bNotCurrent = sal_False ) const;

View file

@ -433,7 +433,6 @@ public:
// Transfer IFace
void AbortImport();
sal_Bool IsAbortingImport() const;
void RegisterTransfer( SfxMedium& rMedium );
sal_Bool IsReloading() const;
void FinishedLoading( sal_uInt16 nWhich = SFX_LOADED_ALL );
void TemplateDisconnectionAfterLoad();

View file

@ -267,8 +267,6 @@ sal_Bool SvFileObject::LoadFile_Impl()
xMed->setStreamToLoadFrom(
aStreamToLoadFrom.m_xInputStreamToLoadFrom,
aStreamToLoadFrom.m_bIsReadOnly);
if( sReferer.Len() )
xMed->SetReferer( sReferer );
if( !bSynchron )
{

View file

@ -225,21 +225,13 @@ IMAPOBJ_SETEVENT:
return bNewArea;
}
void SfxHTMLParser::StartFileDownload( const String& rURL,
SfxObjectShell *pSh )
void SfxHTMLParser::StartFileDownload( const String& rURL, SfxObjectShell* /*pSh*/ )
{
DBG_ASSERT( !pDLMedium, "StartFileDownload when active Download" );
if( pDLMedium )
return;
pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY );
if( pSh )
{
// Register the medium, so that it can be stopped.
pSh->RegisterTransfer( *pDLMedium );
}
pDLMedium->DownLoad();
}

View file

@ -287,7 +287,6 @@ public:
const SfxFilter* pOrigFilter;
rtl::OUString aOrigURL;
String aReferer;
DateTime aExpireTime;
SfxFrameWeak wLoadTargetFrame;
SvKeyValueIteratorRef xAttributes;
@ -3007,15 +3006,6 @@ const INetURLObject& SfxMedium::GetURLObject() const
return *pImp->m_pURLObj;
}
//----------------------------------------------------------------
void SfxMedium::SetReferer( const String& rRefer )
{
pImp->aReferer = rRefer;
}
//----------------------------------------------------------------
void SfxMedium::SetExpired_Impl( const DateTime& rDateTime )
{
pImp->aExpireTime = rDateTime;

View file

@ -1043,20 +1043,6 @@ void SfxObjectShell::SetActivateEvent_Impl(sal_uInt16 nId )
pImp->nEventId = nId;
}
//--------------------------------------------------------------------
void SfxObjectShell::RegisterTransfer( SfxMedium& rMedium )
/* [Description]
All media, which are placed in order to load parts of a document must be
registered by a related SfxObjectShell. Thus documents can be canceled.
*/
{
rMedium.SetReferer( GetMedium()->GetName() );
}
//-------------------------------------------------------------------------
void SfxObjectShell::PrepareReload( )
/* [Description]

View file

@ -1622,9 +1622,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl
AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Medium commit." ) );
// transfer data to its destinated location
// the medium commits the storage or the stream it is based on
RegisterTransfer( rMedium );
bOk = rMedium.Commit();
if ( bOk )

View file

@ -875,7 +875,6 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
// this sourcecode is not responsible for the lifetime of the shell, SfxObjectShellLock should not be used
SfxObjectShellRef aRef( pDocSh );
pDocSh->RegisterTransfer( *pMed );
pMed->DownLoad(); // if necessary: start the download
if( aRef.Is() && 1 < aRef->GetRefCount() ) // Ref still valid?
{

View file

@ -1742,10 +1742,6 @@ sal_Bool SwHTMLParser::FileDownload( const String& rURL,
// Ein Medium anlegen
SfxMedium aDLMedium( rURL, STREAM_READ | STREAM_SHARE_DENYWRITE );
// Medium registrieren, damit abgebrochen werden kann
if( pDoc->GetDocShell() )
pDoc->GetDocShell()->RegisterTransfer( aDLMedium );
SvStream* pStream = aDLMedium.GetInStream();
if( pStream )
{

View file

@ -2032,7 +2032,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
delete pMedium;
return -1;
}
pDocSh->RegisterTransfer( *pMedium );
pMedium->DownLoad(); // ggfs. den DownLoad anstossen
if( aRef.Is() && 1 < aRef->GetRefCount() ) // noch gueltige Ref?
{