summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen3.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-21 09:50:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-25 15:20:18 +0200
commit537ff805fc4b27e4d553c57f9b9457dc9eebb191 (patch)
treefde5c4666bbc81bfac1d55231b3a8e07d1ed5631 /sc/source/core/data/documen3.cxx
parent5400d1736480d9380f0ed1eeaa546d75889e6653 (diff)
loplugin:useuniqueptr in ScDocument
Change-Id: I117424b6d28d4cc6cc6d7146f9df861a8075a791 Reviewed-on: https://gerrit.libreoffice.org/56320 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/documen3.cxx')
-rw-r--r--sc/source/core/data/documen3.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 21d11f94d95c..91a67ebd583a 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -404,18 +404,17 @@ void ScDocument::StopTemporaryChartLock()
}
void ScDocument::SetChartListenerCollection(
- ScChartListenerCollection* pNewChartListenerCollection,
+ std::unique_ptr<ScChartListenerCollection> pNewChartListenerCollection,
bool bSetChartRangeLists )
{
- ScChartListenerCollection* pOld = pChartListenerCollection;
- pChartListenerCollection = pNewChartListenerCollection;
+ std::unique_ptr<ScChartListenerCollection> pOld = std::move(pChartListenerCollection);
+ pChartListenerCollection = std::move(pNewChartListenerCollection);
if ( pChartListenerCollection )
{
if ( pOld )
pChartListenerCollection->SetDiffDirty( *pOld, bSetChartRangeLists );
pChartListenerCollection->StartAllListeners();
}
- delete pOld;
}
void ScDocument::SetScenario( SCTAB nTab, bool bFlag )
@@ -1983,15 +1982,14 @@ tools::Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow, SCCOL
return aRect;
}
-void ScDocument::SetExtDocOptions( ScExtDocOptions* pNewOptions )
+void ScDocument::SetExtDocOptions( std::unique_ptr<ScExtDocOptions> pNewOptions )
{
- delete pExtDocOptions;
- pExtDocOptions = pNewOptions;
+ pExtDocOptions = std::move(pNewOptions);
}
-void ScDocument::SetClipOptions(const ScClipOptions& rClipOptions)
+void ScDocument::SetClipOptions(std::unique_ptr<ScClipOptions> pClipOptions)
{
- mpClipOptions = o3tl::make_unique<ScClipOptions>(rClipOptions);
+ mpClipOptions = std::move(pClipOptions);
}
void ScDocument::DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,