Kaydet (Commit) 44c75946 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ScAccessiblePreviewHeaderCellTextData

Change-Id: I18764ca8ca2e0a78d68005c7604809990afa63ce
Reviewed-on: https://gerrit.libreoffice.org/52760Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 57444485
......@@ -1214,7 +1214,7 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData()
{
if (pEditEngine)
pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
delete mpViewForwarder;
mpViewForwarder.reset();
}
void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
......@@ -1286,8 +1286,8 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder()
{
if (!mpViewForwarder)
mpViewForwarder = new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos, mbColHeader);
return mpViewForwarder;
mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos, mbColHeader));
return mpViewForwarder.get();
}
ScDocShell* ScAccessiblePreviewHeaderCellTextData::GetDocShell(ScPreviewShell* pViewShell)
......
......@@ -187,7 +187,7 @@ public:
virtual SvxEditViewForwarder* GetEditViewForwarder( bool /* bCreate */ ) override { return nullptr; }
private:
ScPreviewViewForwarder* mpViewForwarder;
std::unique_ptr<ScPreviewViewForwarder> mpViewForwarder;
ScPreviewShell* mpViewShell;
OUString maText;
bool mbColHeader;
......
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