Kaydet (Commit) 605f6d48 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TemplateFolderCacheImpl

Change-Id: I90749ac49fcd0194ec43b4dc23efd66484a3bed4
Reviewed-on: https://gerrit.libreoffice.org/53601Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 22077670
......@@ -379,7 +379,7 @@ namespace svt
// will be lazy inited; never access directly; use getOfficeInstDirs().
uno::Reference< util::XOfficeInstallationDirectories > m_xOfficeInstDirs;
SvStream* m_pCacheStream;
std::unique_ptr<SvStream> m_pCacheStream;
bool m_bNeedsUpdate : 1;
bool m_bKnowState : 1;
bool m_bValidCurrentState : 1;
......@@ -518,7 +518,7 @@ namespace svt
void TemplateFolderCacheImpl::closeCacheStream( )
{
DELETEZ( m_pCacheStream );
m_pCacheStream.reset();
}
......@@ -704,12 +704,12 @@ namespace svt
aStorageURL.Append( ".templdir.cache" );
// open the stream
m_pCacheStream = UcbStreamHelper::CreateStream( aStorageURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ),
_bForRead ? StreamMode::READ | StreamMode::NOCREATE : StreamMode::WRITE | StreamMode::TRUNC );
m_pCacheStream.reset( UcbStreamHelper::CreateStream( aStorageURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ),
_bForRead ? StreamMode::READ | StreamMode::NOCREATE : StreamMode::WRITE | StreamMode::TRUNC ) );
DBG_ASSERT( m_pCacheStream, "TemplateFolderCacheImpl::openCacheStream: could not open/create the cache stream!" );
if ( m_pCacheStream && m_pCacheStream->GetErrorCode() )
{
DELETEZ( m_pCacheStream );
m_pCacheStream.reset();
}
if ( m_pCacheStream )
......
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