summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/cellsuno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-20 12:54:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-22 09:53:45 +0100
commitb7654432bfeca619b7657abc8d27193e44cf4dfc (patch)
tree0935306e00e967c1dca4efc8af57f4d67c30a508 /sc/source/ui/unoobj/cellsuno.cxx
parentf82888653c853f236ab0035bb578a7129ec72fa5 (diff)
loplugin:useuniqueptr in ScDocument
and fix bug where we were deleting a pointer to an object we did not own via pFormatExchangeList Change-Id: I488c679734c48bd21bc6be04837e037e97550647 Reviewed-on: https://gerrit.libreoffice.org/51668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/cellsuno.cxx')
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 0e6b0ef4e16a..c5830ce06c56 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1485,12 +1485,10 @@ ScCellRangesBase::~ScCellRangesBase()
void ScCellRangesBase::ForgetCurrentAttrs()
{
- delete pCurrentFlat;
- delete pCurrentDeep;
+ pCurrentFlat.reset();
+ pCurrentDeep.reset();
delete pCurrentDataSet;
delete pNoDfltCurrentDataSet;
- pCurrentFlat = nullptr;
- pCurrentDeep = nullptr;
pCurrentDataSet = nullptr;
pNoDfltCurrentDataSet = nullptr;
@@ -1512,7 +1510,7 @@ const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsFlat()
ScDocument& rDoc = pDocShell->GetDocument();
pCurrentFlat = rDoc.CreateSelectionPattern( *GetMarkData(), false );
}
- return pCurrentFlat;
+ return pCurrentFlat.get();
}
const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsDeep()
@@ -1524,7 +1522,7 @@ const ScPatternAttr* ScCellRangesBase::GetCurrentAttrsDeep()
ScDocument& rDoc = pDocShell->GetDocument();
pCurrentDeep = rDoc.CreateSelectionPattern( *GetMarkData() );
}
- return pCurrentDeep;
+ return pCurrentDeep.get();
}
SfxItemSet* ScCellRangesBase::GetCurrentDataSet(bool bNoDflt)