Kaydet (Commit) 0cc70223 authored tarafından Noel Grandin's avatar Noel Grandin

use unique_ptr in SfxObjectShell_Impl

Change-Id: I3f3b0514bdb87f59d9c5f34d2d36dc63e8b1e33d
Reviewed-on: https://gerrit.libreoffice.org/64527
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a8694d21
...@@ -985,13 +985,12 @@ void SfxObjectShell::CheckForBrokenDocSignatures_Impl() ...@@ -985,13 +985,12 @@ void SfxObjectShell::CheckForBrokenDocSignatures_Impl()
void SfxObjectShell::SetAutoLoad( void SfxObjectShell::SetAutoLoad(
const INetURLObject& rUrl, sal_uInt32 nTime, bool bReload ) const INetURLObject& rUrl, sal_uInt32 nTime, bool bReload )
{ {
if ( pImpl->pReloadTimer ) pImpl->pReloadTimer.reset();
DELETEZ(pImpl->pReloadTimer);
if ( bReload ) if ( bReload )
{ {
pImpl->pReloadTimer = new AutoReloadTimer_Impl( pImpl->pReloadTimer.reset(new AutoReloadTimer_Impl(
rUrl.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ), rUrl.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ),
nTime, this ); nTime, this ));
pImpl->pReloadTimer->Start(); pImpl->pReloadTimer->Start();
} }
} }
......
...@@ -233,7 +233,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ...@@ -233,7 +233,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bConfigOptionsChecked( false ) ,m_bConfigOptionsChecked( false )
,lErr(ERRCODE_NONE) ,lErr(ERRCODE_NONE)
,nEventId ( SfxEventHintId::NONE ) ,nEventId ( SfxEventHintId::NONE )
,pReloadTimer ( nullptr)
,nLoadedFlags ( SfxLoadedFlags::ALL ) ,nLoadedFlags ( SfxLoadedFlags::ALL )
,nFlagsInProgress( SfxLoadedFlags::NONE ) ,nFlagsInProgress( SfxLoadedFlags::NONE )
,bModalMode( false ) ,bModalMode( false )
...@@ -310,7 +309,7 @@ SfxObjectShell::~SfxObjectShell() ...@@ -310,7 +309,7 @@ SfxObjectShell::~SfxObjectShell()
SfxObjectShell::CloseInternal(); SfxObjectShell::CloseInternal();
pImpl->pBaseModel.set( nullptr ); pImpl->pBaseModel.set( nullptr );
DELETEZ( pImpl->pReloadTimer ); pImpl->pReloadTimer.reset();
SfxApplication *pSfxApp = SfxGetpApp(); SfxApplication *pSfxApp = SfxGetpApp();
if ( USHRT_MAX != pImpl->nVisualDocumentNumber && pSfxApp ) if ( USHRT_MAX != pImpl->nVisualDocumentNumber && pSfxApp )
......
...@@ -96,7 +96,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess ...@@ -96,7 +96,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
ErrCode lErr; ErrCode lErr;
SfxEventHintId nEventId; // If Open/Create as to be sent SfxEventHintId nEventId; // If Open/Create as to be sent
// before Activate // before Activate
AutoReloadTimer_Impl *pReloadTimer; std::unique_ptr<AutoReloadTimer_Impl> pReloadTimer;
SfxLoadedFlags nLoadedFlags; SfxLoadedFlags nLoadedFlags;
SfxLoadedFlags nFlagsInProgress; SfxLoadedFlags nFlagsInProgress;
bool bModalMode; bool bModalMode;
......
...@@ -614,7 +614,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) ...@@ -614,7 +614,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
pView = GetNext( *pView, xOldObj ); pView = GetNext( *pView, xOldObj );
} }
DELETEZ( xOldObj->Get_Impl()->pReloadTimer ); xOldObj->Get_Impl()->pReloadTimer.reset();
std::unique_ptr<SfxItemSet> pNewSet; std::unique_ptr<SfxItemSet> pNewSet;
std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter(); std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter();
......
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