Kaydet (Commit) 3385b0da authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Minor utl::TempFile clean up

Change-Id: I20de8b2321d2656d17d25c6343d72c534d47e597
üst 22aa9fce
...@@ -285,7 +285,6 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData ...@@ -285,7 +285,6 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData
{ {
// now we need to copy the stream // now we need to copy the stream
::utl::TempFile aTmp; ::utl::TempFile aTmp;
aTmp.EnableKillingFile(false);
_rAsyncDrop.aUrl = aTmp.GetURL(); _rAsyncDrop.aUrl = aTmp.GetURL();
SotStorageStreamRef aNew = new SotStorageStream( aTmp.GetFileName() ); SotStorageStreamRef aNew = new SotStorageStream( aTmp.GetFileName() );
_rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN); _rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN);
......
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false); TempFile( const OUString& rLeadingChars, bool _bStartWithZero=true, const OUString* pExtension=NULL, const OUString* pParent=NULL, bool bDirectory=false);
/** /**
TempFile will be removed from disk in dtor if EnableKillingTempFile was called before. TempFile will be removed from disk in dtor if EnableKillingFile(true) was called before.
Temporary directories will be removed recursively in that case. Temporary directories will be removed recursively in that case.
*/ */
~TempFile(); ~TempFile();
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
/** /**
Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this Returns a stream to the tempfiles data; the stream is owned by the tempfile object, so you have to keep this
alive as long as you want to use the stream. If the TempFile object is destroyed, it also destroys the alive as long as you want to use the stream. If the TempFile object is destroyed, it also destroys the
stream object, the underlying file is only deleted if EnableKillingFile( sal_True ) has been called before! stream object, the underlying file is only deleted if EnableKillingFile(true) has been called before!
*/ */
SvStream* GetStream( StreamMode eMode ); SvStream* GetStream( StreamMode eMode );
...@@ -120,9 +120,6 @@ public: ...@@ -120,9 +120,6 @@ public:
void EnableKillingFile( bool bEnable=true ) void EnableKillingFile( bool bEnable=true )
{ bKillingFileEnabled = bEnable; } { bKillingFileEnabled = bEnable; }
bool IsKillingFileEnabled() const
{ return bKillingFileEnabled; }
/** /**
Only create a "physical" file name for a temporary file that would be valid at that moment. Only create a "physical" file name for a temporary file that would be valid at that moment.
Should only be used for 3rd party code with a file name interface that wants to create the file by itself. Should only be used for 3rd party code with a file name interface that wants to create the file by itself.
......
...@@ -2036,7 +2036,6 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont ...@@ -2036,7 +2036,6 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
return; // the backup was done already return; // the backup was done already
::utl::TempFile aTransactTemp( aPrefix, true, &aExtension, &aDestDir ); ::utl::TempFile aTransactTemp( aPrefix, true, &aExtension, &aDestDir );
aTransactTemp.EnableKillingFile( false );
INetURLObject aBackObj( aTransactTemp.GetURL() ); INetURLObject aBackObj( aTransactTemp.GetURL() );
OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); OUString aBackupName = aBackObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
...@@ -2063,7 +2062,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont ...@@ -2063,7 +2062,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
} }
if ( pImp->m_aBackupURL.isEmpty() ) if ( pImp->m_aBackupURL.isEmpty() )
aTransactTemp.EnableKillingFile( true ); aTransactTemp.EnableKillingFile();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment