summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview5.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-06 19:25:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-07 07:51:25 +0200
commite040894fbe0765883e13d51fd6d6331adb09832c (patch)
treed3cc19ec7add92ed751d7051b6cc52e15d91899a /sc/source/ui/view/tabview5.cxx
parentd5c6087979a6a01c16eff6dab15b4b94770a2c14 (diff)
tdf#118554 sc crash clicking outside of comments
regression from commit c7f762973d21118ce3f5b0baab8850dc89bc4765 loplugin:useuniqueptr in ScTabView Change-Id: If7fd580f1a2fedbc6b707f59f196cbceffc95fe3 Reviewed-on: https://gerrit.libreoffice.org/57090 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/tabview5.cxx')
-rw-r--r--sc/source/ui/view/tabview5.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 6900ce9fc430..962fc20e5c9f 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -131,6 +131,7 @@ void ScTabView::Init()
// UpdateShow is done during resize or a copy of an existing view from ctor
pDrawActual = nullptr;
+ pDrawOld = nullptr;
// DrawView cannot be create in the TabView - ctor
// when the ViewShell isn't constructed yet...
@@ -158,7 +159,10 @@ ScTabView::~ScTabView()
pPageBreakData.reset();
- pDrawActual.reset();
+ delete pDrawActual;
+ pDrawActual = nullptr;
+ delete pDrawOld;
+ pDrawOld = nullptr;
if (comphelper::LibreOfficeKit::isActive())
{
@@ -246,7 +250,7 @@ void ScTabView::MakeDrawView( TriState nForceDesignMode )
// so that immediately can be drawn
}
SfxRequest aSfxRequest(SID_OBJECT_SELECT, SfxCallMode::SLOT, aViewData.GetViewShell()->GetPool());
- SetDrawFuncPtr(o3tl::make_unique<FuSelection>(*aViewData.GetViewShell(), GetActiveWin(), pDrawView,
+ SetDrawFuncPtr(new FuSelection(*aViewData.GetViewShell(), GetActiveWin(), pDrawView,
pLayer,aSfxRequest));
// used when switching back from page preview: restore saved design mode state
@@ -684,11 +688,4 @@ void ScTabView::OnLOKNoteStateChanged(const ScPostIt* pNote)
}
}
-void ScTabView::SetDrawFuncPtr(std::unique_ptr<FuPoor> pNew)
-{
- if (pDrawActual)
- pDrawActual->Deactivate();
- pDrawActual = std::move(pNew);
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */